org.enhydra.zeus
Class Marshaller

java.lang.Object
  |
  +--org.enhydra.zeus.Marshaller

public class Marshaller
extends java.lang.Object

Marshaller takes a Java Object instance and writes out an XML representation of that object, with each property (variable) of the instance and its value.

Author:
Brett McLaughlin

Field Summary
protected  java.util.List methodsToIgnore
          List of methods to ignore in marshalling.
protected  java.lang.String namePrefix
          Prefix to be prepended to the name of every generated interface and class.
 
Constructor Summary
Marshaller()
           Simple constructor.
 
Method Summary
 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 ignoreMethod(java.lang.String methodToIgnore)
           This will set an (additional) method to ignore in marshalling.
 void marshal(java.lang.Object obj, Result result)
           This method is the public entry point for marshalling an object into an XML instance document.
 void marshal(UnmarshalledObject obj, Result result)
           This method is the public entry point for marshalling an object into an XML instance document.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

methodsToIgnore

protected java.util.List methodsToIgnore
List of methods to ignore in marshalling.

namePrefix

protected java.lang.String namePrefix
Prefix to be prepended to the name of every generated interface and class.
Constructor Detail

Marshaller

public Marshaller()

Simple constructor.

Method Detail

ignoreMethod

public void ignoreMethod(java.lang.String methodToIgnore)

This will set an (additional) method to ignore in marshalling. The argument to this method should be the method name to ignore, without arguments or parenthesis. To ignore the method getFactory(), the value would simply be "getFactory" for this method.

Parameters:
methodToIgnore - name of method to ignore.

setNamePrefix

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.

Parameters:
namePrefix - prefix that will be prepended to the name of every generated interface and class

getNamePrefix

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

Returns:
String prefix that will be prepended to the name of every generated interface and class

marshal

public void marshal(java.lang.Object obj,
                    Result result)
             throws java.io.IOException

This method is the public entry point for marshalling an object into an XML instance document.

Parameters:
obj - Object to convert to XML.
result - Result to write XML to.
Throws:
IOException - when errors in output occur.

marshal

public void marshal(UnmarshalledObject obj,
                    Result result)
             throws java.io.IOException

This method is the public entry point for marshalling an object into an XML instance document. It requires that an object previously unmarshalled by Zeus (an instance of UnmarshalledObject) be supplied.

Parameters:
obj - UnmarshalledObject to convert to XML.
result - Result to write XML to.
Throws:
IOException - when errors in output occur.


Copyright © 2001 Enhydra. All Rights Reserved.