com.sssw.jbroker.web.encoding
Class BeanMarshaler
java.lang.Object
|
+--com.sssw.jbroker.web.encoding.BeanMarshaler
- All Implemented Interfaces:
- Deserializer, Deserializer, Marshaler, Serializable, Serializer, Serializer
- public class BeanMarshaler
- extends Object
- implements Marshaler
General purpose marshaler for serializing Java Beans. Only the
read/write properties are marshaled.
- Since:
- jBroker Web 2.0
- See Also:
- Serialized Form
BeanMarshaler
public BeanMarshaler()
- Create a bean marshaler object.
BeanMarshaler
public BeanMarshaler(Class javaType)
- Create a bean marshaler object for a given class.
- Parameters:
javaType - class of beans
getMechanismType
public String getMechanismType()
- Get the serializer's mechanism type. Not used by jBroker Web.
- Specified by:
getMechanismType in interface Serializer
- Returns:
- string with mechanism type
getAttributes
public Attribute[] getAttributes(Object obj)
- Get the element attributes
- Specified by:
getAttributes in interface Serializer
- Parameters:
obj - the object that is being serialized- Returns:
- an array of attributes for the serialzied object
serialize
public void serialize(OutputStream os,
Object obj)
throws IOException
- Serialize the given bean object to the given output stream
- Specified by:
serialize in interface Serializer
- Parameters:
os - the portable output streamobj - the object to write- Throws:
IOException - if an I/O exception occurred during write
deserialize
public Object deserialize(InputStream is,
Class javaType)
throws IOException
- Initialize the given bean object from the given input stream
- Specified by:
deserialize in interface Deserializer
- Parameters:
is - the input stream to read object fromjavaType - the expected Java type- Returns:
- a newly created object initialized from stream
- Throws:
IOException - if an I/O exception occurred duing read
jBroker is a registered trademark of SilverStream Software, Inc.
Copyright © 2001-2002 SilverStream Software, Inc. All Rights Reserved.