ca.quine.jcommons.sourceexporter
Class CustomMarshallerExample
java.lang.Object
|
+--ca.quine.jcommons.sourceexporter.SourceMarshaller
|
+--ca.quine.jcommons.sourceexporter.ImmutableMarshaller
|
+--ca.quine.jcommons.sourceexporter.CustomMarshallerExample
- public class CustomMarshallerExample
- extends ImmutableMarshaller
This class provides an example of how to create a custom marshaller for an
immutable class (with no public setter methods).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomMarshallerExample
public CustomMarshallerExample()
doesMarshal
public boolean doesMarshal(Object object)
- Override the doesMarshal method and return true for the
desired class. Keep in mind that getting the class directly
or comparing "getClass().getName()" is much faster than
using "instanceof", and since this method could be called
for every object that's found in the object graph, this
method should run fast.
- Specified by:
doesMarshal
in class ImmutableMarshaller
marshalConstructorParams
protected String marshalConstructorParams(ChainOfResponsibility chainOfResponsibility,
MarshallingContext context,
ClassSource classSource,
Object object)
throws IOException,
IllegalAccessException,
InvocationTargetException,
ClassNotFoundException,
InstantiationException
- Specified by:
marshalConstructorParams
in class ImmutableMarshaller
IOException
IllegalAccessException
InvocationTargetException
ClassNotFoundException
InstantiationException