|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.zeus.Unmarshaller
Unmarshaller
takes an XML instance document, which should
conform to some set of XML constraints, and creates a Java object from the XML
document. This object is an instance of the implementation class, which
in turn implements the interface, created using an implementation of
.
Generator
It also assumes that the generated interface and implementation classes
are in the classpath, as it will perform a Class.forName
on
the classes.
Field Summary | |
static boolean |
DEBUG
Constant used to signel whether debug messages should be printed out |
protected java.lang.String |
namePrefix
Prefix to be prepended to the name of every generated interface and class. |
Constructor Summary | |
Unmarshaller()
Simple constructor. |
Method Summary | |
java.lang.String |
getImplClass(java.lang.String interfaceName)
For the supplied interface name, this will return the current implementation class associated with the interface. |
java.lang.String |
getJavaPackage()
Returns the Java package to unmarshall classes to. |
java.lang.String |
getNamePrefix()
This method allows the developer to get the prefix that will be prepended to the name of every generated interface and class. |
void |
setImplClass(java.lang.String interfaceName,
java.lang.String implClassName)
For the supplied interface name, this will allow a customized implementation class to be set. |
void |
setJavaPackage(java.lang.String javaPackage)
Sets the Java package to unmarshall classes to. |
void |
setNamePrefix(java.lang.String namePrefix)
This method allows the developer to set a prefix that will be prepended to the name of every generated interface and class. |
UnmarshalledObject |
unmarshal(Source sourceXML)
This method is the public entry point for unmarshalling an object from an XML instance document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static boolean DEBUG
protected java.lang.String namePrefix
Constructor Detail |
public Unmarshaller()
Simple constructor.
Method Detail |
public void setImplClass(java.lang.String interfaceName, java.lang.String implClassName)
For the supplied interface name, this will allow a customized implementation class to be set. This effectively allows the user to specify their own implementation class to use instead of the default, Zeus-generated class.
interfaceName
- String
name of interface being deal with.implClassName
- String
name of class to load when implementations
of interfaceName
are needed.public void setNamePrefix(java.lang.String namePrefix)
This method allows the developer to set a prefix that will be prepended to the name of every generated interface and class.
String
- prefix that will be prepended to the
name of every generated interface and classpublic java.lang.String getNamePrefix()
This method allows the developer to get the prefix that will be prepended to the name of every generated interface and class. Returns an empty string in the case that a prefix is not prepended.
String
prefix that will be prepended
to the name of every generated interface and classpublic java.lang.String getImplClass(java.lang.String interfaceName)
For the supplied interface name, this will return the current implementation class associated with the interface. If no class has been specified, this will return the default, Zeus-generated class name for the interface.
interfaceName
- String
name of interface being dealt with.String
- implementation class for supplied
interfaceName
.public java.lang.String getJavaPackage()
Returns the Java package to unmarshall classes to.
String
- the Java package to unmarshall to.public void setJavaPackage(java.lang.String javaPackage)
Sets the Java package to unmarshall classes to.
javaPackage
- String
the Java package to unmarshall
to.public UnmarshalledObject unmarshal(Source sourceXML) throws java.io.IOException
This method is the public entry point for unmarshalling an object from
an XML instance document. Note that the raw converted object is not
directly returned, but is available through the
method on
UnmarshalledObject.getObject()
.
UnmarshalledObject
XXX: We need to eventually put in Zeus exceptions here, not IOExceptions.
instanceURL
- URL
for the instance document.UnmarshalledObject
- the created Java object, or
null
if problems occur in a way that does not
generate an Exception
.IOException
- when errors in binding occur.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |