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

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:
 protected UnmarshalHandler() 
 protected UnmarshalHandler(Class<?> topClass) 
    Creates a new UnmarshalHandler.
    topClass - the Class to create the UnmarshalHandler for
 protected UnmarshalHandler(InternalContext internalContext,
    Class<?> topClass) 
    Creates a new UnmarshalHandler.
    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 


    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) 
    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) 
    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 


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


    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