com.tensegrity.composite.geometry.persistence
Class GeometryDescriptorBuilder

java.lang.Object
  extended bycom.tensegrity.composite.geometry.persistence.GeometryDescriptorBuilder
All Implemented Interfaces:
Builder

public class GeometryDescriptorBuilder
extends java.lang.Object
implements Builder

The GeometryDescriptorBuilder creates an instance of GeometryDescriptor from an AttributeList. It uses the GeometryDescriptorItemBuilder to reconstruct the GeometryDescriptorItem's. Coordinates are restored by using the CoordinateSystemPool.

Version:
$Id: GeometryDescriptorBuilder.java,v 1.25 2005/01/20 14:51:14 BurkhardWick Exp $
Author:
Gilles Iachelini

Constructor Summary
GeometryDescriptorBuilder()
          Constructor for GeometryDescriptorBuilder.
 
Method Summary
 java.lang.Object build(AttributeList attributes)
          Builds an object from the given AttributeList by reading all required Attributes and its values and creating the object from.
protected  CoordinateSystem createCoordinateSystem(AttributeList list)
          Creates a CoordinateSystem from the given list of double values.
protected  int getType(java.lang.String s)
          Returns the int constant descriptor type for a given String from a XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryDescriptorBuilder

public GeometryDescriptorBuilder()
Constructor for GeometryDescriptorBuilder.

Method Detail

build

public java.lang.Object build(AttributeList attributes)
                       throws BuildException
Description copied from interface: Builder
Builds an object from the given AttributeList by reading all required Attributes and its values and creating the object from.

Specified by:
build in interface Builder
Parameters:
attributes - the AttributeList holding the informations specifying the object to be build.
Returns:
Object the built object.
Throws:
BuildException - whenever an error occurs while building an object.

createCoordinateSystem

protected CoordinateSystem createCoordinateSystem(AttributeList list)
                                           throws BuildException
Creates a CoordinateSystem from the given list of double values.

Parameters:
list - AttributeList with the 4 necessary attributes.
Returns:
the resulting CoordinateSystem.
Throws:
BuildException - thrown if GeometryPersistenceUtilities#getDoubles(String) throws a NumberFormatException.

getType

protected int getType(java.lang.String s)
               throws BuildException
Returns the int constant descriptor type for a given String from a XML file.

Parameters:
s - the String to get the type for.
Returns:
the corresponding int constant descriptor.
Throws:
BuildException - thrown if the passed string could not be identified.


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