org.acm.seguin.pretty
Class PrintData

java.lang.Object
  extended by org.acm.seguin.pretty.PrintData
Direct Known Subclasses:
LineNumberingData

public class PrintData
extends java.lang.Object

This object stores all the data necessary to print the the Java file

Version:
$Id: PrintData.java,v 1.32 2003/11/12 13:44:37 mikeatkinson Exp $
Author:
Mike Atkinson, Mike Atkinson

Field Summary
static int ALPHABETICAL_ORDER
           
static int BLOCK_STYLE_C
          Use the C style blocks
static int BLOCK_STYLE_EMACS
          Use the EMACS style of blocks (like pascal but 2 spaces)
static int BLOCK_STYLE_PASCAL
          Use the PASCAL style blocks
static int C_STYLE_COMMENT
          A c style comment
static int CATEGORY_COMMENT
          A category comment
static int CLASS
          Description of the Field
static int CSC_ALIGN_BLANK
          Aligns the C style comments with a * to the right
static int CSC_ALIGN_STAR
          Aligns the C style comments with a * to the right
static int CSC_LEAVE_UNTOUCHED
          Leaves C Style comments untouched
static int CSC_MAINTAIN_STAR
          Maintains spacing in the C style comments, but insists upon a star at the right
static int DFS_ALIGN_EQUALS
          Only align on the equals
static int DFS_ALWAYS
          ALWAYS use dynamic field spacing
static int DFS_NEVER
          Never use dynamic field spacing
static int DFS_NOT_WITH_JAVADOC
          Use dynamic field spacing except with javadoc
static int DOUBLE_INDENT
          The indent type for an unexpected end of line - double indent
static int EMPTY
          Description of the Field
static int ENUM
          This is used to mark enumerations (which are really classes behind the scenes)
static int FIELD
          Description of the Field
 int finalLine
          Description of the Field
static int INTERFACE
          Description of the Field
static int JAVADOC_COMMENT
          A comment with javadoc
static int METHOD
          Description of the Field
static int NO_INDENT
          There should be no indent
static int PARAM_INDENT
          The indent type for an unexpected end of line - line up parameters indent
static int SINGLE_INDENT
          The indent type for an unexpected end of line - single indent
static int SINGLE_LINE_COMMENT
          A single line comment
static int STANDARD_ORDER
           
 
Constructor Summary
PrintData()
          Create a print data object
PrintData(java.io.Writer out)
          Create a print data object
 
Method Summary
 void appendComment(java.lang.String string, int type)
          Append a comment to the output
 void appendConstant(java.lang.String string)
          Append constant to the output
 void appendKeyword(java.lang.String string)
          Append a keyword to the output
 void appendText(java.lang.String string)
          Append text to the output
 void backspace()
          Backspace
 void beginBlock()
          Start a block
 void beginBlock(boolean space)
          Start a block
 void beginBlock(boolean space, boolean newlineAfter)
          Start a block
 void beginClass()
          Start a Class
 void beginEnum()
          Start a Enum
 void beginExpression(boolean notEmpty)
          Start an expression
 void beginField()
          Start a Field
 void beginInterface()
          Start a Interface
 void beginMethod()
          Start a Method
 void classBrace()
          Indicates that a class's open brace is about to be formatted.
 void close()
          Closes the output stream
 boolean consumeNewline()
          Consume a newline
 void decrCaseIndent()
          Description of the Method
 void decrIndent()
          Decrement the indent by the default amount
 void endBlock()
          End a block
 void endBlock(boolean newline, boolean newlineBefore)
          End a block
 void endClass()
          End a Class
 void endEnum()
          End a Enum
 void endExpression(boolean notEmpty)
          End an expression
 void endField()
          End a Field
 void endInterface()
          End a Interface
 void endMethod()
          End a Method
 void enterMethodDecl()
          Sets the state for being inside a method declaration.
 void exitMethodDecl()
          Indicates that we've exited a method declaration.
 void flush()
          Flushes the buffer
 java.lang.StringBuffer getBuffer()
           
 int getCStyleFormatCode()
          Gets the CStyleFormatCode attribute of the PrintData object
 int getCStyleIndent()
          Gets the CStyleIndent attribute of the PrintData object
 boolean getCStyleOwnline()
          Gets the CStyleOnline attribute of the PrintData object
 java.lang.String getCurrentClassName()
          Gets the CurrentClassName attribute of the PrintData object
 int getDynamicFieldSpaces()
          Gets the DynamicFieldSpacing attribute of the PrintData object
 int getExtendsIndentation()
           
 int getFieldNameIndent()
          Gets the FieldNameIndent attribute of the PrintData object
 int getFieldSpaceCode()
          Return the code for field and local variable spacing
 int getFinalLine()
          Gets the FinalLine attribute of the PrintData object
 int getImplementsIndentation()
           
 java.lang.String[] getImportSortImportant()
          Gets the importSortImportant attribute of the PrintData object
 int getImportSortNeighbourhood()
          Gets the importSortNeighbourhood attribute of the PrintData object
 int getIndent()
          Get the indent
 java.lang.String getIndentString()
          Return the indent string
 int getJavadocIndent()
          Returns the number of spaces between the JavaDoc asterisks and the comment text.
 int getJavadocStarCount()
          Gets the JavadocStarCount attribute of the PrintData object
 int getJavadocWordWrapMaximum()
          Gets the JavadocWordWrapMaximum attribute of the PrintData object
 int getJavadocWordWrapMinimum()
          Gets the JavadocWordWrapMinimum attribute of the PrintData object
 int getLineLength()
          Get the length of the line
 int getLinesAfterPackage()
          Gets the linesAfterPackage attribute of the PrintData object
 int getLinesBeforeClass()
          Gets the linesBeforeClass attribute of the PrintData object
 int getMethodBlockStyle()
          Returns the method block style
 int getModifierOrder()
           
 MultipleOrdering getOrder()
          Gets the Order attribute of the PrintData object
 int getOriginalLine()
          Gets the OriginalLine attribute of the PrintData object
 Settings getSettings()
          Gets the Settings attribute of the PrintData object
 int getState()
          Return the state of the pretty printer
 int getSurpriseReturn()
          Gets the SurpriseReturn attribute of the PrintData object
 int getTaggedJavadocDescription()
           
 java.util.Comparator getTopOrder(net.sourceforge.jrefactory.ast.ASTCompilationUnit node)
          Gets the TopOrder attribute of the PrintData object
 void incrCaseIndent()
          Description of the Method
 void incrIndent()
          Increment the indent by the default amount
