|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectraccoon.core.badhnati.castor.CastorParser
public class CastorParser
Reads the contents of a given XML file using Castor XML. TODO Refactor and write test cases.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_MAPPING_FILE_NAME
The Castor XML mapping file used by this component. |
protected StdResolver |
mStdResolver
The URI Resolver used to locate the XML file that has to be loaded. |
Constructor Summary | |
---|---|
CastorParser()
|
Method Summary | |
---|---|
java.lang.Object |
marshal(java.io.InputStream pResourceAsStream,
java.net.URL pMappingFileURL,
java.lang.Class pXmlClass)
Reads the given input stream and instanciates a java bean using Castor XML. |
java.lang.Object |
marshal(java.lang.Object pSource,
java.lang.Object pSourceType,
java.lang.Class pOutputFormat)
Converts a given object to the specified output instance. |
java.lang.Object |
marshal(java.io.Reader pXmlReader,
java.net.URL pMappingFileURL,
java.lang.Class pXmlClass)
Reads the given input stream and instanciates a java bean using Castor XML. |
void |
unmarshal(java.lang.Object pSource,
java.net.URL pMappingFileURL,
java.io.OutputStream pOutputStream)
Converts the given java bean into an XML Stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_MAPPING_FILE_NAME
protected StdResolver mStdResolver
marshal(java.lang.Object, java.lang.Object, java.lang.Class)
Constructor Detail |
---|
public CastorParser()
Method Detail |
---|
public java.lang.Object marshal(java.lang.Object pSource, java.lang.Object pSourceType, java.lang.Class pOutputFormat) throws RaccoonException, java.lang.UnsupportedOperationException
pSource
- the input object that is the source for the conversion process.pSourceType
- the type of the object, can be a class instance, a Castor XML Mapping file (URL to the file),
...pOutputFormat
- the output class desired
pOutputFormat
RaccoonException
- the source couldn't be converted to the output format.
java.lang.UnsupportedOperationException
- if the pOutputFormat
isn't supported.public java.lang.Object marshal(java.io.InputStream pResourceAsStream, java.net.URL pMappingFileURL, java.lang.Class pXmlClass) throws RaccoonException
pResourceAsStream
- the XML input stream.pMappingFileURL
- the URL of the mapping file that Castor XML should use.pXmlClass
- the class of that is desired from the parsing of the XML File.
pXmlClass
RaccoonException
- if the parameters are inconsistent or if the XML file is invalid.public java.lang.Object marshal(java.io.Reader pXmlReader, java.net.URL pMappingFileURL, java.lang.Class pXmlClass) throws RaccoonException
pXmlReader
- the XML input stream.pMappingFileURL
- the URL of the mapping file that Castor XML should use.pXmlClass
- the class of that is desired from the parsing of the XML File.
pXmlClass
RaccoonException
- if the parameters are inconsistent or if the XML file is invalid.public void unmarshal(java.lang.Object pSource, java.net.URL pMappingFileURL, java.io.OutputStream pOutputStream) throws RaccoonException
pSource
- the java bean input sourcepMappingFileURL
- the XML Mapping file for Castor XMLpOutputStream
- the output stream that is to receive the XML string.
RaccoonException
- if the conversion operation fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |