org.apache.batik.transcoder.svg2svg

Class PrettyPrinter

public class PrettyPrinter extends Object

This class represents an SVG source files pretty-printer.
Field Summary
protected intdoctypeOption
The doctype option.
protected intdocumentWidth
The document width.
static intDOCTYPE_CHANGE
static intDOCTYPE_KEEP_UNCHANGED
static intDOCTYPE_REMOVE
protected ErrorHandlererrorHandler
The error handler.
protected booleanformat
Whether the output must be formatted.
protected Stringnewline
The newline characters.
protected OutputManageroutput
The output manager.
protected StringpublicId
The public id.
protected XMLScannerscanner
The document scanner.
protected StringsystemId
The system id.
protected inttabulationWidth
The tabulation width.
protected inttype
The type of the current lexical unit.
protected Writerwriter
The writer used to output the document.
protected StringxmlDeclaration
The XML declaration.
Method Summary
protected TranscoderExceptionfatalError(String key, Object[] params)
Creates a transcoder exception.
protected char[]getCurrentValue()
Returns the current lexical unit value.
intgetDocumentWidth()
Returns whether the document width.
booleangetFormat()
Returns whether the output must be formatted.
StringgetNewline()
Returns the newline characters.
intgetTabulationWidth()
Returns whether the tabulation width.
voidprint(Reader r, Writer w)
Prints an SVG document from the given reader to the given writer.
protected voidprintAttlist()
Prints an ATTLIST declaration.
protected voidprintChildren()
Prints the children of an element declaration.
protected voidprintContent(boolean spaceAtStart)
Prints the content of an element.
protected voidprintDoctype()
Prints the doctype.
protected StringprintElement()
Prints an element.
protected voidprintElementDeclaration()
Prints an element declaration.
protected voidprintEntityDeclaration()
Prints an entity declaration.
protected voidprintNotation()
Prints a notation declaration.
protected voidprintPI()
Prints a processing instruction.
protected voidprintXMLDecl()
Prints the XML declaration.
voidsetDoctypeOption(int i)
Sets the doctype option.
voidsetDocumentWidth(int i)
Sets the document width.
voidsetFormat(boolean b)
Sets the format attribute.
voidsetNewline(String s)
Sets the newline characters.
voidsetPublicId(String s)
Sets the public ID.
voidsetSystemId(String s)
Sets the system ID.
voidsetTabulationWidth(int i)
Sets the tabulation width.
voidsetXMLDeclaration(String s)
Sets the XML declaration text.

Field Detail

doctypeOption

protected int doctypeOption
The doctype option.

documentWidth

protected int documentWidth
The document width.

DOCTYPE_CHANGE

public static final int DOCTYPE_CHANGE

DOCTYPE_KEEP_UNCHANGED

public static final int DOCTYPE_KEEP_UNCHANGED

DOCTYPE_REMOVE

public static final int DOCTYPE_REMOVE

errorHandler

protected ErrorHandler errorHandler
The error handler.

format

protected boolean format
Whether the output must be formatted.

newline

protected String newline
The newline characters.

output

protected OutputManager output
The output manager.

publicId

protected String publicId
The public id.

scanner

protected XMLScanner scanner
The document scanner.

systemId

protected String systemId
The system id.

tabulationWidth

protected int tabulationWidth
The tabulation width.

type

protected int type
The type of the current lexical unit.

writer

protected Writer writer
The writer used to output the document.

xmlDeclaration

protected String xmlDeclaration
The XML declaration.

Method Detail

fatalError

protected TranscoderException fatalError(String key, Object[] params)
Creates a transcoder exception.

getCurrentValue

protected char[] getCurrentValue()
Returns the current lexical unit value.

getDocumentWidth

public int getDocumentWidth()
Returns whether the document width.

getFormat

public boolean getFormat()
Returns whether the output must be formatted.

getNewline

public String getNewline()
Returns the newline characters.

getTabulationWidth

public int getTabulationWidth()
Returns whether the tabulation width.

print

public void print(Reader r, Writer w)
Prints an SVG document from the given reader to the given writer.

printAttlist

protected void printAttlist()
Prints an ATTLIST declaration.

printChildren

protected void printChildren()
Prints the children of an element declaration.

printContent

protected void printContent(boolean spaceAtStart)
Prints the content of an element.

printDoctype

protected void printDoctype()
Prints the doctype.

printElement

protected String printElement()
Prints an element.

printElementDeclaration

protected void printElementDeclaration()
Prints an element declaration.

printEntityDeclaration

protected void printEntityDeclaration()
Prints an entity declaration.

printNotation

protected void printNotation()
Prints a notation declaration.

printPI

protected void printPI()
Prints a processing instruction.

printXMLDecl

protected void printXMLDecl()
Prints the XML declaration.

setDoctypeOption

public void setDoctypeOption(int i)
Sets the doctype option.

setDocumentWidth

public void setDocumentWidth(int i)
Sets the document width.

setFormat

public void setFormat(boolean b)
Sets the format attribute.

setNewline

public void setNewline(String s)
Sets the newline characters.

setPublicId

public void setPublicId(String s)
Sets the public ID.

setSystemId

public void setSystemId(String s)
Sets the system ID.

setTabulationWidth

public void setTabulationWidth(int i)
Sets the tabulation width.

setXMLDeclaration

public void setXMLDeclaration(String s)
Sets the XML declaration text.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.