com.tensegrity.composite.style.persistence
Class StyleDescriptorBuilder

java.lang.Object
  extended bycom.tensegrity.composite.style.persistence.StyleDescriptorBuilder
All Implemented Interfaces:
Builder

public class StyleDescriptorBuilder
extends java.lang.Object
implements Builder

The StyleDescriptorBuilder restores StyleDescriptor instances from an AttributeList. The style items arent restored here and must be available through the StyleItemPool, because the StyleDescriptorSerializer only stores the names of these items (to avoid redundancy).

Version:
$Id: StyleDescriptorBuilder.java,v 1.34 2005/01/19 17:19:35 MichaelKegel Exp $
Author:
Gilles Iachelini

Constructor Summary
StyleDescriptorBuilder()
          Creates the StyleDescriptorBuilder.
 
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  java.util.List getItems(AttributeList list)
          Method getItems returns all stored StyleDescriptorItems of this StyleDescriptor.
protected  int getType(java.lang.String s)
          This method returns the Composite Constant integer for a given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleDescriptorBuilder

public StyleDescriptorBuilder()
Creates the StyleDescriptorBuilder.

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.

getType

protected int getType(java.lang.String s)
               throws BuildException
This method returns the Composite Constant integer for a given string.

Parameters:
s - the composite type constant as string.
Returns:
the composite type constant as int.
Throws:
BuildException - thrown if null or empty string has been passed or FormatUtilities.getIdentifier(String[], int[], String) fails.

getItems

protected java.util.List getItems(AttributeList list)
                           throws BuildException,
                                  StyleItemNotFoundException
Method getItems returns all stored StyleDescriptorItems of this StyleDescriptor.

Parameters:
list - the AttributeList with all the names of the styleDescriptorItems.
Returns:
List an ArrayList containing the StyleDescriptorItems.
Throws:
BuildException - thrown if an error occurs during the attribute manipulation.
StyleItemNotFoundException - thrown if an empty or null list has been passed.


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