com.tensegrity.composite.persistence
Class CompositeTableBuilder

java.lang.Object
  extended bycom.tensegrity.composite.persistence.CompositeBuilder
      extended bycom.tensegrity.composite.persistence.CompositeTableBuilder
All Implemented Interfaces:
Builder

public class CompositeTableBuilder
extends CompositeBuilder

This class builds a CompositeTable from an given AttributeList.

Version:
$Id: CompositeTableBuilder.java,v 1.19 2005/08/22 12:30:24 BurkhardWick Exp $
Author:
Andreas Ebbert, Burkhard Wick

Constructor Summary
CompositeTableBuilder()
          Default Constructor.
 
Method Summary
 java.lang.Object build(AttributeList list)
          Creates a composite instance from the given AttributeList.
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(CompositeTable 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, getSize, 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

CompositeTableBuilder

public CompositeTableBuilder()
Default Constructor.

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(com.tensegrity.generic.attribute.AttributeList)

setGroupAttributes

protected void setGroupAttributes(CompositeTable 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.

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.


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