org.das2
Class NameContext

java.lang.Object
  extended by org.das2.NameContext

public class NameContext
extends java.lang.Object

An instance of NameContext defines the name space for a dasml/das2 application. Methods for querying values of properties are also provided.


Field Summary
static java.util.regex.Pattern floatPattern
           
static java.util.regex.Pattern INDEXED_NAME
           
static java.util.regex.Pattern intPattern
           
static java.util.regex.Pattern QUALIFIED_NAME
           
static java.util.regex.Pattern refPattern
           
static java.util.regex.Pattern SIMPLE_NAME
           
 
Method Summary
 java.lang.Object get(java.lang.String name)
           
 java.lang.Object getIndexedPropertyValue(java.lang.Object obj, java.lang.String property, int index)
           
 java.lang.Object getPropertyValue(java.lang.Object obj, java.lang.String property)
           
 java.lang.Object parseValue(java.lang.String valueString, java.lang.Class type)
          Parses the given String object in an attempt to produce the an object of the given type.
 void put(java.lang.String name, java.lang.Object value)
          Associates a value with a name in this context.
 void remove(java.lang.String name)
           
protected  java.lang.String replaceReferences(java.lang.String str)
           
 void set(java.lang.String name, java.lang.Object value)
           
 void setIndexedPropertyValue(java.lang.Object obj, java.lang.String property, int index, java.lang.Object value)
           
 void setPropertyValue(java.lang.Object obj, java.lang.String property, java.lang.Object value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIMPLE_NAME

public static final java.util.regex.Pattern SIMPLE_NAME

INDEXED_NAME

public static final java.util.regex.Pattern INDEXED_NAME

QUALIFIED_NAME

public static final java.util.regex.Pattern QUALIFIED_NAME

refPattern

public static final java.util.regex.Pattern refPattern

intPattern

public static final java.util.regex.Pattern intPattern

floatPattern

public static final java.util.regex.Pattern floatPattern
Method Detail

put

public void put(java.lang.String name,
                java.lang.Object value)
         throws DasNameException
Associates a value with a name in this context. The name parameter must being with a letter and can only consist of alphanumeric characters and '_'.

Parameters:
name - the name for the value to be associated with
value - the value being named
Throws:
DasNameException

get

public java.lang.Object get(java.lang.String name)
                     throws DasPropertyException,
                            java.lang.reflect.InvocationTargetException
Throws:
DasPropertyException
java.lang.reflect.InvocationTargetException

set

public void set(java.lang.String name,
                java.lang.Object value)
         throws java.lang.reflect.InvocationTargetException,
                ParsedExpressionException,
                DasPropertyException,
                DasNameException
Throws:
java.lang.reflect.InvocationTargetException
ParsedExpressionException
DasPropertyException
DasNameException

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object obj,
                                         java.lang.String property)
                                  throws DasPropertyException,
                                         java.lang.reflect.InvocationTargetException
Throws:
DasPropertyException
java.lang.reflect.InvocationTargetException

getIndexedPropertyValue

public java.lang.Object getIndexedPropertyValue(java.lang.Object obj,
                                                java.lang.String property,
                                                int index)
                                         throws DasPropertyException,
                                                java.lang.reflect.InvocationTargetException
Throws:
DasPropertyException
java.lang.reflect.InvocationTargetException

setPropertyValue

public void setPropertyValue(java.lang.Object obj,
                             java.lang.String property,
                             java.lang.Object value)
                      throws java.lang.reflect.InvocationTargetException,
                             ParsedExpressionException,
                             DasPropertyException
Throws:
java.lang.reflect.InvocationTargetException
ParsedExpressionException
DasPropertyException

setIndexedPropertyValue

public void setIndexedPropertyValue(java.lang.Object obj,
                                    java.lang.String property,
                                    int index,
                                    java.lang.Object value)
                             throws java.lang.reflect.InvocationTargetException,
                                    ParsedExpressionException,
                                    DasPropertyException
Throws:
java.lang.reflect.InvocationTargetException
ParsedExpressionException
DasPropertyException

remove

public void remove(java.lang.String name)

parseValue

public java.lang.Object parseValue(java.lang.String valueString,
                                   java.lang.Class type)
                            throws ParsedExpressionException,
                                   java.lang.reflect.InvocationTargetException,
                                   DasPropertyException
Parses the given String object in an attempt to produce the an object of the given type.

Parameters:
valueString - the given String
type - the given type
Throws:
ParsedExpressionException
java.lang.reflect.InvocationTargetException
DasPropertyException

replaceReferences

protected java.lang.String replaceReferences(java.lang.String str)
                                      throws DasPropertyException,
                                             java.lang.reflect.InvocationTargetException
Throws:
DasPropertyException
java.lang.reflect.InvocationTargetException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object