edu.mit.jverbnet.data.syntax
Enum SyntaxArgType.VALUE_RULE

java.lang.Object
  extended by java.lang.Enum<SyntaxArgType.VALUE_RULE>
      extended by edu.mit.jverbnet.data.syntax.SyntaxArgType.VALUE_RULE
All Implemented Interfaces:
Serializable, Comparable<SyntaxArgType.VALUE_RULE>
Enclosing class:
SyntaxArgType

public static enum SyntaxArgType.VALUE_RULE
extends Enum<SyntaxArgType.VALUE_RULE>

Checks that the value meets the expectations of the type.

Since:
JVerbnet 1.0.0
Version:
1.0.0
Author:
Mark A. Finlayson

Enum Constant Summary
OPTIONAL
          The value may be anything.
PROHIBITED
          The value must be null.
REQUIRED
          The value must not be null, empty, or blank.
 
Method Summary
abstract  String checkValue(String value)
          Checks that the string value meets the condition.
static SyntaxArgType.VALUE_RULE valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SyntaxArgType.VALUE_RULE[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PROHIBITED

public static final SyntaxArgType.VALUE_RULE PROHIBITED
The value must be null.

Since:
JVerbnet 1.0.0

OPTIONAL

public static final SyntaxArgType.VALUE_RULE OPTIONAL
The value may be anything.

Since:
JVerbnet 1.0.0

REQUIRED

public static final SyntaxArgType.VALUE_RULE REQUIRED
The value must not be null, empty, or blank.

Since:
JVerbnet 1.0.0
Method Detail

values

public static final SyntaxArgType.VALUE_RULE[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SyntaxArgType.VALUE_RULE c : SyntaxArgType.VALUE_RULE.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SyntaxArgType.VALUE_RULE valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

checkValue

public abstract String checkValue(String value)
Checks that the string value meets the condition.

Parameters:
value - the value to be checked
Returns:
the original value, if null, or the trimmed value
Throws:
Exception - if the value does not meet the condition
Since:
JVerbnet 1.0.0


Copyright © 2012 Massachusetts Institute of Technology. All Rights Reserved.