|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.composite.persistence.CompositeBuilder
The CompositeBuilder creates an instance of Composite by
recreating the primitives of the composite. This class basically uses the
CompositeConstants to create the primitives of the composite.
| Constructor Summary | |
CompositeBuilder()
Constructor for CompositeBuilder. |
|
| Method Summary | |
protected void |
addPrimitives(Composite composite,
AttributeList list)
Adds the Primitives given in the AttributeList
to this group. |
java.lang.Object |
build(AttributeList list)
Creates a composite instance from the given AttributeList. |
protected Coordinate |
getLocation(AttributeList list)
Method getLocation returns a Coordinate from the
LOCATION Attribute. |
protected Size |
getSize(AttributeList list,
java.lang.String attributename)
Method getSize returns a new Size instance from the SIZE attribute. |
protected Size |
getSizeMayBeNull(AttributeList list,
java.lang.String attributename)
Returns a Size instance read from the given AttributeList or null. |
protected Transform2D |
getTransform(java.lang.String s)
Returns the Transform2D instance based on a given
String. |
protected boolean |
readFlag(AttributeList list,
java.lang.String name)
Method readFlag reads the flag identified by the parameter name from the given list and returns the integral boolean value. |
protected boolean |
readFlagMayBeNull(AttributeList list,
java.lang.String name,
boolean defaultValue)
Reads a attribute representing a flag from the given AttributeList and returns the value as integral boolean. |
protected void |
setCompositeAttributes(Composite composite,
AttributeList list)
This method sets the size and flags of the given composite according to the values read from the given AttributeList. |
protected void |
setGeometryAttributes(Composite composite,
AttributeList list)
|
protected void |
setStyleAttributes(Composite composite,
AttributeList list)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CompositeBuilder()
| Method Detail |
public java.lang.Object build(AttributeList list)
throws BuildException
AttributeList.
build in interface Builderlist - the AttributeList holding the informations
specifying the object to be build.
BuildException - whenever an error occurs while building an object.Builder.build(com.tensegrity.generic.attribute.AttributeList)
protected void setCompositeAttributes(Composite composite,
AttributeList list)
throws BuildException
composite - the composite to manipulate.list - the list to obtain the values from.
BuildException - thrown if the
BuilderUtilities.getAttributeValue(AttributeList, String, Class)
call fails.
protected final void setGeometryAttributes(Composite composite,
AttributeList list)
protected final void setStyleAttributes(Composite composite,
AttributeList list)
protected final void addPrimitives(Composite composite,
AttributeList list)
throws BuildException
Primitives given in the AttributeList
to this group. Subclasses may override this method (with empty body), to
avoid adding of primitives.
list - the AttributeList containing Primitives.
BuildException - thrown if the
CompositeConstants#getPrimitive(AttributeList)
throws an exception.
protected final boolean readFlag(AttributeList list,
java.lang.String name)
throws BuildException
list - the AttributeList to read the flag-attribute from.name - The name of the attribute containing the flag.
BuildException - thrown if the BuilderUtilities.getAttributeValue(AttributeList, String, Class)
call fails.
protected final boolean readFlagMayBeNull(AttributeList list,
java.lang.String name,
boolean defaultValue)
throws BuildException
null
the defaultValue is returned.
list - The list to read the attribute from.name - The name of the flag attribute.defaultValue - the default value to return, if the attribute cannot be read
or is null.
BuildException - passed exception from the
BuilderUtilities.getAttributeValueMayBeNull(AttributeList, String, Class)
call.
protected Size getSize(AttributeList list,
java.lang.String attributename)
throws BuildException
list - the AttributeList to read the Size from.attributename - name of the Size Attribute.
BuildException - thrown if the BuilderUtilities.getAttributeValue(AttributeList, String, Class)
call fails.
protected Size getSizeMayBeNull(AttributeList list,
java.lang.String attributename)
throws BuildException
null.
list - The list to read the Size attribute from.attributename - Name of the Size attribute.
null.
BuildException - thrown if the BuilderUtilities.getAttributeValue(AttributeList, String, Class)
call fails.
protected Coordinate getLocation(AttributeList list)
throws BuildException
Coordinate from the
LOCATION Attribute.
list - the AttributeList to read the Location from.
Coordinate instance.
BuildException - thrown if the
BuilderUtilities.getAttributeValue(AttributeList, String, Class)
call fails.protected Transform2D getTransform(java.lang.String s)
Transform2D instance based on a given
String. This String consists of a list of
double values separated by a delimiter.
s - a String defining a transform.
Transform2D.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||