com.tensegrity.composite.persistence
Class CompositeGroupBuilder

java.lang.Object
  extended bycom.tensegrity.composite.persistence.CompositeBuilder
      extended bycom.tensegrity.composite.persistence.CompositeGroupBuilder
All Implemented Interfaces:
Builder
Direct Known Subclasses:
CompositeSwimLaneBuilder, CompositeSwimLanePoolBuilder

public class CompositeGroupBuilder
extends CompositeBuilder

The class CompositeGroupBuilder creates a CompositeGroup instance from a given AttributeList containing the definition of such group.

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

Constructor Summary
CompositeGroupBuilder()
          Constructor for CompositeGroupBuilder.
 
Method Summary
 java.lang.Object build(AttributeList list)
          Creates a composite instance from the given AttributeList.
protected  Anchor getAnchorMayBeNull(AttributeList list, java.lang.String attributename)
           
protected  Size getSize(AttributeList list, java.lang.String attributeName)
          Returns an instance of Size created by the passed AttributeList elements.
protected  Size getSizeMayBeNull(AttributeList list, java.lang.String attributeName, Size defaultValue)
          This method returns an instance of size read from the given AttributeList.
protected  void setGroupAttributes(CompositeGroup group, AttributeList list)
          Applies the attributes from the given list to the given group.
 
Methods inherited from class com.tensegrity.composite.persistence.CompositeBuilder
addPrimitives, getLocation, getSizeMayBeNull, getTransform, readFlag, readFlagMayBeNull, setCompositeAttributes, setGeometryAttributes, setStyleAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeGroupBuilder

public CompositeGroupBuilder()
Constructor for CompositeGroupBuilder.

Method Detail

build

public java.lang.Object build(AttributeList list)
                       throws BuildException
Description copied from class: CompositeBuilder
Creates a composite instance from the given AttributeList.

Specified by:
build in interface Builder
Overrides:
build in class CompositeBuilder
Returns:
the build composite.
Throws:
BuildException
See Also:
Builder.build(AttributeList)

setGroupAttributes

protected void setGroupAttributes(CompositeGroup group,
                                  AttributeList list)
                           throws BuildException
Applies the attributes from the given list to the given group.

Parameters:
group - the CompositeGroup to apply the Attributes to.
list - a AttributeList holding the Attributes.
Throws:
BuildException - thrown if one of the internally used methods throws an exception.

getSize

protected Size getSize(AttributeList list,
                       java.lang.String attributeName)
                throws BuildException
Returns an instance of Size created by the passed AttributeList elements.

Overrides:
getSize in class CompositeBuilder
Parameters:
list - the AttributeList.
attributeName - the name of the Attribute.
Returns:
Size created by the passed AttributeList.
Throws:
BuildException

getSizeMayBeNull

protected Size getSizeMayBeNull(AttributeList list,
                                java.lang.String attributeName,
                                Size defaultValue)
                         throws BuildException
This method returns an instance of size read from the given AttributeList. The method reads the attributeName-attribute and creates the Size instance from it. If no such attribute can be read or the value is null, the parameter defaultValue is returned.

Parameters:
list - the AttributeList to read the size attribute from.
attributeName - the name of the attribute in the list which value is a serialized Size instance.
defaultValue - the value which should be returned, if no such attribute is found or its value is null.
Returns:
An instance of Size, either the one created from the AttributeList or the default value.
Throws:
BuildException - thrown if BuilderUtilities.getAttributeValueMayBeNull(AttributeList, String, Class) throws an exception.

getAnchorMayBeNull

protected Anchor getAnchorMayBeNull(AttributeList list,
                                    java.lang.String attributename)
                             throws BuildException
Throws:
BuildException


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