protected  void incrIndent(int incr)
          Increment the indent
 void indent()
          Indent the output
 boolean isAllJavadocKept()
          Gets the AllJavadocKept attribute of the PrintData object
 boolean isAllowSingleLineJavadoc()
          Gets the allowSingleLineJavadoc attribute of the PrintData object
 boolean isArrayInitializerIndented()
           
 boolean isBangSpace()
          Gets the bangSpace attribute of the PrintData object
 boolean isBufferEmpty()
          Is the output buffer empty?
 boolean isCastSpace()
          Gets the CastSpace attribute of the PrintData object
 boolean isCatchOnNewLine()
          Returns true if the catch statement is on a new line
 boolean isCurrentSingle()
          Gets the currentSingle attribute of the PrintData object
 boolean isDynamicFieldSpacing(boolean javadocPrinted)
          Gets the DynamicFieldSpacing attribute of the PrintData object
 boolean isElseOnNewLine()
          Returns true if the else statement is on a new line
 boolean isEmptyBlockOnSingleLine()
          Gets the EmptyBlockOnSingleLine attribute of the PrintData object
 boolean isFieldNameIndented()
          Gets the FieldNameIndented attribute of the PrintData object
 boolean isFirstLineOnCommentStart()
          Gets the firstLineOnCommentStart attribute of the PrintData object
 boolean isForcingBlock()
          Gets the ForcingBlock attribute of the PrintData object
 boolean isIndentInInitailzer()
          Gets the indentInInitailzer attribute of the PrintData object
 boolean isInsertSpaceLocalVariables()
          Gets the insertSpaceLocalVariables attribute of the PrintData object
 boolean isJavadocDescriptionLinedup()
           
 boolean isJavadocLinedUp()
          Returns true if JavaDoc IDs (param, returns, etc.) should be lined up.
 boolean isKeepErroneousJavadocTags()
          Gets the keepErroneousJavadocTags attribute of the PrintData object
 boolean isLineBeforeClassBody()
           
 boolean isLineBeforeExtends()
           
 boolean isLineBeforeImplements()
           
 boolean isLineBeforeMultistatementMethodBody()
           
 boolean isLineIndented()
          Is the output buffer empty?
 boolean isMaintainNewlinesAroundImports()
          Gets the maintainNewlinesAroundImports attribute of the PrintData object
 boolean isNestedClassDocumented()
          Gets the NestedClassDocumented attribute of the PrintData object
 boolean isReformatComments()
          Gets the ReformatComments attribute of the PrintData object
 boolean isRemoveExcessBlocks()
          Gets the removeExcessBlocks attribute of the PrintData object
 boolean isSortTop()
           
 boolean isSpaceAfterCast()
          Gets the SpaceAfterCast attribute of the PrintData object
 boolean isSpaceAfterKeyword()
          Determines whether there should be a space between a keyword such as 'if' or 'while' and the opening brace that follows it.
 boolean isSpaceAfterMethod()
          Determines whether there should be a space between a method call and the opening brace that follows it.
 boolean isSpaceAroundOperators()
          Gets the spaceAroundOperators attribute of the PrintData object
 boolean isSpaceBeforeAt()
          Determines if there should be a space between the '*' and the '@' in a javadoc comment.
 boolean isSpaceInsideCast()
          Determines if there is a space inside the cast parens
 boolean isStarsAlignedWithSlash()
           
 boolean isThrowsOnNewline()
          Gets the ThrowsOnNewline attribute of the PrintData object
 boolean isVariablesAlignWithBlock()
          Gets the variablesAlignWithBlock attribute of the PrintData object
protected  LineQueue lineQueueFactory(java.io.PrintWriter output)
          Creates a line queue object
 void methodBrace()
          Indicates that a method's open brace is about to be formatted.
 void newline()
          Add a newline
 void popCurrentClassName()
          Description of the Method
 void popFieldSize()
          Description of the Method
 void pushCurrentClassName(java.lang.String name)
          Description of the Method
 void pushFieldSize(FieldSize size)
          Description of the Method
 void reset()
          Description of the Method
 void saveCurrentLine()
          Description of the Method
 void setAbsoluteCommentSpacing(int value)
          Sets the AbsoluteCommentSpacing attribute of the PrintData object
 void setAlignStarsWithSlash(boolean value)
           
 void setArrayInitializerIndented(boolean way)
           
 void setBangSpace(boolean value)
          Sets the bangSpace attribute of the PrintData object
 void setCaseIndent(int value)
          Sets the caseIndent attribute of the PrintData object
 void setCastSpace(boolean value)
          Sets the CastSpace attribute of the PrintData object
 void setClassBlockStyle(int value)
          Sets the ClassCStyleBlock attribute of the PrintData object
 void setCodeBlockStyle(int value)
          Sets the codeBlockStyle attribute of the PrintData object
 void setCStyleFormatCode(int value)
          Sets the CStyleFormatCode attribute of the PrintData object
 void setCStyleIndent(int value)
          Sets the CStyleIndent attribute of the PrintData object
 void setCStyleOwnline(boolean ownline)
          Sets the CStyleOnline attribute of the PrintData object
 void setCurrentIsSingle(boolean value)
          Sets the currentIsSingle attribute of the PrintData object
 void setDocumentNestedClasses(boolean value)
          Sets the DocumentNestedClasses attribute of the PrintData object
 void setDynamicFieldSpaces(int value)
          Sets the DynamicFieldSpacing attribute of the PrintData object
 void setDynamicFieldSpacing(int value)
          Sets the DynamicFieldSpacing attribute of the PrintData object
 void setElseOnNewLine(boolean value)
          Sets the elseOnNewLine attribute of the PrintData object
 void setEmptyBlockOnSingleLine(boolean value)
          Sets the EmptyBlockOnSingleLine attribute of the PrintData object
 void setExpressionSpace(boolean value)
          Sets the ExpressionSpace attribute of the PrintData object
 void setExtendsIndentation(int value)
           
 void setFinalLine(int value)
          Sets the FinalLine attribute of the PrintData object
 void setForceBlock(boolean value)
          Sets the ForceBlock attribute of the PrintData object
 void setImplementsIndentation(int value)
           
 void setImportSortImportant(java.lang.String[] newImportSortImportant)
          Sets the importSortImportant attribute of the PrintData object
 void setImportSortNeighbourhood(int newImportSortNeighbourhood)
          Sets the importSortNeighbourhood attribute of the PrintData object
 void setIncrementalCommentSpacing(int value)
          Sets the IncrementalCommentSpacing attribute of the PrintData object
 void setIndentInInitializer(boolean value)
          Sets the indentInInitializer attribute of the PrintData object
 void setInsertSpaceLocalVariables(boolean value)
          Sets the insertSpaceLocalVariables attribute of the PrintData object
 void setJavadocIndent(int indent)
          Sets the number of spaces between the JavaDoc asterisks and the comment text.
 void setJavadocWordWrapMaximum(int wrap)
          Sets the JavadocWordWrapMaximum attribute of the PrintData object
 void setJavadocWordWrapMinimum(int wrap)
          Sets the JavadocWordWrapMinimum attribute of the PrintData object
 void setKeepErroneousJavadocTags(boolean value)
          Sets the keepErroneousJavadocTags attribute of the PrintData object
 void setLineBeforeClassBody(boolean value)
           
 void setLineBeforeExtends(boolean value)
           
 void setLineBeforeImplements(boolean value)
           
 void setLineBeforeMultistatementMethodBody(boolean value)
           
 void setLinesAfterPackage(int value)
          Sets the linesAfterPackage attribute of the PrintData object
 void setLinesBeforeClass(int value)
          Sets the linesBeforeClass attribute of the PrintData object
 void setLineupJavadocDescr(boolean way)
           
 void setLineupJavadocIDs(boolean way)
           
 void setLineUpParams(boolean value)
           
 void setMaintainNewlinesAroundImports(boolean value)
          Sets the maintainNewlinesAroundImports attribute of the PrintData object
 void setMethodBlockStyle(int value)
          Sets the methodBlockStyle attribute of the PrintData object
 void setModifierOrder(int value)
           
 void setMultipleOrdering(MultipleOrdering value)
          Sets the MultipleOrdering attribute of the PrintData object
 void setOriginalLine(int value)
          Sets the OriginalLine attribute of the PrintData object
 void setOutput(java.io.PrintWriter newOutput)
          Set the output writer
 void setOwnline(boolean value)
          Sets the Ownline attribute of the LineQueue object
 void setOwnlineCode(boolean value)
          Sets the OwnlineCode attribute of the PrintData object
 void setParamIndent()
          Records the position of the method's opening parenthesis for use in indenting parameters on subsequent lines.
 void setReformatComments(boolean value)
          Sets the ReformatComments attribute of the PrintData object
 void setRemoveExcessBlocks(boolean value)
          Sets the removeExcessBlocks attribute of the PrintData object
 void setSharedIncr(boolean value)
          Sets the SharedIncr attribute of the PrintData object
 void setSingleLineJavadoc(boolean value)
          Sets the singleLineJavadoc attribute of the PrintData object
 void setSortExtendsStatement(boolean value)
           
 void setSortImplementsStatement(boolean value)
           
 void setSortThrowsStatement(boolean value)
           
 void setSortTop(boolean value)
          Sets the sortTop attribute of the PrintData object
 void setSpaceAfterKeyword(boolean way)
          Sets the spaceAfterKeyword attribute of the PrintData object
 void setSpaceAfterMethod(boolean way)
          Sets the spaceAfterMethod attribute of the PrintData object
 void setSpaceAroundOperators(boolean way)
          Sets the spaceAroundOperators attribute of the PrintData object
 void setSpaceInsideCast(boolean way)
          Sets the spaceInsideCast attribute of the PrintData object
 void setState(int newState)
          Set the state
 void setTaggedJavadocDescription(int value)
           
 void setVariablesAlignWithBlock(boolean value)
          Sets the variablesAlignWithBlock attribute of the PrintData object
 void sortExtends(net.sourceforge.jrefactory.ast.ASTNameList node)
           
 void sortImplements(net.sourceforge.jrefactory.ast.ASTNameList node)
           
 void sortThrows(net.sourceforge.jrefactory.ast.ASTNameList node)
           
 void space()
          Add a space
 void surpriseIndent()
          Inserts a surprise indent
 FieldSize topFieldSize()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

finalLine

public int finalLine
Description of the Field


BLOCK_STYLE_C

public static final int BLOCK_STYLE_C
Use the C style blocks

See Also:
Constant Field Values

BLOCK_STYLE_PASCAL

public static final int BLOCK_STYLE_PASCAL
Use the PASCAL style blocks

See Also:
Constant Field Values

BLOCK_STYLE_EMACS

public static final int BLOCK_STYLE_EMACS
Use the EMACS style of blocks (like pascal but 2 spaces)

See Also:
Constant Field Values

EMPTY

public static int EMPTY
Description of the Field


METHOD

public static int METHOD
Description of the Field


FIELD

public static int FIELD
Description of the Field


INTERFACE

public static int INTERFACE
Description of the Field


CLASS

public static int CLASS
Description of the Field


ENUM

public static int ENUM
This is used to mark enumerations (which are really classes behind the scenes)

Since:
JRefactory 2.7.00

SINGLE_INDENT

public static int SINGLE_INDENT
The indent type for an unexpected end of line - single indent


DOUBLE_INDENT

public static int DOUBLE_INDENT
The indent type for an unexpected end of line - double indent


PARAM_INDENT

public static int PARAM_INDENT
The indent type for an unexpected end of line - line up parameters indent


NO_INDENT

public static int NO_INDENT
There should be no indent


JAVADOC_COMMENT

public static final int JAVADOC_COMMENT
A comment with javadoc

See Also:
Constant Field Values

C_STYLE_COMMENT

public static final int C_STYLE_COMMENT
A c style comment

See Also:
Constant Field Values

CATEGORY_COMMENT

public static final int CATEGORY_COMMENT
A category comment

See Also:
Constant Field Values

SINGLE_LINE_COMMENT

public static final int SINGLE_LINE_COMMENT
A single line comment

See Also:
Constant Field Values

DFS_NEVER

public static final int DFS_NEVER
Never use dynamic field spacing

See Also:
Constant Field Values

DFS_ALWAYS

public static final int DFS_ALWAYS
ALWAYS use dynamic field spacing

See Also:
Constant Field Values

DFS_NOT_WITH_JAVADOC

public static final int DFS_NOT_WITH_JAVADOC
Use dynamic field spacing except with javadoc

See Also:
Constant Field Values

DFS_ALIGN_EQUALS

public static final int DFS_ALIGN_EQUALS
Only align on the equals

See Also:
Constant Field Values

CSC_LEAVE_UNTOUCHED

public static final int CSC_LEAVE_UNTOUCHED
Leaves C Style comments untouched

See Also:
Constant Field Values

CSC_ALIGN_STAR

public static final int CSC_ALIGN_STAR
Aligns the C style comments with a * to the right

See Also:
Constant Field Values

CSC_ALIGN_BLANK

public static final int CSC_ALIGN_BLANK
Aligns the C style comments with a * to the right

See Also:
Constant Field Values

CSC_MAINTAIN_STAR

public static final int CSC_MAINTAIN_STAR
Maintains spacing in the C style comments, but insists upon a star at the right

See Also:
Constant Field Values

ALPHABETICAL_ORDER

public static final int ALPHABETICAL_ORDER
See Also:
Constant Field Values

STANDARD_ORDER

public static final int STANDARD_ORDER
See Also:
Constant Field Values
Constructor Detail

PrintData

public PrintData()
Create a print data object


PrintData

public PrintData(java.io.Writer out)
Create a print data object

Parameters:
out - the output stream
Method Detail

setSortThrowsStatement

public void setSortThrowsStatement(boolean value)

setSortExtendsStatement

public void setSortExtendsStatement(boolean value)

setSortImplementsStatement

public void setSortImplementsStatement(boolean value)

setAbsoluteCommentSpacing

public void setAbsoluteCommentSpacing(int value)
Sets the AbsoluteCommentSpacing attribute of the PrintData object

Parameters:
value - The new AbsoluteCommentSpacing value

setBangSpace

public void setBangSpace(boolean value)
Sets the bangSpace attribute of the PrintData object

Parameters:
value - The new bangSpace value

setCStyleFormatCode

public void setCStyleFormatCode(int value)
Sets the CStyleFormatCode attribute of the PrintData object

Parameters:
value - The new CStyleFormatCode value

setCStyleIndent

public void setCStyleIndent(int value)
Sets the CStyleIndent attribute of the PrintData object

Parameters:
value - The new CStyleIndent value

setCaseIndent

public void setCaseIndent(int value)
Sets the caseIndent attribute of the PrintData object

Parameters:
value - The new caseIndent value

setCastSpace

public void setCastSpace(boolean value)
Sets the CastSpace attribute of the PrintData object

Parameters:
value - The new CastSpace value

setClassBlockStyle

public void setClassBlockStyle(int value)
Sets the ClassCStyleBlock attribute of the PrintData object

Parameters:
value - The new ClassCStyleBlock value

setCodeBlockStyle

public void setCodeBlockStyle(int value)
Sets the codeBlockStyle attribute of the PrintData object

Parameters:
value - The new codeBlockStyle value

setCurrentIsSingle

public void setCurrentIsSingle(boolean value)
Sets the currentIsSingle attribute of the PrintData object

Parameters:
value - The new currentIsSingle value

setDocumentNestedClasses

public void setDocumentNestedClasses(boolean value)
Sets the DocumentNestedClasses attribute of the PrintData object

Parameters:
value - The new DocumentNestedClasses value

setDynamicFieldSpaces

public void setDynamicFieldSpaces(int value)
Sets the DynamicFieldSpacing attribute of the PrintData object

Parameters:
value - The new DynamicFieldSpacing value

setDynamicFieldSpacing

public void setDynamicFieldSpacing(int value)
Sets the DynamicFieldSpacing attribute of the PrintData object

Parameters:
value - The new DynamicFieldSpacing value

setLineUpParams

public void setLineUpParams(boolean value)

setElseOnNewLine

public void setElseOnNewLine(boolean value)
Sets the elseOnNewLine attribute of the PrintData object

Parameters:
value - The new elseOnNewLine value

setEmptyBlockOnSingleLine

public void setEmptyBlockOnSingleLine(boolean value)
Sets the EmptyBlockOnSingleLine attribute of the PrintData object

Parameters:
value - The new EmptyBlockOnSingleLine value

setExpressionSpace

public void setExpressionSpace(boolean value)
Sets the ExpressionSpace attribute of the PrintData object

Parameters:
value - The new ExpressionSpace value

setFinalLine

public void setFinalLine(int value)
Sets the FinalLine attribute of the PrintData object

Parameters:
value - The new FinalLine value

setForceBlock

public void setForceBlock(boolean value)
Sets the ForceBlock attribute of the PrintData object

Parameters:
value - The new ForceBlock value

setImportSortImportant

public void setImportSortImportant(java.lang.String[] newImportSortImportant)
Sets the importSortImportant attribute of the PrintData object

Parameters:
newImportSortImportant - The new importSortImportant value

setImportSortNeighbourhood

public void setImportSortNeighbourhood(int newImportSortNeighbourhood)
Sets the importSortNeighbourhood attribute of the PrintData object

Parameters:
newImportSortNeighbourhood - The new importSortNeighbourhood value

setIncrementalCommentSpacing

public void setIncrementalCommentSpacing(int value)
Sets the IncrementalCommentSpacing attribute of the PrintData object

Parameters:
value - The new IncrementalCommentSpacing value

setIndentInInitializer

public void setIndentInInitializer(boolean value)
Sets the indentInInitializer attribute of the PrintData object

Parameters:
value - The new indentInInitializer value

setInsertSpaceLocalVariables

public void setInsertSpaceLocalVariables(boolean value)
Sets the insertSpaceLocalVariables attribute of the PrintData object

Parameters:
value - The new insertSpaceLocalVariables value

setKeepErroneousJavadocTags

public void setKeepErroneousJavadocTags(boolean value)
Sets the keepErroneousJavadocTags attribute of the PrintData object

Parameters:
value - The new keepErroneousJavadocTags value

setLinesAfterPackage

public void setLinesAfterPackage(int value)
Sets the linesAfterPackage attribute of the PrintData object

Parameters:
value - The new linesAfterPackage value

setLinesBeforeClass

public void setLinesBeforeClass(int value)
Sets the linesBeforeClass attribute of the PrintData object

Parameters:
value - The new linesBeforeClass value

setMaintainNewlinesAroundImports

public void setMaintainNewlinesAroundImports(boolean value)
Sets the maintainNewlinesAroundImports attribute of the PrintData object

Parameters:
value - The new maintainNewlinesAroundImports value

setMethodBlockStyle

public void setMethodBlockStyle(int value)
Sets the methodBlockStyle attribute of the PrintData object

Parameters:
value - The new methodBlockStyle value

setMultipleOrdering

public void setMultipleOrdering(MultipleOrdering value)
Sets the MultipleOrdering attribute of the PrintData object

Parameters:
value - The new MultipleOrdering value

setOriginalLine

public void setOriginalLine(int value)
Sets the OriginalLine attribute of the PrintData object

Parameters:
value - The new OriginalLine value

setOutput

public void setOutput(java.io.PrintWriter newOutput)
Set the output writer

Parameters:
newOutput - the new output writer

setOwnline

public void setOwnline(boolean value)
Sets the Ownline attribute of the LineQueue object

Parameters:
value - The new Ownline value

setOwnlineCode

public void setOwnlineCode(boolean value)
Sets the OwnlineCode attribute of the PrintData object

Parameters:
value - The new OwnlineCode value

setParamIndent

public void setParamIndent()
Records the position of the method's opening parenthesis for use in indenting parameters on subsequent lines.


setReformatComments

public void setReformatComments(boolean value)
Sets the ReformatComments attribute of the PrintData object

Parameters:
value - The new ReformatComments value

setRemoveExcessBlocks

public void setRemoveExcessBlocks(boolean value)
Sets the removeExcessBlocks attribute of the PrintData object

Parameters:
value - The new removeExcessBlocks value

setSharedIncr

public void setSharedIncr(boolean value)
Sets the SharedIncr attribute of the PrintData object

Parameters:
value - The new SharedIncr value

setSingleLineJavadoc

public void setSingleLineJavadoc(boolean value)
Sets the singleLineJavadoc attribute of the PrintData object

Parameters:
value - The new singleLineJavadoc value

setSortTop

public void setSortTop(boolean value)
Sets the sortTop attribute of the PrintData object

Parameters:
value - The new sortTop value

setSpaceAfterMethod

public void setSpaceAfterMethod(boolean way)
Sets the spaceAfterMethod attribute of the PrintData object

Parameters:
way - The new spaceAfterMethod value

setSpaceAfterKeyword

public void setSpaceAfterKeyword(boolean way)
Sets the spaceAfterKeyword attribute of the PrintData object

Parameters:
way - The new spaceAfterKeyword value
Since:
JRefactory 2.7.00

setSpaceAroundOperators

public void setSpaceAroundOperators(boolean way)
Sets the spaceAroundOperators attribute of the PrintData object

Parameters:
way - The new spaceAroundOperators value

setSpaceInsideCast

public void setSpaceInsideCast(boolean way)
Sets the spaceInsideCast attribute of the PrintData object

Parameters:
way - The new spaceInsideCast value

setState

public void setState(int newState)
Set the state

Parameters:
newState - Description of Parameter

setVariablesAlignWithBlock

public void setVariablesAlignWithBlock(boolean value)
Sets the variablesAlignWithBlock attribute of the PrintData object

Parameters:
value - The new variablesAlignWithBlock value

getCStyleFormatCode

public int getCStyleFormatCode()
Gets the CStyleFormatCode attribute of the PrintData object

Returns:
The CStyleFormatCode value

getCStyleIndent

public int getCStyleIndent()
Gets the CStyleIndent attribute of the PrintData object

Returns:
The CStyleIndent value

getCStyleOwnline

public boolean getCStyleOwnline()
Gets the CStyleOnline attribute of the PrintData object

Returns:
The CStyleOnline value

setCStyleOwnline

public void setCStyleOwnline(boolean ownline)
Sets the CStyleOnline attribute of the PrintData object

Parameters:
ownline - The new CStyleOnline value

getCurrentClassName

public java.lang.String getCurrentClassName()
Gets the CurrentClassName attribute of the PrintData object

Returns:
The CurrentClassName value

getDynamicFieldSpaces

public int getDynamicFieldSpaces()
Gets the DynamicFieldSpacing attribute of the PrintData object

Returns:
The DynamicFieldSpacing value

getFieldNameIndent

public int getFieldNameIndent()
Gets the FieldNameIndent attribute of the PrintData object

Returns:
The FieldNameIndent value

getFieldSpaceCode

public int getFieldSpaceCode()
Return the code for field and local variable spacing

Returns:
the code

getFinalLine

public int getFinalLine()
Gets the FinalLine attribute of the PrintData object

Returns:
The FinalLine value

getImportSortImportant

public java.lang.String[] getImportSortImportant()
Gets the importSortImportant attribute of the PrintData object

Returns:
The importSortImportant value

getImportSortNeighbourhood

public int getImportSortNeighbourhood()
Gets the importSortNeighbourhood attribute of the PrintData object

Returns:
The importSortNeighbourhood value

getIndentString

public java.lang.String getIndentString()
Return the indent string

Returns:
an appropriate length string

getJavadocIndent

public int getJavadocIndent()
Returns the number of spaces between the JavaDoc asterisks and the comment text.

Returns:
the number of spaces between the JavaDoc asterisks and the comment

setJavadocIndent

public void setJavadocIndent(int indent)
Sets the number of spaces between the JavaDoc asterisks and the comment text.

Parameters:
indent - the number of spaces between the JavaDoc asterisks and the comment
Since:
JRefactory 2.7.02

getJavadocStarCount

public int getJavadocStarCount()
Gets the JavadocStarCount attribute of the PrintData object

Returns:
The JavadocStarCount value

getJavadocWordWrapMaximum

public int getJavadocWordWrapMaximum()
Gets the JavadocWordWrapMaximum attribute of the PrintData object

Returns:
The JavadocWordWrapMaximum value

setJavadocWordWrapMaximum

public void setJavadocWordWrapMaximum(int wrap)
Sets the JavadocWordWrapMaximum attribute of the PrintData object

Parameters:
wrap - The JavadocWordWrapMaximum value
Since:
JRefactory 2.7.00

getJavadocWordWrapMinimum

public int getJavadocWordWrapMinimum()
Gets the JavadocWordWrapMinimum attribute of the PrintData object

Returns:
The JavadocWordWrapMinimum value

setJavadocWordWrapMinimum

public void setJavadocWordWrapMinimum(int wrap)
Sets the JavadocWordWrapMinimum attribute of the PrintData object

Parameters:
wrap - The JavadocWordWrapMinimum value
Since:
JRefactory 2.7.00

getLineLength

public int getLineLength()
Get the length of the line

Returns:
the length of the buffer

getLinesAfterPackage

public int getLinesAfterPackage()
Gets the linesAfterPackage attribute of the PrintData object

Returns:
The linesAfterPackage value

getLinesBeforeClass

public int getLinesBeforeClass()
Gets the linesBeforeClass attribute of the PrintData object

Returns:
The linesBeforeClass value

getOrder

public MultipleOrdering getOrder()
Gets the Order attribute of the PrintData object

Returns:
The Order value

getOriginalLine

public int getOriginalLine()
Gets the OriginalLine attribute of the PrintData object

Returns:
The OriginalLine value

getSettings

public Settings getSettings()
Gets the Settings attribute of the PrintData object

Returns:
The Settings value

getState

public int getState()
Return the state of the pretty printer

Returns:
an integer representing the state

getSurpriseReturn

public int getSurpriseReturn()
Gets the SurpriseReturn attribute of the PrintData object

Returns:
The SurpriseReturn value

isSortTop

public boolean isSortTop()

getTopOrder

public java.util.Comparator getTopOrder(net.sourceforge.jrefactory.ast.ASTCompilationUnit node)
Gets the TopOrder attribute of the PrintData object

Parameters:
node - Description of the Parameter
Returns:
The TopOrder value

sortThrows

public void sortThrows(net.sourceforge.jrefactory.ast.ASTNameList node)

sortImplements

public void sortImplements(net.sourceforge.jrefactory.ast.ASTNameList node)

sortExtends

public void sortExtends(net.sourceforge.jrefactory.ast.ASTNameList node)

isAllJavadocKept

public boolean isAllJavadocKept()
Gets the AllJavadocKept attribute of the PrintData object

Returns:
The AllJavadocKept value

isAllowSingleLineJavadoc

public boolean isAllowSingleLineJavadoc()
Gets the allowSingleLineJavadoc attribute of the PrintData object

Returns:
The allowSingleLineJavadoc value

isFirstLineOnCommentStart

public boolean isFirstLineOnCommentStart()
Gets the firstLineOnCommentStart attribute of the PrintData object

Returns:
The firstLineOnCommentStart value
Since:
2.9.2

isBangSpace

public boolean isBangSpace()
Gets the bangSpace attribute of the PrintData object

Returns:
The bangSpace value

isBufferEmpty

public boolean isBufferEmpty()
Is the output buffer empty?

Returns:
true if the output buffer is empty

isCastSpace

public boolean isCastSpace()
Gets the CastSpace attribute of the PrintData object

Returns:
The CastSpace value

isCatchOnNewLine

public boolean isCatchOnNewLine()
Returns true if the catch statement is on a new line

Returns:
true if catch should start a line

isCurrentSingle

public boolean isCurrentSingle()
Gets the currentSingle attribute of the PrintData object

Returns:
The currentSingle value

isDynamicFieldSpacing

public boolean isDynamicFieldSpacing(boolean javadocPrinted)
Gets the DynamicFieldSpacing attribute of the PrintData object

Parameters:
javadocPrinted - Description of Parameter
Returns:
The DynamicFieldSpacing value

isElseOnNewLine

public boolean isElseOnNewLine()
Returns true if the else statement is on a new line

Returns:
true if else should start a line

isEmptyBlockOnSingleLine

public boolean isEmptyBlockOnSingleLine()
Gets the EmptyBlockOnSingleLine attribute of the PrintData object

Returns:
The EmptyBlockOnSingleLine value

isFieldNameIndented

public boolean isFieldNameIndented()
Gets the FieldNameIndented attribute of the PrintData object

Returns:
The FieldNameIndented value

isForcingBlock

public boolean isForcingBlock()
Gets the ForcingBlock attribute of the PrintData object

Returns:
The ForcingBlock value

isIndentInInitailzer

public boolean isIndentInInitailzer()
Gets the indentInInitailzer attribute of the PrintData object

Returns:
The indentInInitailzer value

isInsertSpaceLocalVariables

public boolean isInsertSpaceLocalVariables()
Gets the insertSpaceLocalVariables attribute of the PrintData object

Returns:
The insertSpaceLocalVariables value

isJavadocLinedUp

public boolean isJavadocLinedUp()
Returns true if JavaDoc IDs (param, returns, etc.) should be lined up.

Returns:
True if lining up comments, false otherwise

isKeepErroneousJavadocTags

public boolean isKeepErroneousJavadocTags()
Gets the keepErroneousJavadocTags attribute of the PrintData object

Returns:
The keepErroneousJavadocTags value

isLineIndented

public boolean isLineIndented()
Is the output buffer empty?

Returns:
true if the output buffer is empty

isMaintainNewlinesAroundImports

public boolean isMaintainNewlinesAroundImports()
Gets the maintainNewlinesAroundImports attribute of the PrintData object

Returns:
The maintainNewlinesAroundImports value

isNestedClassDocumented

public boolean isNestedClassDocumented()
Gets the NestedClassDocumented attribute of the PrintData object

Returns:
The NestedClassDocumented value

isReformatComments

public boolean isReformatComments()
Gets the ReformatComments attribute of the PrintData object

Returns:
The ReformatComments value

isRemoveExcessBlocks

public boolean isRemoveExcessBlocks()
Gets the removeExcessBlocks attribute of the PrintData object

Returns:
The removeExcessBlocks value

isSpaceAfterCast

public boolean isSpaceAfterCast()
Gets the SpaceAfterCast attribute of the PrintData object

Returns:
The SpaceAfterCast value

isSpaceAfterKeyword

public boolean isSpaceAfterKeyword()
Determines whether there should be a space between a keyword such as 'if' or 'while' and the opening brace that follows it.

Returns:
The SpaceAfterKeyword value

isSpaceAfterMethod

public boolean isSpaceAfterMethod()
Determines whether there should be a space between a method call and the opening brace that follows it.

Returns:
The SpaceAfterMethod value

isSpaceAroundOperators

public boolean isSpaceAroundOperators()
Gets the spaceAroundOperators attribute of the PrintData object

Returns:
The spaceAroundOperators value

isSpaceBeforeAt

public boolean isSpaceBeforeAt()
Determines if there should be a space between the '*' and the '@' in a javadoc comment.

Returns:
true if there should be a space

isSpaceInsideCast

public boolean isSpaceInsideCast()
Determines if there is a space inside the cast parens

Returns:
The SpaceAfterKeyword value

isThrowsOnNewline

public boolean isThrowsOnNewline()
Gets the ThrowsOnNewline attribute of the PrintData object

Returns:
The ThrowsOnNewline value

isVariablesAlignWithBlock

public boolean isVariablesAlignWithBlock()
Gets the variablesAlignWithBlock attribute of the PrintData object

Returns:
The variablesAlignWithBlock value

appendComment

public void appendComment(java.lang.String string,
                          int type)
Append a comment to the output

Parameters:
string - the input string
type - Description of Parameter

appendConstant

public void appendConstant(java.lang.String string)
Append constant to the output

Parameters:
string - the input string

appendKeyword

public void appendKeyword(java.lang.String string)
Append a keyword to the output

Parameters:
string - the input string

appendText

public void appendText(java.lang.String string)
Append text to the output

Parameters:
string - the input string

backspace

public void backspace()
Backspace


beginBlock

public void beginBlock()
Start a block


beginBlock

public void beginBlock(boolean space)
Start a block

Parameters:
space - Description of the Parameter

beginBlock

public void beginBlock(boolean space,
                       boolean newlineAfter)
Start a block

Parameters:
space - Description of Parameter
newlineAfter - Description of the Parameter

beginClass

public void beginClass()
Start a Class


beginExpression

public void beginExpression(boolean notEmpty)
Start an expression

Parameters:
notEmpty - Description of Parameter

beginEnum

public void beginEnum()
Start a Enum

Since:
JRefactory 2.7.00

beginField

public void beginField()
Start a Field


beginInterface

public void beginInterface()
Start a Interface


beginMethod

public void beginMethod()
Start a Method


classBrace

public void classBrace()
Indicates that a class's open brace is about to be formatted.


close

public void close()
Closes the output stream


consumeNewline

public boolean consumeNewline()
Consume a newline

Returns:
true when we were expecting this newline

decrCaseIndent

public void decrCaseIndent()
Description of the Method


decrIndent

public void decrIndent()
Decrement the indent by the default amount


endBlock

public void endBlock(boolean newline,
                     boolean newlineBefore)
End a block

Parameters:
newline - Description of Parameter
newlineBefore - Description of the Parameter

endBlock

public void endBlock()
End a block


endClass

public void endClass()
End a Class


endExpression

public void endExpression(boolean notEmpty)
End an expression

Parameters:
notEmpty - Description of Parameter

endEnum

public void endEnum()
End a Enum

Since:
JRefactory 2.7.00

endField

public void endField()
End a Field


endInterface

public void endInterface()
End a Interface


endMethod

public void endMethod()
End a Method


enterMethodDecl

public void enterMethodDecl()
Sets the state for being inside a method declaration. Used for lining up parameters with the method's open parenthesis.


exitMethodDecl

public void exitMethodDecl()
Indicates that we've exited a method declaration.


flush

public void flush()
Flushes the buffer


incrCaseIndent

public void incrCaseIndent()
Description of the Method


incrIndent

public void incrIndent()
Increment the indent by the default amount


indent

public void indent()
Indent the output


surpriseIndent

public void surpriseIndent()
Inserts a surprise indent

Parameters:
printData - the print data

methodBrace

public void methodBrace()
Indicates that a method's open brace is about to be formatted.


newline

public void newline()
Add a newline


popCurrentClassName

public void popCurrentClassName()
Description of the Method


popFieldSize

public void popFieldSize()
Description of the Method


pushCurrentClassName

public void pushCurrentClassName(java.lang.String name)
Description of the Method

Parameters:
name - Description of Parameter

pushFieldSize

public void pushFieldSize(FieldSize size)
Description of the Method

Parameters:
size - Description of Parameter

reset

public void reset()
Description of the Method


saveCurrentLine

public void saveCurrentLine()
Description of the Method


space

public void space()
Add a space


topFieldSize

public FieldSize topFieldSize()
Description of the Method

Returns:
Description of the Returned Value

incrIndent

protected void incrIndent(int incr)
Increment the indent

Parameters:
incr - the amount to increment the indent

getIndent

public int getIndent()
Get the indent

Returns:
the indent
Since:
JRefactory 2.7.00

lineQueueFactory

protected LineQueue lineQueueFactory(java.io.PrintWriter output)
Creates a line queue object

Parameters:
output - the output stream
Returns:
the queue

getMethodBlockStyle

public int getMethodBlockStyle()
Returns the method block style


setLineBeforeClassBody

public void setLineBeforeClassBody(boolean value)

isLineBeforeClassBody

public boolean isLineBeforeClassBody()

setLineBeforeExtends

public void setLineBeforeExtends(boolean value)

isLineBeforeExtends

public boolean isLineBeforeExtends()

setExtendsIndentation

public void setExtendsIndentation(int value)

getExtendsIndentation

public int getExtendsIndentation()

setLineBeforeImplements

public void setLineBeforeImplements(boolean value)

isLineBeforeImplements

public boolean isLineBeforeImplements()

setLineBeforeMultistatementMethodBody

public void setLineBeforeMultistatementMethodBody(boolean value)

isLineBeforeMultistatementMethodBody

public boolean isLineBeforeMultistatementMethodBody()

setImplementsIndentation

public void setImplementsIndentation(int value)

getImplementsIndentation

public int getImplementsIndentation()

setArrayInitializerIndented

public void setArrayInitializerIndented(boolean way)

isArrayInitializerIndented

public boolean isArrayInitializerIndented()

setModifierOrder

public void setModifierOrder(int value)

getModifierOrder

public int getModifierOrder()

setAlignStarsWithSlash

public void setAlignStarsWithSlash(boolean value)

isStarsAlignedWithSlash

public boolean isStarsAlignedWithSlash()

setLineupJavadocIDs

public void setLineupJavadocIDs(boolean way)

setLineupJavadocDescr

public void setLineupJavadocDescr(boolean way)

isJavadocDescriptionLinedup

public boolean isJavadocDescriptionLinedup()

getTaggedJavadocDescription

public int getTaggedJavadocDescription()

setTaggedJavadocDescription

public void setTaggedJavadocDescription(int value)

getBuffer

public java.lang.StringBuffer getBuffer()