ch.javasoft.xml.config
Enum XmlConfig.ResolveKey

java.lang.Object
  extended by java.lang.Enum<XmlConfig.ResolveKey>
      extended by ch.javasoft.xml.config.XmlConfig.ResolveKey
All Implemented Interfaces:
Serializable, Comparable<XmlConfig.ResolveKey>
Enclosing class:
XmlConfig

public static enum XmlConfig.ResolveKey
extends Enum<XmlConfig.ResolveKey>

Key elements be used in {...} brackets, will be resolved by the corresponding content. Can be used to address the working directory, application name, system properties, command line arguments/options respectively.

In xml, the names of the keys equal the enum constant names, but replacing _ with -.


Enum Constant Summary
app_name
           
arg
           
date
           
list
           
now
           
opt
           
sys_prop
           
time
           
work_dir
           
 
Method Summary
 boolean matches(String value)
           
 String resolve(Attribute att, String path, String value, XmlConfig config)
           
static XmlConfig.ResolveKey valueOf(String name)
          Returns the enum constant of this type with the specified name.
static XmlConfig.ResolveKey[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 String xmlName()
          The key name in xml, same as enum constant name, but _ replaced by -
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

work_dir

public static final XmlConfig.ResolveKey work_dir

app_name

public static final XmlConfig.ResolveKey app_name

sys_prop

public static final XmlConfig.ResolveKey sys_prop

date

public static final XmlConfig.ResolveKey date

time

public static final XmlConfig.ResolveKey time

now

public static final XmlConfig.ResolveKey now

arg

public static final XmlConfig.ResolveKey arg

opt

public static final XmlConfig.ResolveKey opt

list

public static final XmlConfig.ResolveKey list
Method Detail

values

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

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

valueOf

public static XmlConfig.ResolveKey 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
NullPointerException - if the argument is null

xmlName

public String xmlName()
The key name in xml, same as enum constant name, but _ replaced by -


resolve

public String resolve(Attribute att,
                      String path,
                      String value,
                      XmlConfig config)
               throws XmlConfigException
Throws:
XmlConfigException

matches

public boolean matches(String value)