com.tensegrity.composite.persistence
Class CompositeGroupSerializer

java.lang.Object
  extended bycom.tensegrity.composite.persistence.CompositeSerializer
      extended bycom.tensegrity.composite.persistence.CompositeGroupSerializer
All Implemented Interfaces:
Serializer
Direct Known Subclasses:
CompositeSwimLanePoolSerializer, CompositeSwimLaneSerializer

public class CompositeGroupSerializer
extends CompositeSerializer

The CompositeGroupSerializer is responsible to create AttributeLists for a given CompositeGroup instance.

Version:
$Id: CompositeGroupSerializer.java,v 1.38 2006/04/27 15:30:25 MichaelKegel Exp $
Author:
Gilles Iachelini

Field Summary
protected  CompositeGroup group
          Holding the CompositeGroup to serialize.
 
Constructor Summary
CompositeGroupSerializer(CompositeGroup group)
          Constructor specifying the CompositeGroup to serialize.
 
Method Summary
protected  void addBoundingBox(AttributeList list)
          Adds the Boundingbox of the internal group to the given AttributeList.
protected  void addCompositeGroupAttributes(AttributeList list)
          Adds the attributes of the internal CompositeGroup instance to the given AttributeList.
protected  void addComposites(AttributeList composites)
          Adds all Composites of the internal CompositeGroup to the given AttributeList.
protected  void addContentBorder(AttributeList list)
          Method addContentBorder adds the content border sizes of the internal group to the parameter list.
protected  void addFoldStateAttributes(AttributeList list)
          Adds all fold-relevant elements of the internal group to the given AttributeList.
protected  Attribute getAnchorAttribute(java.lang.String attributeName, Anchor anchor)
           
protected  CompositeGroup getGroup()
          Returns the CompositeGroup to serialize.
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

group

protected CompositeGroup group
Holding the CompositeGroup to serialize.

Constructor Detail

CompositeGroupSerializer

public CompositeGroupSerializer(CompositeGroup group)
Constructor specifying the CompositeGroup to serialize.

Parameters:
group - the CompositeGroup 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.

addComposites

protected void addComposites(AttributeList composites)
                      throws AttributeException,
                             ConstraintViolationException,
                             SerializeException
Adds all Composites of the internal CompositeGroup to the given AttributeList.

Parameters:
composites - the AttributeList to add the composites to.
Throws:
AttributeException - thrown when one of the attribute related operation throws an exception.
ConstraintViolationException - might be thrown if constraints are violated.
SerializeException - thrown if one of the internally used Serializers throws an exception.

addBoundingBox

protected void addBoundingBox(AttributeList list)
                       throws AttributeException,
                              ConstraintViolationException
Adds the Boundingbox of the internal group to the given AttributeList.

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

addContentBorder

protected void addContentBorder(AttributeList list)
                         throws AttributeException,
                                ConstraintViolationException
Method addContentBorder adds the content border sizes of the internal group to the parameter list.

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.

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.

getAnchorAttribute

protected final Attribute getAnchorAttribute(java.lang.String attributeName,
                                             Anchor anchor)
                                      throws IllegalNameException,
                                             IllegalValueException,
                                             ConstraintViolationException
Throws:
IllegalNameException
IllegalValueException
ConstraintViolationException

getGroup

protected CompositeGroup getGroup()
Returns the CompositeGroup to serialize.

Returns:
the CompositeGroup to serialize.


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