public class PrettyPrinter
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
DOCTYPE_CHANGE |
|
static int |
DOCTYPE_KEEP_UNCHANGED |
|
static int |
DOCTYPE_REMOVE |
|
protected int |
doctypeOption |
The doctype option.
|
protected int |
documentWidth |
The document width.
|
protected ErrorHandler |
errorHandler |
The error handler.
|
protected boolean |
format |
Whether the output must be formatted.
|
protected java.lang.String |
newline |
The newline characters.
|
protected OutputManager |
output |
The output manager.
|
protected java.lang.String |
publicId |
The public id.
|
protected XMLScanner |
scanner |
The document scanner.
|
protected java.lang.String |
systemId |
The system id.
|
protected int |
tabulationWidth |
The tabulation width.
|
protected int |
type |
The type of the current lexical unit.
|
protected java.io.Writer |
writer |
The writer used to output the document.
|
protected java.lang.String |
xmlDeclaration |
The XML declaration.
|
| Constructor | Description |
|---|---|
PrettyPrinter() |
| Modifier and Type | Method | Description |
|---|---|---|
protected TranscoderException |
fatalError(java.lang.String key,
java.lang.Object[] params) |
Creates a transcoder exception.
|
protected char[] |
getCurrentValue() |
Returns the current lexical unit value.
|
int |
getDocumentWidth() |
Returns whether the document width.
|
boolean |
getFormat() |
Returns whether the output must be formatted.
|
java.lang.String |
getNewline() |
Returns the newline characters.
|
int |
getTabulationWidth() |
Returns whether the tabulation width.
|
void |
print(java.io.Reader r,
java.io.Writer w) |
Prints an SVG document from the given reader to the given writer.
|
protected void |
printAttlist() |
Prints an ATTLIST declaration.
|
protected void |
printChildren() |
Prints the children of an element declaration.
|
protected void |
printContent(boolean spaceAtStart) |
Prints the content of an element.
|
protected void |
printDoctype() |
Prints the doctype.
|
protected java.lang.String |
printElement() |
Prints an element.
|
protected void |
printElementDeclaration() |
Prints an element declaration.
|
protected void |
printEntityDeclaration() |
Prints an entity declaration.
|
protected void |
printNotation() |
Prints a notation declaration.
|
protected void |
printPI() |
Prints a processing instruction.
|
protected void |
printXMLDecl() |
Prints the XML declaration.
|
void |
setDoctypeOption(int i) |
Sets the doctype option.
|
void |
setDocumentWidth(int i) |
Sets the document width.
|
void |
setFormat(boolean b) |
Sets the format attribute.
|
void |
setNewline(java.lang.String s) |
Sets the newline characters.
|
void |
setPublicId(java.lang.String s) |
Sets the public ID.
|
void |
setSystemId(java.lang.String s) |
Sets the system ID.
|
void |
setTabulationWidth(int i) |
Sets the tabulation width.
|
void |
setXMLDeclaration(java.lang.String s) |
Sets the XML declaration text.
|
public static final int DOCTYPE_CHANGE
public static final int DOCTYPE_REMOVE
public static final int DOCTYPE_KEEP_UNCHANGED
protected XMLScanner scanner
protected OutputManager output
protected java.io.Writer writer
protected ErrorHandler errorHandler
protected java.lang.String newline
protected boolean format
protected int tabulationWidth
protected int documentWidth
protected int doctypeOption
protected java.lang.String publicId
protected java.lang.String systemId
protected java.lang.String xmlDeclaration
protected int type
public void setXMLDeclaration(java.lang.String s)
public void setDoctypeOption(int i)
public void setPublicId(java.lang.String s)
public void setSystemId(java.lang.String s)
public void setNewline(java.lang.String s)
public java.lang.String getNewline()
public void setFormat(boolean b)
public boolean getFormat()
public void setTabulationWidth(int i)
public int getTabulationWidth()
public void setDocumentWidth(int i)
public int getDocumentWidth()
public void print(java.io.Reader r,
java.io.Writer w)
throws TranscoderException,
java.io.IOException
TranscoderExceptionjava.io.IOExceptionprotected void printXMLDecl()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printPI()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printDoctype()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected java.lang.String printElement()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printContent(boolean spaceAtStart)
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printNotation()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printAttlist()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printEntityDeclaration()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printElementDeclaration()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected void printChildren()
throws TranscoderException,
XMLException,
java.io.IOException
TranscoderExceptionXMLExceptionjava.io.IOExceptionprotected char[] getCurrentValue()
protected TranscoderException fatalError(java.lang.String key, java.lang.Object[] params) throws TranscoderException
TranscoderExceptionCopyright ? 2018 Apache Software Foundation. All Rights Reserved.