Class SAXConnector
java.lang.Object
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.SAXConnector
- All Implemented Interfaces:
UnmarshallerHandler,ContentHandler
Receives SAX events and convert them to our internal events.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] buf, int start, int len) voidvoidendElement(String uri, String localName, String qName) voidendPrefixMapping(String prefix) Obtains the unmarshalled result.voidignorableWhitespace(char[] buf, int start, int len) voidprocessingInstruction(String target, String data) voidsetDocumentLocator(Locator locator) voidskippedEntity(String name) voidvoidstartElement(String uri, String local, String qname, Attributes atts) voidstartPrefixMapping(String prefix, String uri) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
SAXConnector
- Parameters:
externalLocator- If the caller is producing SAX events from sources other than Unicode and angle brackets, the caller can override the default SAXLocatorobject by this object to provide better location information.
-
-
Method Details
-
getResult
Description copied from interface:UnmarshallerHandlerObtains the unmarshalled result.This method can be called only after this handler receives the endDocument SAX event.
- Specified by:
getResultin interfaceUnmarshallerHandler- Returns:
- always return a non-null valid object which was unmarshalled.
- Throws:
JAXBException- if there is any unmarshalling error. Note that the implementation is allowed to throw SAXException during the parsing when it finds an error.IllegalStateException- if this method is called before this handler receives the endDocument event.
-
getContext
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String local, String qname, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
characters
public void characters(char[] buf, int start, int len) - Specified by:
charactersin interfaceContentHandler
-
ignorableWhitespace
public void ignorableWhitespace(char[] buf, int start, int len) - Specified by:
ignorableWhitespacein interfaceContentHandler
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler
-