Package org.jboss.jdeparser
Class SourceFileWriter
java.lang.Object
org.jboss.jdeparser.SourceFileWriter
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ImplJSourceFile
private final CountingWriter
private final FormatPreferences
private final StringBuilder
private final String
private final Indent
private int
private static final int
private static final int
private static final int
private static final int
private static final int
private final ListIterator
<Indent> private Token
private final ArrayDeque
<AbstractJType> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
(package private) void
void
close()
void
flush()
(package private) ImplJSourceFile
(package private) int
(package private) FormatPreferences
(package private) int
getLine()
(package private) Token
getState()
(package private) AbstractJType
(package private) void
nl()
(package private) void
ntsp()
A non-trailing space.(package private) void
popIndent
(FormatPreferences.Indentation indentation) (package private) void
(package private) void
popThisType
(AbstractJType thisType) (package private) void
(package private) void
pushIndent
(FormatPreferences.Indentation indentation) (package private) void
pushIndent
(Indent indent) (package private) void
pushThisType
(AbstractJType thisType) (package private) void
setClassFile
(ImplJSourceFile classFile) (package private) void
sp()
Force a space if one hasn't already been added.(package private) void
write
(AbstractJExpr expr) (package private) void
write
(AbstractJType type) (package private) void
write
(FormatPreferences.Space rule) (package private) void
(package private) void
(package private) void
(package private) void
writeClass
(String nameToWrite) (package private) void
writeEscaped
(char item) (package private) void
writeEscaped
(String item) (package private) void
writeEscapedWord
(String rawText) (package private) void
writeUnescaped
(char item) (package private) void
writeUnescaped
(String item)
-
Field Details
-
format
-
countingWriter
-
lineBuffer
-
lineSep
-
thisTypeStack
-
indentStack
-
stackIterator
-
nextIndent
-
state
-
spaceState
private int spaceState -
classFile
-
SS_NONE
private static final int SS_NONE- See Also:
-
SS_NEEDED
private static final int SS_NEEDED- See Also:
-
SS_ADDED
private static final int SS_ADDED- See Also:
-
SS_NEW_LINE
private static final int SS_NEW_LINE- See Also:
-
SS_2_NEW_LINE
private static final int SS_2_NEW_LINE- See Also:
-
-
Constructor Details
-
SourceFileWriter
SourceFileWriter(FormatPreferences format, Writer writer)
-
-
Method Details
-
nl
- Throws:
IOException
-
sp
Force a space if one hasn't already been added.- Throws:
IOException
- etc.
-
ntsp
A non-trailing space.- Throws:
IOException
-
getLine
int getLine() -
getColumn
int getColumn() -
processSpacing
- Throws:
IOException
-
addIndent
- Throws:
IOException
-
writeEscaped
- Throws:
IOException
-
writeEscaped
- Throws:
IOException
-
writeUnescaped
- Throws:
IOException
-
writeUnescaped
- Throws:
IOException
-
write
- Throws:
IOException
-
writeClass
- Throws:
IOException
-
addWordSpace
- Throws:
IOException
-
write
- Throws:
IOException
-
writeEscapedWord
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
pushIndent
-
pushIndent
-
popIndent
-
popIndent
-
getThisType
AbstractJType getThisType() -
pushThisType
-
popThisType
-
setClassFile
-
getState
Token getState() -
getClassFile
ImplJSourceFile getClassFile() -
getFormat
FormatPreferences getFormat()
-