com.pietschy.command.configuration.impl
Class ValueListAttributeParser

java.lang.Object
  extended by com.pietschy.command.configuration.impl.AttributeParser
      extended by com.pietschy.command.configuration.impl.ValueListAttributeParser

 class ValueListAttributeParser
extends AttributeParser

Attribute parser the accepts a list of allowed values.


Constructor Summary
protected ValueListAttributeParser(java.lang.String property, java.lang.String... values)
          Creates a new instance for the specified property and value list.
 
Method Summary
 void parse(java.lang.String value, Configuration config, ExceptionFactory factory)
          Parses the property ensuring it is in the list of allowed values.
 
Methods inherited from class com.pietschy.command.configuration.impl.AttributeParser
getKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueListAttributeParser

protected ValueListAttributeParser(java.lang.String property,
                                   java.lang.String... values)
Creates a new instance for the specified property and value list.

Parameters:
property - the property name to parse.
values - the value list.
Method Detail

parse

public void parse(java.lang.String value,
                  Configuration config,
                  ExceptionFactory factory)
           throws ParseException
Parses the property ensuring it is in the list of allowed values.

Specified by:
parse in class AttributeParser
Parameters:
value - the value
config - the configuration store.
factory - the exception factory.
Throws:
ParseException - if the value was not one of the allowed values.


Copyright © 2006 - 2007 Andrew Pietsch