Package jade.mtp.http
Class XMLCodec
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- jade.mtp.http.XMLCodec
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class XMLCodec extends DefaultHandler
-
-
Field Summary
Fields Modifier and Type Field Description static StringAID_ADDRESSstatic StringAID_ADDRESSESstatic StringAID_NAMEstatic StringAID_TAGstatic StringCOMMENTS_TAGstatic StringCTstatic StringDATE_TAGstatic StringENCODING_TAGstatic StringENVELOPE_TAGstatic StringETstatic StringFROM_TAGstatic StringINDEXstatic StringINDEX_ATTRstatic StringINTENDED_TAGstatic StringLENGTH_TAGstatic StringNAMESPACE_PREFIXES_FEATUREstatic StringNAMESPACES_FEATUREstatic StringNULLstatic StringOTstatic StringPARAMS_TAGstatic StringPREAMBULstatic StringPROP_ATTRstatic StringPROP_ATTR_TYPEstatic StringPROP_BYTE_TYPEstatic StringPROP_SER_TYPEstatic StringPROP_STRING_TYPEstatic StringPROP_TAGstatic StringRECEIVED_ATTRstatic StringRECEIVED_BYstatic StringRECEIVED_DATEstatic StringRECEIVED_FROMstatic StringRECEIVED_IDstatic StringRECEIVED_TAGstatic StringRECEIVED_VIAstatic StringREPRESENTATION_TAGstatic StringSAX_FEATURE_PREFIXstatic StringTO_TAG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] buffer, int start, int length)This method is called when exist characters in the elementsstatic StringencodeXML(Envelope env)General Encoding of the envelopevoidendDocument()This method is called at the end of parsingvoidendElement(String namespaceURL, String localName, String qname)This method is called the end of elementvoiderror(SAXParseException exception)This method is called when errors occurvoidfatalError(SAXParseException exception)This method is called when non-recoverable errors occur.Envelopeparse(Reader in)voidstartDocument()This method is called when start the document XMLvoidstartElement(String uri, String localName, String rawName, Attributes attributes)This method is called when jmp event of begin element.voidwarning(SAXParseException exception)This method is called when warning occur-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
-
-
-
-
Field Detail
-
PREAMBUL
public static final String PREAMBUL
- See Also:
- Constant Field Values
-
ENVELOPE_TAG
public static final String ENVELOPE_TAG
- See Also:
- Constant Field Values
-
PARAMS_TAG
public static final String PARAMS_TAG
- See Also:
- Constant Field Values
-
INDEX
public static final String INDEX
- See Also:
- Constant Field Values
-
INDEX_ATTR
public static final String INDEX_ATTR
- See Also:
- Constant Field Values
-
TO_TAG
public static final String TO_TAG
- See Also:
- Constant Field Values
-
AID_TAG
public static final String AID_TAG
- See Also:
- Constant Field Values
-
AID_NAME
public static final String AID_NAME
- See Also:
- Constant Field Values
-
AID_ADDRESSES
public static final String AID_ADDRESSES
- See Also:
- Constant Field Values
-
AID_ADDRESS
public static final String AID_ADDRESS
- See Also:
- Constant Field Values
-
FROM_TAG
public static final String FROM_TAG
- See Also:
- Constant Field Values
-
COMMENTS_TAG
public static final String COMMENTS_TAG
- See Also:
- Constant Field Values
-
REPRESENTATION_TAG
public static final String REPRESENTATION_TAG
- See Also:
- Constant Field Values
-
LENGTH_TAG
public static final String LENGTH_TAG
- See Also:
- Constant Field Values
-
ENCODING_TAG
public static final String ENCODING_TAG
- See Also:
- Constant Field Values
-
DATE_TAG
public static final String DATE_TAG
- See Also:
- Constant Field Values
-
INTENDED_TAG
public static final String INTENDED_TAG
- See Also:
- Constant Field Values
-
RECEIVED_TAG
public static final String RECEIVED_TAG
- See Also:
- Constant Field Values
-
RECEIVED_DATE
public static final String RECEIVED_DATE
- See Also:
- Constant Field Values
-
RECEIVED_BY
public static final String RECEIVED_BY
- See Also:
- Constant Field Values
-
RECEIVED_FROM
public static final String RECEIVED_FROM
- See Also:
- Constant Field Values
-
RECEIVED_ID
public static final String RECEIVED_ID
- See Also:
- Constant Field Values
-
RECEIVED_VIA
public static final String RECEIVED_VIA
- See Also:
- Constant Field Values
-
RECEIVED_ATTR
public static final String RECEIVED_ATTR
- See Also:
- Constant Field Values
-
PROP_TAG
public static final String PROP_TAG
- See Also:
- Constant Field Values
-
PROP_ATTR
public static final String PROP_ATTR
- See Also:
- Constant Field Values
-
PROP_ATTR_TYPE
public static final String PROP_ATTR_TYPE
- See Also:
- Constant Field Values
-
PROP_STRING_TYPE
public static final String PROP_STRING_TYPE
- See Also:
- Constant Field Values
-
PROP_BYTE_TYPE
public static final String PROP_BYTE_TYPE
- See Also:
- Constant Field Values
-
PROP_SER_TYPE
public static final String PROP_SER_TYPE
- See Also:
- Constant Field Values
-
OT
public static final String OT
- See Also:
- Constant Field Values
-
ET
public static final String ET
- See Also:
- Constant Field Values
-
CT
public static final String CT
- See Also:
- Constant Field Values
-
NULL
public static final String NULL
- See Also:
- Constant Field Values
-
SAX_FEATURE_PREFIX
public static final String SAX_FEATURE_PREFIX
- See Also:
- Constant Field Values
-
NAMESPACES_FEATURE
public static final String NAMESPACES_FEATURE
- See Also:
- Constant Field Values
-
NAMESPACE_PREFIXES_FEATURE
public static final String NAMESPACE_PREFIXES_FEATURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XMLCodec
public XMLCodec(String parserClass) throws MTPException
Constructor:- Parameters:
parserClass- the SAX parser class to use- Throws:
MTPException
-
-
Method Detail
-
startDocument
public void startDocument()
This method is called when start the document XML- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler
-
endDocument
public void endDocument()
This method is called at the end of parsing- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler
-
startElement
public void startElement(String uri, String localName, String rawName, Attributes attributes)
This method is called when jmp event of begin element.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler
-
endElement
public void endElement(String namespaceURL, String localName, String qname)
This method is called the end of element- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler
-
characters
public void characters(char[] buffer, int start, int length)This method is called when exist characters in the elements- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-
warning
public void warning(SAXParseException exception)
This method is called when warning occur- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler
-
error
public void error(SAXParseException exception)
This method is called when errors occur- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler
-
fatalError
public void fatalError(SAXParseException exception) throws SAXException
This method is called when non-recoverable errors occur.- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException
-
parse
public Envelope parse(Reader in) throws MTPException
- Throws:
MTPException
-
-