public final class UnmarshalHandler extends MarshalFramework implements org.xml.sax.ContentHandler, org.xml.sax.DocumentHandler, org.xml.sax.ErrorHandler
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
UnmarshalHandler.Arguments
Internal class used for passing constructor argument
information
|
static class |
UnmarshalHandler.ArrayHandler
A class for handling Arrays during unmarshalling.
|
(package private) class |
UnmarshalHandler.ElementInfo
A utility class for keeping track of the
qName and how the SAX parser passed attributes
|
(package private) class |
UnmarshalHandler.IDResolverImpl
Local IDResolver
|
(package private) class |
UnmarshalHandler.ReferenceInfo
Internal class used to save state for reference resolving
|
MarshalFramework.InheritanceMatch, MarshalFramework.InternalXMLClassDescriptorINTERNAL_XML_NAME, JAVA_PREFIX, LANG_ATTR, NIL_ATTR, NO_FIELD_DESCRIPTORS, QNAME_NAME, SPACE_ATTR, TRUE_VALUE, TYPE_ATTR, XML_LANG_ATTR, XML_SPACE_ATTR, XSI_NAMESPACE, XSI_NIL_ATTR, XSI_NO_NAMESPACE_SCHEMA_LOCATION, XSI_SCHEMA_LOCATION| Modifier | Constructor and Description |
|---|---|
protected |
UnmarshalHandler()
Creates a new UnmarshalHandler
The "root" class will be obtained by looking into the mapping
for a descriptor that matches the root element.
|
protected |
UnmarshalHandler(java.lang.Class _class)
Creates a new UnmarshalHandler
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNamespaceToPackageMapping(java.lang.String nsURI,
java.lang.String packageName)
Adds a mapping from the given namespace URI to the given
package name
|
void |
characters(char[] ch,
int start,
int length) |
void |
endDocument() |
void |
endElement(java.lang.String name) |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
ContentHandler#endElement
|
void |
endPrefixMapping(java.lang.String prefix)
Signals to end the namespace prefix mapping
|
void |
error(org.xml.sax.SAXParseException exception) |
void |
fatalError(org.xml.sax.SAXParseException exception) |
java.lang.Object |
getCurrentObject()
Returns the Object that the UnmarshalHandler is currently
handling (within the object model), or null if the current
element is a simpleType.
|
org.xml.sax.Locator |
getDocumentLocator() |
java.lang.Object |
getObject()
Returns the "root" Object (ie.
|
ObjectFactory |
getObjectFactory()
Returns the ObjectFactory instance in use.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length) |
void |
processingInstruction(java.lang.String target,
java.lang.String data) |
void |
setClassLoader(java.lang.ClassLoader loader)
Sets the ClassLoader to use when loading classes
|
void |
setClearCollections(boolean clear)
Sets whether or not to clear collections (including arrays)
upon first use to remove default values.
|
protected void |
setConfiguration(Configuration config)
Sets the current Castor configuration.
|
void |
setDebug(boolean debug)
Turns debuging on or off.
|
void |
setDocumentLocator(org.xml.sax.Locator locator) |
void |
setIDResolver(IDResolver idResolver)
Sets the IDResolver to use when resolving IDREFs for
which no associated element may exist in XML document.
|
void |
setIgnoreExtraAttributes(boolean ignoreExtraAtts)
Sets whether or not attributes that do not match
a specific field should simply be ignored or
reported as an error.
|
void |
setIgnoreExtraElements(boolean ignoreExtraElems)
Sets whether or not elements that do not match
a specific field should simply be ignored or
reported as an error.
|
void |
setLogWriter(java.io.PrintWriter printWriter)
Sets the PrintWriter used for printing log messages
|
void |
setObjectFactory(ObjectFactory objectFactory)
Sets a (custom) ObjectFactory instance.
|
void |
setResolver(XMLClassDescriptorResolver cdResolver)
Sets the ClassDescriptorResolver to use for loading and
resolving ClassDescriptors
|
void |
setReuseObjects(boolean reuse)
Sets a boolean that when true indicates that objects
contained within the object model should be re-used
where appropriate.
|
void |
setRootObject(java.lang.Object root)
Sets the root (top-level) object to use for unmarshalling into.
|
void |
setUnmarshalListener(UnmarshalListener listener)
Sets an
UnmarshalListener. |
void |
setValidation(boolean validate)
Sets the flag for validation.
|
void |
setWhitespacePreserve(boolean preserve)
Sets the top-level whitespace (xml:space) to either
preserving or non preserving.
|
void |
skippedEntity(java.lang.String name)
Signals that an entity was skipped by the parser
|
void |
startDocument()
Signals the start of a new document
|
void |
startElement(java.lang.String name,
org.xml.sax.AttributeList attList)
DocumentHandler#startElement
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
ContentHandler#startElement
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Signals to start the namespace - prefix mapping
|
static java.lang.Object |
toPrimitiveObject(java.lang.Class type,
java.lang.String value)
Converts a String to the given primitive object type
|
void |
warning(org.xml.sax.SAXParseException exception) |
getCollectionHandler, hasFieldsAtLocation, isCollection, isPrimitive, namespaceEquals, primitiveOrWrapperEquals, searchInheritanceprotected UnmarshalHandler()
protected UnmarshalHandler(java.lang.Class _class)
_class - the Class to create the UnmarshalHandler forpublic void addNamespaceToPackageMapping(java.lang.String nsURI,
java.lang.String packageName)
nsURI - the namespace URI to map frompackageName - the package name to map topublic java.lang.Object getCurrentObject()
public java.lang.Object getObject()
public void setClassLoader(java.lang.ClassLoader loader)
loader - the ClassLoader to usepublic void setClearCollections(boolean clear)
clear - the boolean value that when true indicates
collections should be cleared upon first use.public void setDebug(boolean debug)
debug - the flag indicating whether to generate debug information.
A value of true, will turn debuggin on.setLogWriter(java.io.PrintWriter)public void setIDResolver(IDResolver idResolver)
idResolver - the IDResolver to use when resolving
IDREFs for which no associated element may exist in the
XML document.public void setIgnoreExtraAttributes(boolean ignoreExtraAtts)
ignoreExtraAtts - a boolean that when true will
allow non-matched attributes to simply be ignored.public void setIgnoreExtraElements(boolean ignoreExtraElems)
ignoreExtraElems - a boolean that when true will
allow non-matched attributes to simply be ignored.public void setLogWriter(java.io.PrintWriter printWriter)
printWriter - the PrintWriter to use when printing
log messagespublic void setReuseObjects(boolean reuse)
reuse - the boolean indicating whether or not
to re-use existing objects in the object model.public void setResolver(XMLClassDescriptorResolver cdResolver)
cdResolver - the ClassDescriptorResolver to usepublic void setRootObject(java.lang.Object root)
root - the instance to unmarshal into.public void setUnmarshalListener(UnmarshalListener listener)
UnmarshalListener.listener - the UnmarshalListener to use with this instance
of the UnmarshalHandler.public void setValidation(boolean validate)
validate - A boolean to indicate whether or not validation should be done
during umarshalling.
public void setWhitespacePreserve(boolean preserve)
preserve - a boolean that when true enables
whitespace preserving by default.public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in interface org.xml.sax.DocumentHandlerorg.xml.sax.SAXExceptionpublic void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in interface org.xml.sax.DocumentHandlerorg.xml.sax.SAXExceptionpublic void endElement(java.lang.String name)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.DocumentHandlerorg.xml.sax.SAXExceptionpublic void endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
ContentHandler#endElement
Signals the end of an elementendElement in interface org.xml.sax.ContentHandlerlocalName - The name of the element.org.xml.sax.SAXExceptionpublic void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException
endPrefixMapping in interface org.xml.sax.ContentHandlerprefix - the namespace prefixorg.xml.sax.SAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
ignorableWhitespace in interface org.xml.sax.ContentHandlerignorableWhitespace in interface org.xml.sax.DocumentHandlerorg.xml.sax.SAXExceptionpublic void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerprocessingInstruction in interface org.xml.sax.DocumentHandlerorg.xml.sax.SAXExceptionpublic void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator in interface org.xml.sax.ContentHandlersetDocumentLocator in interface org.xml.sax.DocumentHandlerpublic org.xml.sax.Locator getDocumentLocator()
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException
skippedEntity in interface org.xml.sax.ContentHandlername - the skipped entity's nameorg.xml.sax.SAXExceptionpublic void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerstartDocument in interface org.xml.sax.DocumentHandlerorg.xml.sax.SAXExceptionpublic void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
ContentHandler#startElement
Signals the start of element.startElement in interface org.xml.sax.ContentHandlerlocalName - The name of the element.atts - The AttributeList containing the associated attributes for the element.org.xml.sax.SAXExceptionpublic void startElement(java.lang.String name,
org.xml.sax.AttributeList attList)
throws org.xml.sax.SAXException
DocumentHandler#startElement
Signals the start of element.startElement in interface org.xml.sax.DocumentHandlername - The name of the element.attList - The AttributeList containing the associated attributes for the
element.org.xml.sax.SAXExceptionpublic void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
startPrefixMapping in interface org.xml.sax.ContentHandlerprefix - the namespace prefix to mapuri - the namespace URIorg.xml.sax.SAXExceptionpublic void error(org.xml.sax.SAXParseException exception)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException exception)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void warning(org.xml.sax.SAXParseException exception)
throws org.xml.sax.SAXException
warning in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionprotected void setConfiguration(Configuration config)
public static java.lang.Object toPrimitiveObject(java.lang.Class type,
java.lang.String value)
type - the class type of the primitive in which
to convert the String tovalue - the String to convert to a primitivepublic ObjectFactory getObjectFactory()
public void setObjectFactory(ObjectFactory objectFactory)
objectFactory - A (custom) ObjectFactory instanceIntalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com