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 classJCPSpecialVariableProcessor.NameReferencePair
-
Field Summary
Fields Modifier and Type Field Description (package private) java.text.SimpleDateFormatdateFormat(package private) java.text.SimpleDateFormattimeFormat(package private) java.text.SimpleDateFormattimestampFormatstatic java.lang.StringVAR_DATEstatic java.lang.StringVAR_DEST_DIRstatic java.lang.StringVAR_DEST_FILE_NAMEstatic java.lang.StringVAR_DEST_FULLPATHstatic java.lang.StringVAR_LINEstatic java.lang.StringVAR_SRC_DIRstatic java.lang.StringVAR_SRC_DIR2static java.lang.StringVAR_SRC_FILE_NAMEstatic java.lang.StringVAR_SRC_FILE_NAME2static java.lang.StringVAR_SRC_FULLPATHstatic java.lang.StringVAR_SRC_FULLPATH2static java.lang.StringVAR_TIMEstatic java.lang.StringVAR_TIMESTAMPstatic java.lang.StringVAR_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()ValuegetVariable(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 casevoidsetVariable(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
final java.text.SimpleDateFormat dateFormat
-
timeFormat
final java.text.SimpleDateFormat timeFormat
-
timestampFormat
final java.text.SimpleDateFormat timestampFormat
-
-
Method Detail
-
getReference
@MustNotContainNull public static java.util.List<JCPSpecialVariableProcessor.NameReferencePair> getReference()
-
getVariableNames
@MustNotContainNull public java.lang.String[] getVariableNames()
Description copied from interface:SpecialVariableProcessorGet all variable names allowed by the processor as an array, all names must be in lower case- Specified by:
getVariableNamesin interfaceSpecialVariableProcessor- Returns:
- allowed variable names as a String array
-
getVariable
public Value getVariable(java.lang.String varName, PreprocessorContext context)
Description copied from interface:SpecialVariableProcessorGet the value for the variable- Specified by:
getVariablein 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:SpecialVariableProcessorSet a value to the variable- Specified by:
setVariablein 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
-
-