Public Member Functions | Static Public Member Functions

alma.acs.entityutil.EntitySerializer Class Reference

List of all members.

Public Member Functions

void setXmlEntityFactory (XmlEntityStructFactory esf)
XmlEntityStruct serializeEntity (Object entityObject, EntityT entityMeta) throws EntityException
XmlEntityStruct serializeEntity (Object entityObject) throws EntityException
String serializeEntityPart (Object entityPart) throws EntityException
void setVerbose (boolean verbose)

Static Public Member Functions

static EntitySerializer getEntitySerializer (Logger logger)

Detailed Description

Serializes entity objects. These are instances of binding classes that represent the XML data in a type-safe Java API. Currently all binding classes are generated using the Castor tool.

Author:
hsommer May 6, 2003 5:31:48 PM

Member Function Documentation

static EntitySerializer alma.acs.entityutil.EntitySerializer.getEntitySerializer ( Logger  logger  )  [static]

Singleton accessor.

Parameters:
logger Logger to be used (may be null in subsequent invocations since only one instance of EntitySerializer is constructed and then reused)
Returns:
single instance
XmlEntityStruct alma.acs.entityutil.EntitySerializer.serializeEntity ( Object  entityObject  )  throws EntityException

Marshals an entity object to the CORBA struct used for transport. Unlike in serializeEntity(Object, EntityT), the child of type EntityT that has the administrational information about the entity object, is not given as a parameter. It will be accessed dynamically using EntityTFinder, which makes this method slightly slower than its 2-parameter companion. It's meant to be used rather by generic code that doesn't know about particular entity classes.

Parameters:
entityObject the entity object as a binding class
Returns:
the struct that contains the stringified xml and some other data; null if entityObject is null.

References alma.acs.entityutil.EntityTFinder.extractEntityT(), and alma.acs.entityutil.EntitySerializer.serializeEntity().

XmlEntityStruct alma.acs.entityutil.EntitySerializer.serializeEntity ( Object  entityObject,
EntityT  entityMeta 
) throws EntityException

Marshals an entity object to the CORBA struct used for transport.

Parameters:
entityObject the entity object as a binding class, currently generated by castor.
entityMeta usually subtype of EntityT.
Returns:
the struct that contains the stringified xml and some other data; null if entityObject is null.

References alma.acs.entityutil.XmlEntityStructFactory.createXmlEntityStruct(), and alma.acs.entityutil.EntitySerializer.serializeEntityPart().

Referenced by alma.acs.entityutil.EntitySerializer.serializeEntity().

String alma.acs.entityutil.EntitySerializer.serializeEntityPart ( Object  entityPart  )  throws EntityException

Serializes a binding class object which is a part (child node) of some other full Entity object.

Parameters:
entityPart the binding object, e.g. of type alma.entity.xmlbinding.schedblock.CorrelatorConfigT.
Returns:
a plain XML String that represents the data of entityPart.
Exceptions:
EntityException if the operation could not be performed
See also:
serializeEntity(Object)
serializeEntity(Object, EntityT)

References org.exolab.castor.xml.Marshaller.marshal(), and org.exolab.castor.xml.Marshaller.setValidation().

Referenced by alma.acs.entityutil.EntitySerializer.serializeEntity().

void alma.acs.entityutil.EntitySerializer.setVerbose ( boolean  verbose  ) 
void alma.acs.entityutil.EntitySerializer.setXmlEntityFactory ( XmlEntityStructFactory  esf  ) 

Makes this EntitySerializer use a client-supplied factory for XmlEntityStruct objects.

You should use this method if you wish to get a subclass of alma.xmlentity.XmlEntityStruct returned from the serializeEntity methods.

Parameters:
esf the factory to be used

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties