|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.castor.xml.Unmarshaller
An unmarshaller to allowing unmarshalling 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 unmarshalled.
Constructor Summary | |
Unmarshaller(java.lang.Class c)
Creates a new Unmarshaller with the given Class |
|
Unmarshaller(java.lang.Class c,
java.lang.ClassLoader loader)
Creates a new Unmarshaller with the given Class |
|
Unmarshaller(Mapping mapping)
Creates a new Unmarshaller with the given Mapping |
Method Summary | |
void |
setClassLoader(java.lang.ClassLoader loader)
Sets the ClassLoader to use when loading new classes |
void |
setDebug(boolean debug)
Turns debuging on or off. |
void |
setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Sets the EntityResolver to use when resolving system and public ids with respect to entites and Document Type. |
void |
setIDResolver(IDResolver idResolver)
Sets the IDResolver to use when resolving IDREFs for which no associated element may exist in XML document. |
void |
setLogWriter(java.io.PrintWriter printWriter)
Sets the PrintWriter used for logging |
void |
setMapping(Mapping mapping)
Sets the Mapping to use during unmarshalling. |
void |
setResolver(ClassDescriptorResolver cdr)
Sets the ClassDescriptorResolver to use during unmarshalling |
void |
setValidation(boolean validate)
Sets the flag for validation |
static java.lang.Object |
unmarshal(java.lang.Class c,
org.xml.sax.InputSource source)
Unmarshals Objects of the given Class type. |
static java.lang.Object |
unmarshal(java.lang.Class c,
org.w3c.dom.Node node)
Unmarshals Objects of the given Class type. |
static java.lang.Object |
unmarshal(java.lang.Class c,
java.io.Reader reader)
Unmarshals Objects of the given Class type. |
java.lang.Object |
unmarshal(EventProducer eventProducer)
Unmarshals Objects of this Unmarshaller's Class type. |
java.lang.Object |
unmarshal(org.xml.sax.InputSource source)
Unmarshals Objects of this Unmarshaller's Class type. |
java.lang.Object |
unmarshal(org.w3c.dom.Node node)
Unmarshals Objects of this Unmarshaller's Class type. |
java.lang.Object |
unmarshal(java.io.Reader reader)
Unmarshals Objects of this Unmarshaller's Class type. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Unmarshaller(java.lang.Class c)
c
- the Class to create the Unmarshaller for, this
may be null, if the Unmarshaller#setMapping is called
to load a mapping for the root element of xml document.public Unmarshaller(java.lang.Class c, java.lang.ClassLoader loader)
c
- the Class to create the Unmarshaller for, this
may be null, if the Unmarshaller#setMapping is called
to load a mapping for the root element of xml document.loader,
- the ClassLoader to use.public Unmarshaller(Mapping mapping) throws MappingException
mapping,
- the Mapping to useMethod Detail |
public void setClassLoader(java.lang.ClassLoader loader)
loader
- the ClassLoader to usepublic void setDebug(boolean debug)
debug
- the flag indicating whether to generate debug information.
A value of true, will turn debuggin on.#setLogWriter.
public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
entityResolver
- the EntityResolver to use when
resolving System and Public ids.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 setLogWriter(java.io.PrintWriter printWriter)
printWriter
- the PrintWriter to use for loggingpublic void setMapping(Mapping mapping) throws MappingException
mapping
- the Mapping to use during unmarshalling.setResolver
public void setResolver(ClassDescriptorResolver cdr)
cdr
- the ClassDescriptorResolver to use
Note: This method will nullify any Mapping
currently being used by this Unmarshaller
public void setValidation(boolean validate)
validate,
- a boolean to indicate whether or not
validation should be done during umarshalling. public java.lang.Object unmarshal(java.io.Reader reader) throws MarshalException, ValidationException
reader
- the Reader to read the XML frompublic java.lang.Object unmarshal(EventProducer eventProducer) throws MarshalException, ValidationException
eventProducer
- the EventProducer which produces
the SAX eventspublic java.lang.Object unmarshal(org.xml.sax.InputSource source) throws MarshalException, ValidationException
source
- the InputSource to read the XML frompublic java.lang.Object unmarshal(org.w3c.dom.Node node) throws MarshalException, ValidationException
node
- the DOM node to read the XML frompublic static java.lang.Object unmarshal(java.lang.Class c, java.io.Reader reader) throws MarshalException, ValidationException
c
- the Class to create a new instance ofreader
- the Reader to read the XML frompublic static java.lang.Object unmarshal(java.lang.Class c, org.xml.sax.InputSource source) throws MarshalException, ValidationException
c
- the Class to create a new instance ofsource
- the InputSource to read the XML frompublic static java.lang.Object unmarshal(java.lang.Class c, org.w3c.dom.Node node) throws MarshalException, ValidationException
c
- the Class to create a new instance ofsource
- the DOM Node to read the XML from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |