com.eventgnosis.filters
Class Expression

java.lang.Object
  extended bycom.eventgnosis.filters.Expression
All Implemented Interfaces:
EmmlParmBuilder

public class Expression
extends java.lang.Object
implements EmmlParmBuilder

Implements dynamic formating/input of strings, numbers, variables or time(currently only String is implemented).
Allows for the construction of arbitrary strings interspersed with parameter/variable values.


Field Summary
static java.lang.String DEF_FORMAT_STR
           
static int DEF_TYPE
           
static java.lang.String DEF_TYPE_STR
           
static Expression defExpression
           
static int FIRST_TYPE
           
static int LAST_TYPE
           
static int TYPE_NUMBER
           
static java.lang.String TYPE_NUMBER_STR
           
static int TYPE_STRING
           
static java.lang.String TYPE_STRING_STR
           
static int TYPE_TIME
           
static java.lang.String TYPE_TIME_STR
           
static int TYPE_VARIABLE
           
static java.lang.String TYPE_VARIABLE_STR
           
 
Constructor Summary
Expression()
           
Expression(int type, java.lang.String formatString, java.util.ArrayList formatList)
           
 
Method Summary
 java.lang.String build(Log log, com.eventgnosis.config.ConfigurationManager configMgr, org.w3c.dom.Element elem)
          After object is instantiated this method is called to parse the EMML DOM element, setting its internal state to the parsed values.
 java.util.ArrayList buildFormatList(Log log, java.util.ArrayList pList, java.lang.String fmtStr)
           
 java.lang.String getConfigXml()
           
static Expression getDefault()
           
 java.util.ArrayList getFormatList()
           
 java.lang.String getFormatString()
           
 java.util.ArrayList getParmList()
           
 java.lang.String getRuntimeXml()
           
 java.lang.String getStringValue(Event ev)
          Constructs the specified string interspersed with parameter/variable values.
 int getType()
           
 java.lang.String getTypeAsString()
           
 boolean isValidType(java.lang.String strType)
           
 void setFormatList(java.util.ArrayList al)
           
 void setFormatString(java.lang.String fStr)
           
 void setParmList(java.util.ArrayList pList)
           
 void setType(int typ)
           
 void setType(java.lang.String strType)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEF_FORMAT_STR

public static final java.lang.String DEF_FORMAT_STR
See Also:
Constant Field Values

DEF_TYPE

public static final int DEF_TYPE
See Also:
Constant Field Values

DEF_TYPE_STR

public static final java.lang.String DEF_TYPE_STR
See Also:
Constant Field Values

defExpression

public static final Expression defExpression

FIRST_TYPE

public static final int FIRST_TYPE
See Also:
Constant Field Values

LAST_TYPE

public static final int LAST_TYPE
See Also:
Constant Field Values

TYPE_NUMBER

public static final int TYPE_NUMBER
See Also:
Constant Field Values

TYPE_NUMBER_STR

public static final java.lang.String TYPE_NUMBER_STR
See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_STRING_STR

public static final java.lang.String TYPE_STRING_STR
See Also:
Constant Field Values

TYPE_TIME

public static final int TYPE_TIME
See Also:
Constant Field Values

TYPE_TIME_STR

public static final java.lang.String TYPE_TIME_STR
See Also:
Constant Field Values

TYPE_VARIABLE

public static final int TYPE_VARIABLE
See Also:
Constant Field Values

TYPE_VARIABLE_STR

public static final java.lang.String TYPE_VARIABLE_STR
See Also:
Constant Field Values
Constructor Detail

Expression

public Expression()

Expression

public Expression(int type,
                  java.lang.String formatString,
                  java.util.ArrayList formatList)
Method Detail

build

public java.lang.String build(Log log,
                              com.eventgnosis.config.ConfigurationManager configMgr,
                              org.w3c.dom.Element elem)
Description copied from interface: EmmlParmBuilder
After object is instantiated this method is called to parse the EMML DOM element, setting its internal state to the parsed values.

Specified by:
build in interface EmmlParmBuilder
Parameters:
log - logger instance for tracking error, warning and info messages.
configMgr - holds configuration data structure used to properly configure runtime setup based on input ECA(s).
elem - emml(dom) node to be parsed
Returns:
precise error statement if there are any errors; null is returned if there are no errors and object is build sucessfully.

buildFormatList

public java.util.ArrayList buildFormatList(Log log,
                                           java.util.ArrayList pList,
                                           java.lang.String fmtStr)

getConfigXml

public java.lang.String getConfigXml()

getDefault

public static Expression getDefault()
Returns:
default Expression

getFormatList

public java.util.ArrayList getFormatList()

getFormatString

public java.lang.String getFormatString()

getParmList

public java.util.ArrayList getParmList()

getRuntimeXml

public java.lang.String getRuntimeXml()

getStringValue

public java.lang.String getStringValue(Event ev)
Constructs the specified string interspersed with parameter/variable values.

Parameters:
ev - event from witch values may be taken.
Returns:
formated string

getType

public int getType()
Returns:
Expression type as an integer

getTypeAsString

public java.lang.String getTypeAsString()
Returns:
Expression type as a String

isValidType

public boolean isValidType(java.lang.String strType)

setFormatList

public void setFormatList(java.util.ArrayList al)

setFormatString

public void setFormatString(java.lang.String fStr)

setParmList

public void setParmList(java.util.ArrayList pList)

setType

public void setType(int typ)

setType

public void setType(java.lang.String strType)

toString

public java.lang.String toString()