Package com.igormaznitsa.jcp.containers
Class FileInfoContainer
java.lang.Object
com.igormaznitsa.jcp.containers.FileInfoContainer
The class is one from the main classes in the preprocessor because it describes a preprocessing file and contains business logic for the process
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe destination name for the fileprivate StringThe destination directory for the fileprivate static final Patternprivate static final Patternprivate static final Patternprivate static final Patternprivate booleanThe flag shows that the file has been excluded from preprocessing and it will not be preprocessed and copiedprivate final booleanThe flag shows that the file should be just copied into the destination place without any preprocessingprivate final FileThe source file for the container -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleancheckDirectiveArgumentRoughly(AbstractDirectiveHandler directive, String rest) private StringextractDoubleDollarPrefixedDirective(String line, PreprocessorContext context) private StringextractHashPrefixedDirective(String line, PreprocessorContext context) private StringextractSingleDollarPrefixedDirective(String line, PreprocessorContext context) private static StringfindTailRemover(String str, PreprocessorContext context) private booleanisDoubleDollarPrefixed(String line, PreprocessorContext context) booleanbooleanprivate booleanisHashPrefixed(String line, PreprocessorContext context) private booleanisSingleDollarPrefixed(String line, PreprocessorContext context) preprocessFile(PreprocessingState state, PreprocessorContext context) Preprocess file, NB! it doesn't clear local variables automatically for cloned contextsprotected AfterDirectiveProcessingBehaviourprocessDirective(PreprocessingState state, String directiveString, PreprocessorContext context, boolean firstPass) processGlobalDirectives(PreprocessingState state, PreprocessorContext context) voidsetDestinationDir(String destDir) voidsetDestinationName(String destName) voidsetExcluded(boolean flag) toString()
-
Field Details
-
DIRECTIVE_HASH_PREFIXED
-
DIRECTIVE_TWO_DOLLARS_PREFIXED
-
DIRECTIVE_SINGLE_DOLLAR_PREFIXED
-
DIRECTIVE_TAIL_REMOVER
-
sourceFile
The source file for the container -
forCopyOnly
private final boolean forCopyOnlyThe flag shows that the file should be just copied into the destination place without any preprocessing -
excludedFromPreprocessing
private boolean excludedFromPreprocessingThe flag shows that the file has been excluded from preprocessing and it will not be preprocessed and copied -
destFolder
The destination directory for the file -
destFileName
The destination name for the file
-
-
Constructor Details
-
FileInfoContainer
-
-
Method Details
-
getSourceFile
-
isExcludedFromPreprocessing
public boolean isExcludedFromPreprocessing() -
isForCopyOnly
public boolean isForCopyOnly() -
getDestinationDir
-
getDestinationName
-
getDestinationFilePath
-
toString
-
processGlobalDirectives
@MustNotContainNull public List<PreprocessingState.ExcludeIfInfo> processGlobalDirectives(PreprocessingState state, PreprocessorContext context) throws IOException - Throws:
IOException
-
isDoubleDollarPrefixed
-
isSingleDollarPrefixed
-
isHashPrefixed
-
extractHashPrefixedDirective
-
extractDoubleDollarPrefixedDirective
-
extractSingleDollarPrefixedDirective
-
preprocessFile
public PreprocessingState preprocessFile(PreprocessingState state, PreprocessorContext context) throws IOException Preprocess file, NB! it doesn't clear local variables automatically for cloned contexts- Parameters:
state- the start preprocessing state, can be nullcontext- the preprocessor context, must not be null- Returns:
- the state for the preprocessed file
- Throws:
IOException- it will be thrown for IO errorsPreprocessorException- it will be thrown for violation of preprocessing logic, like undefined variable
-
findTailRemover
-
checkDirectiveArgumentRoughly
-
processDirective
protected AfterDirectiveProcessingBehaviour processDirective(PreprocessingState state, String directiveString, PreprocessorContext context, boolean firstPass) throws IOException - Throws:
IOException
-
setDestinationDir
-
setDestinationName
-
setExcluded
public void setExcluded(boolean flag)
-