org.jaitools.jiffle.parser
Class OptionLookup

java.lang.Object
  extended by org.jaitools.jiffle.parser.OptionLookup

public class OptionLookup
extends java.lang.Object

A lookup service used by the Jiffle compiler when parsing script options.

Since:
0.1
Version:
$Id: OptionLookup.java 1653 2011-06-16 10:23:02Z michael.bedward $
Author:
Michael Bedward

Constructor Summary
OptionLookup()
           
 
Method Summary
static java.lang.String getActiveRuntimExpr(java.lang.String name, java.lang.String value)
          Gets the runtime source for the given option name:value pair.
static java.lang.Iterable<java.lang.String> getNames()
          Gets the names known to the lookup service.
static boolean isDefined(java.lang.String optionName)
          Tests if an option name is defined.
static boolean isValidValue(java.lang.String optionName, java.lang.String value)
          Tests if a value is valid for the given option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionLookup

public OptionLookup()
Method Detail

isDefined

public static boolean isDefined(java.lang.String optionName)
Tests if an option name is defined.

Parameters:
optionName - the name
Returns:
true if the name is defined; false otherwise

isValidValue

public static boolean isValidValue(java.lang.String optionName,
                                   java.lang.String value)
                            throws UndefinedOptionException
Tests if a value is valid for the given option.

Parameters:
optionName - option name
value - the value as a String
Returns:
true if the value is valid; false otherwise
Throws:
UndefinedOptionException - if the name is not recognized

getNames

public static java.lang.Iterable<java.lang.String> getNames()
Gets the names known to the lookup service.

Returns:
option names as an unmodifiable list

getActiveRuntimExpr

public static java.lang.String getActiveRuntimExpr(java.lang.String name,
                                                   java.lang.String value)
                                            throws UndefinedOptionException
Gets the runtime source for the given option name:value pair.

Parameters:
name - option name
value - option value
Returns:
the runtime source
Throws:
UndefinedOptionException - if the name is not recognized


Copyright © 2011. All Rights Reserved.