Package relaxngcc.codedom
Class CDFormatter
java.lang.Object
relaxngcc.codedom.CDFormatter
- Direct Known Subclasses:
CDJavaFormatter
Formats a code DOM and produces a source code.
This object controls the formatting (such as indentation)
and handles language-specific construct.
- Author:
- Kohsuke Kawaguchi (kk@kohsuke.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal CDFormatter
Outputs VariableDeclaration as a declaration.eos()
Marks the end of a statement.express
(CDExpression exp) Prints expression.in()
Indent.nl()
Clears the current line and this method also prints indentation.out()
Unindent.p
(char ch) Outputs a new token.Outputs a new token.state
(CDStatement s) Prints a statement.final CDFormatter
Outputs a type object.abstract CDFormatter
Outputs a language specific string.
-
Constructor Details
-
CDFormatter
-
-
Method Details
-
in
Indent. -
out
Unindent. -
nl
Clears the current line and this method also prints indentation.- Returns:
- "this."
- Throws:
IOException
-
p
Outputs a new token. Sooner or later all the methods come down to this method for output.- Returns:
- "this"
- Throws:
IOException
-
p
Outputs a new token.- Returns:
- "this."
- Throws:
IOException
-
express
Prints expression.- Throws:
IOException
-
state
Prints a statement.- Throws:
IOException
-
type
Outputs a type object.- Throws:
IOException
-
declare
Outputs VariableDeclaration as a declaration.- Throws:
IOException
-
write
Outputs a language specific string.- Throws:
IOException
-
eos
Marks the end of a statement.- Throws:
IOException
-