Package fr.dyade.aaa.agent.conf
Class A3CMLSaxWrapper
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- fr.dyade.aaa.agent.conf.A3CMLSaxWrapper
-
- All Implemented Interfaces:
A3CMLWrapper,ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class A3CMLSaxWrapper extends DefaultHandler implements A3CMLWrapper
XML SAX Wrapper for A3 configuration file.
-
-
Field Summary
Fields Modifier and Type Field Description protected A3CMLConfiga3cmlConfig(package private) StringconfWorking attribute used during configuration's(package private) StringconfigNameName of configuration to get from the file.(package private) A3CMLDomaindomainWorking attribute used during domain's definition between start and end element.(package private) StringjvmArgsWorking attribute used during jvmArgs' definition between start and end element.(package private) A3CMLNatnatWorking attribute used during nat' definition between start and end element.(package private) A3CMLNetworknetworkWorking attribute used during network's definition between start and end element.(package private) A3CMLPropertypropertyWorking attribute used during service's definition between start and end element.(package private) A3CMLServerserverWorking attribute used during server's definition between start and end element.(package private) A3CMLServiceserviceWorking attribute used during service's definition between start and end element.
-
Constructor Summary
Constructors Constructor Description A3CMLSaxWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendDocument()Finalizes parsing of a document.voidendElement(String uri, String localName, String rawName)Receive notification of the end of an element.voiderror(SAXParseException e)Handles notification of a recoverable parser error.voidfatalError(SAXParseException e)Handles notification of a non-recoverable parser error.A3CMLConfigparse(Reader cfgReader, String cfgName)Parses the xml file namedcfgFileNameand calls handler methods.voidstartDocument()Initializes parsing of a document.voidstartElement(String uri, String localName, String rawName, Attributes atts)Receive notification of the start of an element.voidwarning(SAXParseException e)Handles notification of a parser warning.-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
-
-
-
-
Field Detail
-
a3cmlConfig
protected A3CMLConfig a3cmlConfig
-
configName
String configName
Name of configuration to get from the file.
-
conf
String conf
Working attribute used during configuration's
-
domain
A3CMLDomain domain
Working attribute used during domain's definition between start and end element.
-
server
A3CMLServer server
Working attribute used during server's definition between start and end element.
-
network
A3CMLNetwork network
Working attribute used during network's definition between start and end element.
-
service
A3CMLService service
Working attribute used during service's definition between start and end element.
-
property
A3CMLProperty property
Working attribute used during service's definition between start and end element.
-
jvmArgs
String jvmArgs
Working attribute used during jvmArgs' definition between start and end element.
-
nat
A3CMLNat nat
Working attribute used during nat' definition between start and end element.
-
-
Method Detail
-
parse
public A3CMLConfig parse(Reader cfgReader, String cfgName) throws Exception
Parses the xml file namedcfgFileNameand calls handler methods. Calls only methodestartDocument(),startElement,endElementandendDocument.- Specified by:
parsein interfaceA3CMLWrapper- Parameters:
cfgReader- the Reader to read the configuration from.cfgName- the name of the configuration- Returns:
- The configuration object.
- Throws:
Exception- unspecialized error
-
fatalError
public void fatalError(SAXParseException e) throws SAXException
Handles notification of a non-recoverable parser error.- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Parameters:
e- The warning information encoded as an exception.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
error
public void error(SAXParseException e) throws SAXException
Handles notification of a recoverable parser error.- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Parameters:
e- The warning information encoded as an exception.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
warning
public void warning(SAXParseException e) throws SAXException
Handles notification of a parser warning.- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Parameters:
e- The warning information encoded as an exception.- Throws:
SAXException- Any SAX exception, possibly wrapping another exception.
-
startDocument
public void startDocument() throws SAXExceptionInitializes parsing of a document.- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException- unspecialized error
-
startElement
public void startElement(String uri, String localName, String rawName, Attributes atts) throws SAXException
Receive notification of the start of an element.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Parameters:
uri- The Namespace URIlocalName- The local namerawName- The qualified nameatts- The attributes attached to the element.- Throws:
SAXException- unspecialized error
-
endElement
public void endElement(String uri, String localName, String rawName) throws SAXException
Receive notification of the end of an element.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
uri- The Namespace URIlocalName- The local namerawName- The qualified name- Throws:
SAXException- unspecialized error
-
endDocument
public void endDocument() throws SAXExceptionFinalizes parsing of a document.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException- unspecialized error
-
-