|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.castor.xml.MarshalFramework | +--org.exolab.castor.xml.Marshaller
A Marshaller to allowing serializing Java Object's to XML
Field Summary | |
static java.lang.String |
XSI_NAMESPACE
The XSI Namespace URI |
Constructor Summary | |
Marshaller(org.xml.sax.DocumentHandler handler)
Creates a new Marshaller |
|
Marshaller(org.w3c.dom.Node node)
Creates a new Marshaller |
|
Marshaller(java.io.Writer out)
Creates a new Marshaller with the given writer |
Method Summary | |
boolean |
getMarshalExtendedType()
If True the marshaller will use the 'xsi:type' attribute to marshall a field value that extended the defined field type. |
boolean |
getNSPrefixAtRoot()
Returns True if the given namespace mappings will be declared at the root node. |
void |
marshal(java.lang.Object object)
Marshals the given Object as XML using the DocumentHandler for this Marshaller. |
static void |
marshal(java.lang.Object object,
org.xml.sax.DocumentHandler handler)
Marshals the given Object as XML using the given DocumentHandler to send events to. |
static void |
marshal(java.lang.Object object,
org.w3c.dom.Node node)
Marshals the given Object as XML using the given DOM Node to send events to. |
static void |
marshal(java.lang.Object object,
java.io.Writer out)
Marshals the given Object as XML using the given writer |
void |
setDebug(boolean debug)
Sets the flag to turn on and off debugging |
void |
setLogWriter(java.io.PrintWriter printWriter)
Sets the PrintWriter used for logging |
void |
setMapping(Mapping mapping)
Sets the given mapping to be used by the marshalling Framework. |
void |
setMarshalAsDocument(boolean asDocument)
Sets whether or not to marshal as a document which includes the XML declaration, and if necessary the DOCTYPE declaration. |
void |
setMarshalExtendedType(boolean marshallExtendedType)
If True the marshaller will use the 'xsi:type' attribute to marshall a field value that extended the defined field type. |
void |
setNamespaceMapping(java.lang.String nsPrefix,
java.lang.String nsURI)
Sets the mapping for the given Namespace prefix |
void |
setNSPrefixAtRoot(boolean nsPrefixAtRoot)
Set to True to declare the given namespace mappings at the root node. |
void |
setResolver(ClassDescriptorResolver cdr)
Sets the ClassDescriptorResolver to use during unmarshalling |
void |
setValidation(boolean validate)
Sets whether or not to validate the object model before marshalling. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String XSI_NAMESPACE
Constructor Detail |
public Marshaller(org.xml.sax.DocumentHandler handler)
public Marshaller(java.io.Writer out) throws java.io.IOException
out
- the Writer to serialize topublic Marshaller(org.w3c.dom.Node node)
Method Detail |
public void setMarshalAsDocument(boolean asDocument)
asDocument
- a boolean, when true, indicating to marshal
as a complete XML document.public void setMapping(Mapping mapping) throws MappingException
mapping
- the mapping to using during marshallingpublic void setNamespaceMapping(java.lang.String nsPrefix, java.lang.String nsURI)
nsPrefix
- the namespace prefixnsURI
- the namespace that the prefix resolves topublic void setNSPrefixAtRoot(boolean nsPrefixAtRoot)
nsPrefixAtRoot
- public boolean getNSPrefixAtRoot()
public void setResolver(ClassDescriptorResolver cdr)
cdr
- the ClassDescriptorResolver to use
Note: This method will nullify any Mapping
currently being used by this Marshaller
public void setValidation(boolean validate)
validate
- the boolean indicating whether or not to
validate the object model before marshalling.public void setMarshalExtendedType(boolean marshallExtendedType)
public boolean getMarshalExtendedType()
public static void marshal(java.lang.Object object, java.io.Writer out) throws MarshalException, ValidationException
obj
- the Object to marshalout
- the writer to marshal topublic static void marshal(java.lang.Object object, org.xml.sax.DocumentHandler handler) throws MarshalException, ValidationException
obj
- the Object to marshalhandler
- the DocumentHandler to marshal topublic static void marshal(java.lang.Object object, org.w3c.dom.Node node) throws MarshalException, ValidationException
obj
- the Object to marshalnode
- the DOM Node to marshal topublic void marshal(java.lang.Object object) throws MarshalException, ValidationException
obj
- the Object to marshalpublic void setDebug(boolean debug)
debug
- the flag indicating whether or not debug information
should be generatedpublic void setLogWriter(java.io.PrintWriter printWriter)
printWriter
- the PrintWriter to use for logging
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |