com.tensegrity.composite.persistence
Class CompositeTableSerializer

java.lang.Object
  extended bycom.tensegrity.composite.persistence.CompositeSerializer
      extended bycom.tensegrity.composite.persistence.CompositeTableSerializer
All Implemented Interfaces:
Serializer

public class CompositeTableSerializer
extends CompositeSerializer

This class serializes a CompositeTable into an AttributeList that than can be written out to an XML-file.

Version:
$Id: CompositeTableSerializer.java,v 1.17 2005/11/03 12:26:25 BurkhardWick Exp $
Author:
Andreas Ebbert, Burkhard Wick

Field Summary
static java.lang.String COMPOSITETABLECELL
          Constant used to serialize/build a cell of a CompositeTable
static java.lang.String COMPOSITETABLECELLS
          Constant used to serialize/build the list of cells of a CompositeTable
 
Constructor Summary
CompositeTableSerializer(CompositeTable table)
          Constructor specifying the CompositeGroup to serialize.
 
Method Summary
protected  void addCompositeGroupAttributes(AttributeList list)
          Adds the attributes of the internal CompositeGroup instance to the given AttributeList.
protected  void addFoldStateAttributes(AttributeList list)
          Adds all fold-relevant elements of the internal group to the given AttributeList.
protected  Attribute getSizeAttribute(java.lang.String attributeName, Size size)
          Returns an Attribute for a given Size instance.
 AttributeList serialize()
          Returns the CustomAttributes, CoordinateSystem, Location, Size, Transform and Primitives as AttributeList.
 
Methods inherited from class com.tensegrity.composite.persistence.CompositeSerializer
addCompositeAttributes, addFlag, addLocation, addSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPOSITETABLECELL

public static final java.lang.String COMPOSITETABLECELL
Constant used to serialize/build a cell of a CompositeTable

See Also:
Constant Field Values

COMPOSITETABLECELLS

public static final java.lang.String COMPOSITETABLECELLS
Constant used to serialize/build the list of cells of a CompositeTable

See Also:
Constant Field Values
Constructor Detail

CompositeTableSerializer

public CompositeTableSerializer(CompositeTable table)
Constructor specifying the CompositeGroup to serialize.

Parameters:
table - the CompositeTable to serialize.
Method Detail

serialize

public AttributeList serialize()
                        throws SerializeException
Description copied from class: CompositeSerializer
Returns the CustomAttributes, CoordinateSystem, Location, Size, Transform and Primitives as AttributeList.

Specified by:
serialize in interface Serializer
Overrides:
serialize in class CompositeSerializer
Throws:
SerializeException
See Also:
Serializer.serialize()

addCompositeGroupAttributes

protected void addCompositeGroupAttributes(AttributeList list)
                                    throws SerializeException
Adds the attributes of the internal CompositeGroup instance to the given AttributeList.

Parameters:
list - target list to add the values too.
Throws:
SerializeException - thrown whenever one of the attribute related operations throws an exception.

addFoldStateAttributes

protected void addFoldStateAttributes(AttributeList list)
                               throws AttributeException,
                                      ConstraintViolationException
Adds all fold-relevant elements of the internal group to the given AttributeList.

Parameters:
list - the AttributeList to add the content border sizes to.
Throws:
AttributeException - thrown when one of the attribute related operation throws an exception.
ConstraintViolationException - might be thrown if constraints are violated.

getSizeAttribute

protected Attribute getSizeAttribute(java.lang.String attributeName,
                                     Size size)
                              throws ConstraintViolationException,
                                     AttributeException
Returns an Attribute for a given Size instance. The method concatenates the size values comma separated and puts them into the value part of the resulting Attribute.

Parameters:
attributeName - a name for the returned Attribute.
size - the Size to retrieve an Attribute holding all significant properties for.
Returns:
the attribute containing a size.
Throws:
AttributeException - thrown when one of the attribute related operation throws an exception.
ConstraintViolationException - might be thrown if constraints are violated.


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