org.enhydra.zeus
Class Unmarshaller


public class 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.

Author:
Brett McLaughlin
Version: 1.0

Constructor Summary
Unmarshaller()
           Simple constructor.

Method Summary
 StringgetImplClass(String interfaceName)
           For the supplied interface name, this will return the current implementation class associated with the interface.
 voidsetImplClass(String interfaceName, String implClassName)
           For the supplied interface name, this will allow a customized implementation class to be set.
 Objectunmarshall(Source sourceXML)
           This method is the public entry point for unmarshalling an object from an XML instance document.

Constructor Detail

Unmarshaller

public Unmarshaller()

Simple constructor.

Method Detail

getImplClass

public String getImplClass(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.

Parameters:
interfaceName - String name of interface being dealt with.
Returns: String - implementation class for supplied interfaceName.

setImplClass

public void setImplClass(String interfaceName, 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.

Parameters:
interfaceName - String name of interface being deal with.
implClassName - String name of class to load when implementations of interfaceName are needed.

unmarshall

public Object unmarshall(Source sourceXML)
throws java.io.IOException

This method is the public entry point for unmarshalling an object from an XML instance document.

XXX: We need to eventually put in Zeus exceptions here, not IOExceptions.

Parameters:
instanceURL - URL for the instance document.
Returns: Object - the created Java object, or null if problems occur in a way that does not generate an Exception.
Throws:
IOException - when errors in binding occur.

Association Links

to Class java.util.Map

Store interface/implementation class mappings