Class MavenPropertiesImporter
java.lang.Object
com.igormaznitsa.jcp.maven.MavenPropertiesImporter
- All Implemented Interfaces:
SpecialVariableProcessor
The class imports some properties from the maven which can be accessible from preprocessed sources as global variables
- Author:
- Igor Maznitsa (igor.maznitsa@igormaznitsa.com)
-
Constructor Summary
ConstructorsConstructorDescriptionMavenPropertiesImporter(PreprocessorContext context, org.apache.maven.project.MavenProject project, boolean logAddedProperties) -
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
-
Constructor Details
-
MavenPropertiesImporter
public MavenPropertiesImporter(PreprocessorContext context, org.apache.maven.project.MavenProject project, boolean logAddedProperties)
-
-
Method Details
-
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
-