Package com.igormaznitsa.jcp.context
Class JCPSpecialVariableProcessor
java.lang.Object
com.igormaznitsa.jcp.context.JCPSpecialVariableProcessor
- All Implemented Interfaces:
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 ClassesModifier and TypeClassDescriptionstatic final class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final SimpleDateFormat(package private) final SimpleDateFormat(package private) final SimpleDateFormatstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetVariable(String varName, PreprocessorContext context) Get the value for the variableString[]Get all variable names allowed by the processor as an array, all names must be in lower casevoidsetVariable(String varName, Value value, PreprocessorContext context) Set a value to the variable
-
Field Details
-
VAR_DEST_DIR
- See Also:
-
VAR_VERSION
- See Also:
-
VAR_DEST_FILE_NAME
- See Also:
-
VAR_DEST_FULLPATH
- See Also:
-
VAR_SRC_FILE_NAME
- See Also:
-
VAR_SRC_FILE_NAME2
- See Also:
-
VAR_SRC_DIR
- See Also:
-
VAR_SRC_DIR2
- See Also:
-
VAR_SRC_FULLPATH
- See Also:
-
VAR_SRC_FULLPATH2
- See Also:
-
VAR_LINE
- See Also:
-
VAR_DATE
- See Also:
-
VAR_TIME
- See Also:
-
VAR_TIMESTAMP
- See Also:
-
dateFormat
-
timeFormat
-
timestampFormat
-
-
Constructor Details
-
JCPSpecialVariableProcessor
public JCPSpecialVariableProcessor()
-
-
Method Details
-
getReference
@MustNotContainNull public static List<JCPSpecialVariableProcessor.NameReferencePair> getReference() -
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
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
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
-