com.tensegrity.composite.style.persistence
Class StyleDescriptorSerializer

java.lang.Object
  extended bycom.tensegrity.composite.style.persistence.StyleDescriptorSerializer
All Implemented Interfaces:
Serializer

public class StyleDescriptorSerializer
extends java.lang.Object
implements Serializer

The StyleDescriptorSerializer creates an AttributeList from a given StyleDescriptor instance by creating simple Attributes for the name and type part and string based references to the (hopefully) previously stored StyleItems.

Version:
$Id: StyleDescriptorSerializer.java,v 1.17 2005/07/18 10:35:31 MichaelKegel Exp $
Author:
Gilles Iachelini

Constructor Summary
StyleDescriptorSerializer(StyleDescriptor item)
          Creates a new StyleDescriptorSerializer.
 
Method Summary
static java.lang.String getTypeName(int type)
          This method returns the matching string constant to a given CompositeType constant.
 AttributeList serialize()
          Translates the information of the object to be serialized into an AttributeList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleDescriptorSerializer

public StyleDescriptorSerializer(StyleDescriptor item)
Creates a new StyleDescriptorSerializer.

Parameters:
item - to serialize.
Method Detail

serialize

public AttributeList serialize()
                        throws SerializeException
Description copied from interface: Serializer
Translates the information of the object to be serialized into an AttributeList.

Specified by:
serialize in interface Serializer
Returns:
the list of translated information.
Throws:
SerializeException - is thrown whenever an error occurs while serializing the given object.
See Also:
Serializer.serialize()

getTypeName

public static final java.lang.String getTypeName(int type)
                                          throws SerializeException
This method returns the matching string constant to a given CompositeType constant.

Parameters:
type - the integer constant of a Composite.
Returns:
the Composite Type constant as string.
Throws:
SerializeException - thrown if the type identifier is smaller than 0 or bigger than the length of the StyleConstantsPersistence#compositeTypeFormats array.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.