Package com.igormaznitsa.jcp.context
Class JCPSpecialVariableProcessor
- java.lang.Object
-
- com.igormaznitsa.jcp.context.JCPSpecialVariableProcessor
-
- All Implemented Interfaces:
SpecialVariableProcessor
public class JCPSpecialVariableProcessor extends java.lang.Object implements SpecialVariableProcessor
The class implements the special variable processor interface and allows to get access to inside JCP variables Inside JCP variables have the "jcp." prefix
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JCPSpecialVariableProcessor.NameReferencePair
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.text.SimpleDateFormat
dateFormat
(package private) static java.text.SimpleDateFormat
timeFormat
(package private) static java.text.SimpleDateFormat
timestampFormat
static java.lang.String
VAR_DATE
static java.lang.String
VAR_DEST_DIR
static java.lang.String
VAR_DEST_FILE_NAME
static java.lang.String
VAR_DEST_FULLPATH
static java.lang.String
VAR_LINE
static java.lang.String
VAR_SRC_DIR
static java.lang.String
VAR_SRC_DIR2
static java.lang.String
VAR_SRC_FILE_NAME
static java.lang.String
VAR_SRC_FILE_NAME2
static java.lang.String
VAR_SRC_FULLPATH
static java.lang.String
VAR_SRC_FULLPATH2
static java.lang.String
VAR_TIME
static java.lang.String
VAR_TIMESTAMP
static java.lang.String
VAR_VERSION
-
Constructor Summary
Constructors Constructor Description JCPSpecialVariableProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<JCPSpecialVariableProcessor.NameReferencePair>
getReference()
Value
getVariable(java.lang.String varName, PreprocessorContext context)
Get the value for the variablejava.lang.String[]
getVariableNames()
Get all variable names allowed by the processor as an array, all names must be in lower casevoid
setVariable(java.lang.String varName, Value value, PreprocessorContext context)
Set a value to the variable
-
-
-
Field Detail
-
VAR_DEST_DIR
public static final java.lang.String VAR_DEST_DIR
- See Also:
- Constant Field Values
-
VAR_VERSION
public static final java.lang.String VAR_VERSION
- See Also:
- Constant Field Values
-
VAR_DEST_FILE_NAME
public static final java.lang.String VAR_DEST_FILE_NAME
- See Also:
- Constant Field Values
-
VAR_DEST_FULLPATH
public static final java.lang.String VAR_DEST_FULLPATH
- See Also:
- Constant Field Values
-
VAR_SRC_FILE_NAME
public static final java.lang.String VAR_SRC_FILE_NAME
- See Also:
- Constant Field Values
-
VAR_SRC_FILE_NAME2
public static final java.lang.String VAR_SRC_FILE_NAME2
- See Also:
- Constant Field Values
-
VAR_SRC_DIR
public static final java.lang.String VAR_SRC_DIR
- See Also:
- Constant Field Values
-
VAR_SRC_DIR2
public static final java.lang.String VAR_SRC_DIR2
- See Also:
- Constant Field Values
-
VAR_SRC_FULLPATH
public static final java.lang.String VAR_SRC_FULLPATH
- See Also:
- Constant Field Values
-
VAR_SRC_FULLPATH2
public static final java.lang.String VAR_SRC_FULLPATH2
- See Also:
- Constant Field Values
-
VAR_LINE
public static final java.lang.String VAR_LINE
- See Also:
- Constant Field Values
-
VAR_DATE
public static final java.lang.String VAR_DATE
- See Also:
- Constant Field Values
-
VAR_TIME
public static final java.lang.String VAR_TIME
- See Also:
- Constant Field Values
-
VAR_TIMESTAMP
public static final java.lang.String VAR_TIMESTAMP
- See Also:
- Constant Field Values
-
dateFormat
static final java.text.SimpleDateFormat dateFormat
-
timeFormat
static final java.text.SimpleDateFormat timeFormat
-
timestampFormat
static final java.text.SimpleDateFormat timestampFormat
-
-
Method Detail
-
getReference
public static java.util.List<JCPSpecialVariableProcessor.NameReferencePair> getReference()
-
getVariableNames
public java.lang.String[] getVariableNames()
Description copied from interface:SpecialVariableProcessor
Get all variable names allowed by the processor as an array, all names must be in lower case- Specified by:
getVariableNames
in interfaceSpecialVariableProcessor
- Returns:
- allowed variable names as a String array
-
getVariable
public Value getVariable(java.lang.String varName, PreprocessorContext context)
Description copied from interface:SpecialVariableProcessor
Get the value for the variable- Specified by:
getVariable
in interfaceSpecialVariableProcessor
- Parameters:
varName
- the variable name, must not be nullcontext
- the preprocessor context, it can be null- Returns:
- the value, it must not return null because it will notified preprocessor that it supports the variable
-
setVariable
public void setVariable(java.lang.String varName, Value value, PreprocessorContext context)
Description copied from interface:SpecialVariableProcessor
Set a value to the variable- Specified by:
setVariable
in interfaceSpecialVariableProcessor
- Parameters:
varName
- the variable name, must not be nullvalue
- the value to be set to the variable, must not be nullcontext
- the preprocessor context, it can be null
-
-