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 String
The destination name for the fileprivate String
The destination directory for the fileprivate static final Pattern
private static final Pattern
private static final Pattern
private static final Pattern
private boolean
The flag shows that the file has been excluded from preprocessing and it will not be preprocessed and copiedprivate final boolean
The flag shows that the file should be just copied into the destination place without any preprocessingprivate final File
The source file for the container -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
checkDirectiveArgumentRoughly
(AbstractDirectiveHandler directive, String rest) private String
extractDoubleDollarPrefixedDirective
(String line, PreprocessorContext context) private String
extractHashPrefixedDirective
(String line, PreprocessorContext context) private String
extractSingleDollarPrefixedDirective
(String line, PreprocessorContext context) private static String
findTailRemover
(String str, PreprocessorContext context) private boolean
isDoubleDollarPrefixed
(String line, PreprocessorContext context) boolean
boolean
private boolean
isHashPrefixed
(String line, PreprocessorContext context) private boolean
isSingleDollarPrefixed
(String line, PreprocessorContext context) preprocessFile
(PreprocessingState state, PreprocessorContext context) Preprocess file, NB! it doesn't clear local variables automatically for cloned contextsprotected AfterDirectiveProcessingBehaviour
processDirective
(PreprocessingState state, String directiveString, PreprocessorContext context, boolean firstPass) processGlobalDirectives
(PreprocessingState state, PreprocessorContext context) void
setDestinationDir
(String destDir) void
setDestinationName
(String destName) void
setExcluded
(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)
-