Home » Castor-1.3-src » org.exolab.castor » xml » [javadoc | source]
org.exolab.castor.xml
public final class: UnmarshalHandler [javadoc | source]
java.lang.Object
   org.exolab.castor.xml.MarshalFramework
      org.exolab.castor.xml.UnmarshalHandler

All Implemented Interfaces:
    org$xml$sax$ContentHandler, ErrorHandler, DocumentHandler

An unmarshaller to allowing unmarshaling of XML documents to Java Objects. The Class must specify the proper access methods (setters/getters) in order for instances of the Class to be properly unmarshaled.
Nested Class Summary:
class  UnmarshalHandler.ElementInfo  A utility class for keeping track of the qName and how the SAX parser passed attributes 
class  UnmarshalHandler.Arguments  Internal class used for passing constructor argument information. 
public static class  UnmarshalHandler.ArrayHandler  A class for handling Arrays during unmarshalling. 
Fields inherited from org.exolab.castor.xml.MarshalFramework:
XSI_NAMESPACE,  XSI_SCHEMA_LOCATION,  XSI_NO_NAMESPACE_SCHEMA_LOCATION,  XML_LANG_ATTR,  LANG_ATTR,  NIL_ATTR,  XSI_NIL_ATTR,  XML_SPACE_ATTR,  SPACE_ATTR,  TYPE_ATTR,  TRUE_VALUE,  INTERNAL_XML_NAME,  JAVA_PREFIX,  QNAME_NAME,  NO_FIELD_DESCRIPTORS
Constructor:
 protected UnmarshalHandler() 
 protected UnmarshalHandler(Class<?> topClass) 
    Creates a new UnmarshalHandler.
    Parameters:
    topClass - the Class to create the UnmarshalHandler for
 protected UnmarshalHandler(InternalContext internalContext,
    Class<?> topClass) 
    Creates a new UnmarshalHandler.
    Parameters:
    internalContext - the InternalContext to use
    topClass - the Class to work for
Method from org.exolab.castor.xml.UnmarshalHandler Summary:
addNamespaceToPackageMapping,   characters,   endDocument,   endElement,   endElement,   endPrefixMapping,   error,   fatalError,   getCurrentObject,   getDocumentLocator,   getObject,   getObjectFactory,   ignorableWhitespace,   processingInstruction,   setClassLoader,   setClearCollections,   setDebug,   setDocumentLocator,   setIDResolver,   setIgnoreExtraAttributes,   setIgnoreExtraElements,   setLogWriter,   setObjectFactory,   setReuseObjects,   setRootObject,   setUnmarshalListener,   setUnmarshalListener,   setValidation,   setWhitespacePreserve,   skippedEntity,   startDocument,   startElement,   startElement,   startPrefixMapping,   toPrimitiveObject,   warning
Methods from org.exolab.castor.xml.MarshalFramework:
getCollectionHandler,   getInternalContext,   getJavaNaming,   hasFieldsAtLocation,   isCollection,   isEnum,   isPrimitive,   namespaceEquals,   primitiveOrWrapperEquals,   searchInheritance,   setInternalContext
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.exolab.castor.xml.UnmarshalHandler Detail:
 public  void addNamespaceToPackageMapping(String nsURI,
    String packageName) 
    Adds a mapping from the given namespace URI to the given package name
 public  void characters(char[] ch,
    int start,
    int length) throws SAXException 
 public  void endDocument() throws SAXException 
 public  void endElement(String name) throws SAXException 
 public  void endElement(String namespaceURI,
    String localName,
    String qName) throws SAXException 

    ContentHandler#endElement

    Signals the end of an element
 public  void endPrefixMapping(String prefix) throws SAXException 
    Signals to end the namespace prefix mapping
 public  void error(SAXParseException exception) throws SAXException 
 public  void fatalError(SAXParseException exception) throws SAXException 
 public Object getCurrentObject() 
    Returns the Object that the UnmarshalHandler is currently handling (within the object model), or null if the current element is a simpleType.
 public Locator getDocumentLocator() 
 public Object getObject() 
    Returns the "root" Object (ie. the entire object model) being unmarshalled.
 public ObjectFactory getObjectFactory() 
    Returns the ObjectFactory instance in use.
 public  void ignorableWhitespace(char[] ch,
    int start,
    int length) throws SAXException 
 public  void processingInstruction(String target,
    String data) throws SAXException 
 public  void setClassLoader(ClassLoader loader) 
    Sets the ClassLoader to use when loading classes
 public  void setClearCollections(boolean clear) 
    Sets whether or not to clear collections (including arrays) upon first use to remove default values. By default, and for backward compatibility with previous versions of Castor this value is false, indicating that collections are not cleared before initial use by Castor.
 public  void setDebug(boolean debug) 
Deprecated!
    Included for backward compatibility. Debug is replaced with commons-logging.
 public  void setDocumentLocator(Locator locator) 
 public  void setIDResolver(IDResolver idResolver) 
    Sets the IDResolver to use when resolving IDREFs for which no associated element may exist in XML document.
 public  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. By default, extra attributes are ignored.
 public  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. By default, extra attributes are ignored.
 public  void setLogWriter(PrintWriter printWriter) 
Deprecated!
    Custom logging replaced with commons-logging.
 public  void setObjectFactory(ObjectFactory objectFactory) 
    Sets a (custom) ObjectFactory instance.
 public  void setReuseObjects(boolean reuse) 
    Sets a boolean that when true indicates that objects contained within the object model should be re-used where appropriate. This is only valid when unmarshalling to an existing object.
 public  void setRootObject(Object root) 
    Sets the root (top-level) object to use for unmarshalling into.
 public  void setUnmarshalListener(UnmarshalListener listener) 
Deprecated! please - move to the new org.castor.xml.UnmarshalListener interface

 public  void setUnmarshalListener(UnmarshalListener listener) 
 public  void setValidation(boolean validate) 
    Sets the flag for validation.
 public  void setWhitespacePreserve(boolean preserve) 
    Sets the top-level whitespace (xml:space) to either preserving or non preserving. The XML document can override this value using xml:space on specific elements. This sets the "default" behavior when xml:space="default".
 public  void skippedEntity(String name) throws SAXException 
    Signals that an entity was skipped by the parser
 public  void startDocument() throws SAXException 
    Signals the start of a new document
 public  void startElement(String name,
    AttributeList attList) throws SAXException 

    DocumentHandler#startElement

    Signals the start of element.
 public  void startElement(String namespaceURI,
    String localName,
    String qName,
    Attributes atts) throws SAXException 

    ContentHandler#startElement

    Signals the start of element.
 public  void startPrefixMapping(String prefix,
    String uri) throws SAXException 
    Signals to start the namespace - prefix mapping
 public static Object toPrimitiveObject(Class type,
    String value) 
    Converts a String to the given primitive object type.
 public  void warning(SAXParseException exception) throws SAXException