Package com.igormaznitsa.jcp.context
Class PreprocessingState
java.lang.Object
com.igormaznitsa.jcp.context.PreprocessingState
The class describes a preprocessor state also it contains inside buffers and save data on disk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TextFileDataContainerprivate TextFileDataContainerprivate final PreprocessorContextprivate ResetablePrinterprivate final LinkedList<PreprocessingState.ExcludeIfInfo> static final FilePositionInfo[]private final booleanprivate final Stringprivate final Stringprivate final LinkedList<TextFileDataContainer> private final LinkedList<TextFileDataContainer> private Stringstatic final intprivate final ResetablePrinterprivate final booleanprivate final ResetablePrinterprivate final ResetablePrinterprivate final EnumSet<PreprocessingFlag> private final FileInfoContainerprivate final TextFileDataContainerprivate final LinkedList<TextFileDataContainer> -
Constructor Summary
ConstructorsConstructorDescriptionPreprocessingState(PreprocessorContext context, FileInfoContainer rootFile, TextFileDataContainer rootContainer, String inEncoding, String outEncoding, boolean overrideOnlyIfContentChanged) PreprocessingState(PreprocessorContext context, FileInfoContainer rootFile, String inEncoding, String outEncoding, boolean overrideOnlyIfContentChanged) PreprocessingState(PreprocessorContext context, String inEncoding, String outEncoding) -
Method Summary
Modifier and TypeMethodDescriptionprivate TextFileDataContainercloneTopTextDataContainer(boolean useLastReadStringIndex) voiddispose()(package private) List<TextFileDataContainer> goToString(int stringIndex) booleanprivate voidinit()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanmakeException(String message, String causeString, Throwable cause) nextLine()peekFile()peekIf()voidpopIf()popWhile()voidpushExcludeIfData(FileInfoContainer infoContainer, String excludeIfCondition, int stringIndex) pushIf(boolean makeActive) pushWhile(boolean makeActive) voidbooleansaveBuffersToFile(File outFile, boolean removeComments) voidsaveBuffersToStreams(OutputStream prefix, OutputStream normal, OutputStream postfix) voidwritePrinterBuffers(Writer writer)
-
Field Details
-
EMPTY_STACK
-
MAX_WRITE_BUFFER_SIZE
public static final int MAX_WRITE_BUFFER_SIZE- See Also:
-
globalInCharacterEncoding
-
globalOutCharacterEncoding
-
rootReference
-
rootFileInfo
-
whileStack
-
ifStack
-
includeStack
-
deferredExcludeStack
-
prefixPrinter
-
postfixPrinter
-
normalPrinter
-
overrideOnlyIfContentChanged
private final boolean overrideOnlyIfContentChanged -
currentPrinter
-
preprocessingFlags
-
activeIf
-
activeWhile
-
lastReadString
-
context
-
fake
private final boolean fake
-
-
Constructor Details
-
PreprocessingState
PreprocessingState(PreprocessorContext context, String inEncoding, String outEncoding) -
PreprocessingState
PreprocessingState(PreprocessorContext context, FileInfoContainer rootFile, String inEncoding, String outEncoding, boolean overrideOnlyIfContentChanged) throws IOException - Throws:
IOException
-
PreprocessingState
PreprocessingState(PreprocessorContext context, FileInfoContainer rootFile, TextFileDataContainer rootContainer, String inEncoding, String outEncoding, boolean overrideOnlyIfContentChanged)
-
-
Method Details
-
getLastReadString
-
pushExcludeIfData
public void pushExcludeIfData(FileInfoContainer infoContainer, String excludeIfCondition, int stringIndex) -
popAllExcludeIfInfoData
-
popExcludeIfData
-
getPreprocessingFlags
-
getPrinter
- Throws:
IOException
-
getRootTextContainer
-
openFile
- Throws:
IOException
-
peekFile
-
getCurrentIncludeStack
-
makeIncludeStack
-
popTextContainer
-
getRootFileInfo
-
isIncludeStackEmpty
public boolean isIncludeStackEmpty() -
isOnlyRootOnStack
public boolean isOnlyRootOnStack() -
cloneTopTextDataContainer
-
popWhile
-
pushWhile
-
peekWhile
-
hasReadLineNextLineInEnd
public boolean hasReadLineNextLineInEnd() -
nextLine
-
goToString
-
pushIf
-
popAllIFUntilContainerWithFile
-
popIf
-
isAtActiveWhile
public boolean isAtActiveWhile() -
isAtActiveIf
public boolean isAtActiveIf() -
isDirectiveCanBeProcessedIgnoreBreak
public boolean isDirectiveCanBeProcessedIgnoreBreak() -
isDirectiveCanBeProcessed
public boolean isDirectiveCanBeProcessed() -
peekIf
-
isIfStackEmpty
public boolean isIfStackEmpty() -
isWhileStackEmpty
public boolean isWhileStackEmpty() -
init
private void init() -
setPrinter
-
resetPrinters
public void resetPrinters() -
saveBuffersToStreams
public void saveBuffersToStreams(OutputStream prefix, OutputStream normal, OutputStream postfix) throws IOException - Throws:
IOException
-
saveBuffersToFile
- Throws:
IOException
-
writePrinterBuffers
- Throws:
IOException
-
makeException
-
dispose
public void dispose()
-