|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.composite.persistence.CompositeSerializer
The Serializer implementation for Composites. This class converts any Composite based object to an AttributeList. This AttributeList contains all necessary attributes to restore a composite instance from.
| Constructor Summary | |
CompositeSerializer(Composite composite)
Constructor specifying the Composite to serialize. |
|
| Method Summary | |
protected void |
addCompositeAttributes(AttributeList list)
Adds all the attributes of the composite to the given AttributeList instance. |
protected void |
addFlag(AttributeList list,
java.lang.String name,
boolean value)
Method addFlag adds a Flag as attribute to the given list. |
protected void |
addLocation(AttributeList list,
Composite baseComposite)
Method addLocation adds the location of the internal composite to the given list. |
protected void |
addSize(AttributeList list,
java.lang.String attName,
Size size)
Method addLocation adds the size of the internal composite to the given list. |
AttributeList |
serialize()
Returns the CustomAttributes, CoordinateSystem, Location, Size, Transform and Primitives as AttributeList. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CompositeSerializer(Composite composite)
Composite to serialize.
composite - the Composite to serialize.| Method Detail |
public AttributeList serialize()
throws SerializeException
serialize in interface SerializerSerializeException - is thrown whenever an error occurs while
serializing the given object.Serializer.serialize()
protected void addCompositeAttributes(AttributeList list)
throws SerializeException
list - the target list to add the attributes to.
SerializeException - thrown if one of the internally used methods
throws an exception.
protected void addFlag(AttributeList list,
java.lang.String name,
boolean value)
throws AttributeException,
ConstraintViolationException
list - the list to append the attribute on.name - the name of the flag as tag constant.value - the boolean value of the flag.
AttributeException - thrown if the
CompositeConstants#makeAttribute(String, Object) method
throws an exception.
ConstraintViolationException - thrown if the
CompositeConstants#makeAttribute(String, Object) method
throws an exception.
protected void addLocation(AttributeList list,
Composite baseComposite)
throws AttributeException,
ConstraintViolationException
(LOCATION, "coord.components[0],
coord.components[1],...,coord.components[n]).
list - the AttributeList to append the location attribute on.baseComposite - the Composite to save the location for.
AttributeException - thrown if the
CompositeConstants#makeAttribute(String, Object) method
throws an exception.
ConstraintViolationException - thrown if the
CompositeConstants#makeAttribute(String, Object) method
throws an exception.
protected void addSize(AttributeList list,
java.lang.String attName,
Size size)
throws AttributeException,
ConstraintViolationException
(SIZE, "size.extensions[0],
size.extensions[1],...,size.extensions[n]).
list - the AttributeList to append the location attribute on.attName - Name of the desired size attribute.size - Size instance to convert to an AttributeList.
AttributeException - thrown if the
CompositeConstants#makeAttribute(String, Object) method
throws an exception.
ConstraintViolationException - thrown if the
CompositeConstants#makeAttribute(String, Object) method
throws an exception.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||