org.apache.cocoon.portal.persistence.castor
Class CastorSourceConverter
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.portal.persistence.castor.CastorSourceConverter
- All Implemented Interfaces:
- Configurable, Converter, Initializable, LogEnabled, Serviceable, ThreadSafe
- public class CastorSourceConverter
- extends AbstractLogEnabled
- implements Serviceable, Configurable, Initializable, ThreadSafe, Converter
This is a component that converts a profile (= object tree) to XML and vice-versa
using Castor. It could be used to persist objects as a XML representation.
In order to work properly the methods provided by this interface require some
parameters:
objectmap : containing a map of objects for resolving references during load
profiletype: specifying the mapping (e.g. in the portal this is one of layout, copletinstancedata, copletdata or copletbasedate)
suppressXSIType: Sets whether or not the xsi:type attributes should appear on the marshalled document.
- Version:
- $Id: CastorSourceConverter.java 328453 2005-10-25 19:08:53Z cziegeler $
Fields inherited from interface org.apache.cocoon.portal.persistence.Converter |
ROLE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mappingSources
protected Map mappingSources
manager
protected ServiceManager manager
mappings
protected Map mappings
defaultSuppressXSIType
protected boolean defaultSuppressXSIType
defaultValidateUnmarshalling
protected boolean defaultValidateUnmarshalling
idResolver
protected CastorSourceConverter.ReferenceResolver idResolver
- This object resolves the references between the different profile files.
CastorSourceConverter
public CastorSourceConverter()
getObject
public Object getObject(InputStream stream,
String mappingName,
Map references,
Map parameters)
throws ConverterException
- Description copied from interface:
Converter
- Load an object from the given input stream.
- Specified by:
getObject
in interface Converter
- Parameters:
stream
- The input stream with the data.mappingName
- ProfileLS
references
- A map of references referenced from the profile.parameters
- An optional map of parameters for the conversion.
- Returns:
- The loaded object.
- Throws:
ConverterException
- See Also:
Converter.getObject(java.io.InputStream, java.lang.String, java.util.Map, java.util.Map)
storeObject
public void storeObject(OutputStream stream,
String mappingName,
Object object,
Map parameters)
throws ConverterException
- Description copied from interface:
Converter
- Save an object to a given stream.
- Specified by:
storeObject
in interface Converter
- Parameters:
stream
- The output stream.mappingName
- ProfileLS
object
- The object to save.parameters
- An optional map of parameters for the conversion.
- Throws:
ConverterException
- See Also:
Converter.storeObject(java.io.OutputStream, java.lang.String, java.lang.Object, java.util.Map)
service
public void service(ServiceManager manager)
throws ServiceException
- Specified by:
service
in interface Serviceable
- Throws:
ServiceException
- See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
configure
public void configure(Configuration config)
throws ConfigurationException
- Specified by:
configure
in interface Configurable
- Throws:
ConfigurationException
- See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
initialize
public void initialize()
throws Exception
- Specified by:
initialize
in interface Initializable
- Throws:
Exception
- See Also:
Initializable.initialize()
Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.