it.amattioli.workstate.config
Class MetaAttributeBuilder

Show UML class diagram
java.lang.Object
  extended by it.amattioli.workstate.config.MetaAttributeBuilder

public class MetaAttributeBuilder
extends Object

Build a MetaAttribute starting from the strings read from a data source.


Constructor Summary
MetaAttributeBuilder(String tag, String attrClass, String initialExpr)
          Constructs a builder given the base MetaAttribute parameters: The tag The class The initial value
 
Method Summary
 void addValidator(String validator)
          Add a validator object for the attribute.
 MetaAttribute getBuiltAttribute()
          The built MetaAttribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaAttributeBuilder

public MetaAttributeBuilder(String tag,
                            String attrClass,
                            String initialExpr)
Constructs a builder given the base MetaAttribute parameters:

Parameters:
tag - the MetaAttribute tag
attrClass - the MetaAttribute class
initialExpr - the initial value. This string will be interpreted as a BeanShell expression whose result must be of the class given in the attrClass parameter
Throws:
IllegalArgumentException - if the initial value expression is incorrect
Method Detail

addValidator

public void addValidator(String validator)
Add a validator object for the attribute. The string can be given in two distinct ways:

Parameters:
validator - the string that define the validator object
Throws:
IllegalArgumentException - if the passed string is incorrect
ClassCastException - if the resulting object does not implements the AttributeValidator interface

getBuiltAttribute

public MetaAttribute getBuiltAttribute()
The built MetaAttribute.



Copyright © 2011. All Rights Reserved.