com.tensegrity.composite.style.persistence
Class StyleItemSerializer

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

public class StyleItemSerializer
extends java.lang.Object
implements Serializer

The StyleItemSerializer creates an AttributeList from a StyleItem instance. This class mainly consists of static methods to create suitable AttributeSets for all sorts of formats like they are defined in com.tensegrity.graphics.

Version:
$Id: StyleItemSerializer.java,v 1.32 2005/07/20 10:02:37 BurkhardWick Exp $
Author:
Gilles Iachelini

Constructor Summary
StyleItemSerializer(StyleItem item)
          Constructor for StyleItemSerializer.
 
Method Summary
static java.lang.String getTypeName(int type)
          This method returns the matching string constant to a given ItemType 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

StyleItemSerializer

public StyleItemSerializer(StyleItem item)
Constructor for StyleItemSerializer.

Parameters:
item - the StyleItem 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.

getTypeName

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

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


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