com.tensegrity.composite.style.persistence
Class StyleItemBuilder

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

public class StyleItemBuilder
extends java.lang.Object
implements Builder

The StyleItemBuilder creates StyleItem instances from a given AttributeList. Basically it means to restore the name and type value and create the appropriate Format instance from a (canonical) string.

Version:
$Id: StyleItemBuilder.java,v 1.35 2005/07/26 13:13:01 MichaelKegel Exp $
Author:
Gilles Iachelini

Constructor Summary
StyleItemBuilder()
          Constructor for StyleItemBuilder.
 
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  AttributeSet convertSet(AttributeSet set)
          Method convertSet creates an AttributeSet from a given set of Formats.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleItemBuilder

public StyleItemBuilder()
Constructor for StyleItemBuilder.

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.
See Also:
Builder.build(AttributeList)

convertSet

protected AttributeSet convertSet(AttributeSet set)
                           throws BuildException,
                                  ConstraintViolationException,
                                  AttributeException
Method convertSet creates an AttributeSet from a given set of Formats. A BuildException is thrown, if null is passed. The set is immediately returned, if its empty. Every non-empty set is asserted to contain either a Border or a Stroke attribute.

Parameters:
set - the AttributeSet to convert.
Returns:
AttributeSet the attribute set, with all formats converted to name-value list.
Throws:
BuildException - thrown if null is passed as argument.
ConstraintViolationException - thrown if the AttributeSet manipulation fails.
IllegalAttributeException - thrown if the AttributeSet manipulation fails.
AttributeException


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