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 class
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TextFileDataContainer
private TextFileDataContainer
private final PreprocessorContext
private ResetablePrinter
private final LinkedList
<PreprocessingState.ExcludeIfInfo> static final FilePositionInfo[]
private final boolean
private final String
private final String
private final LinkedList
<TextFileDataContainer> private final LinkedList
<TextFileDataContainer> private String
static final int
private final ResetablePrinter
private final boolean
private final ResetablePrinter
private final ResetablePrinter
private final EnumSet
<PreprocessingFlag> private final FileInfoContainer
private final TextFileDataContainer
private 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 TextFileDataContainer
cloneTopTextDataContainer
(boolean useLastReadStringIndex) void
dispose()
(package private) List
<TextFileDataContainer> goToString
(int stringIndex) boolean
private void
init()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
makeException
(String message, String causeString, Throwable cause) nextLine()
peekFile()
peekIf()
void
popIf()
popWhile()
void
pushExcludeIfData
(FileInfoContainer infoContainer, String excludeIfCondition, int stringIndex) pushIf
(boolean makeActive) pushWhile
(boolean makeActive) void
boolean
saveBuffersToFile
(File outFile, boolean removeComments) void
saveBuffersToStreams
(OutputStream prefix, OutputStream normal, OutputStream postfix) void
writePrinterBuffers
(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()
-