Java Doc for DefaultJavaPrettyPrinter.java in  » Code-Analyzer » Spoon » spoon » reflect » visitor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » Spoon » spoon.reflect.visitor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   spoon.reflect.visitor.DefaultJavaPrettyPrinter

DefaultJavaPrettyPrinter
public class DefaultJavaPrettyPrinter implements CtVisitor,PrettyPrinter(Code)
A visitor for generating Java code from the program compile-time metamodel.


Field Summary
final public static  StringJAVA_FILE_EXTENSION
     Java file extension (.java).
final public static  StringJAVA_PACKAGE_DECLARATION
     Package declaration file name.
public  Printingcontextcontext
     The printing context.
 Environmentenv
    
 intline
    
 Map<Integer, Integer>lineNumberMapping
    

Constructor Summary
public  DefaultJavaPrettyPrinter(Environment env)
     Creates a new code generator visitor.

Method Summary
public  voidcalculate(CompilationUnit sourceCompilationUnit, List<CtSimpleType<?>> types)
    
public  DefaultJavaPrettyPrinterdecTab()
     Decrements the current number of tabs.
protected  voidenterCtExpression(CtExpression e)
     Enters an expression.
protected  voidenterCtStatement(CtStatement s)
     Enters a statement.
protected  voidexitCtExpression(CtExpression e)
     Exits an expression.
public  Collection<CtTypeReference<?>>getImports()
     Gets the imports.
public  Map<Integer, Integer>getLineNumberMapping()
    
public  StringgetPackageDeclaration()
    
public  StringBuffergetResult()
    
public  DefaultJavaPrettyPrinterincTab()
     Increments the current number of tabs.
public  voidmakeImports(CtSimpleType type)
     Make the imports for a given type.
protected  voidpostWriteUnaryOperator(UnaryOperatorKind o)
     Write a post unary operator.
 voidpreWriteUnaryOperator(UnaryOperatorKind o)
     Write a pre unary operator.
public static  Stringquote(String s)
     Quotes a string.
protected  DefaultJavaPrettyPrinterremoveLastChar()
     Removes the last non-white charater.
public  voidreset()
    
public  DefaultJavaPrettyPrinterscan(CtElement e)
     The generic scan method for an element.
public  DefaultJavaPrettyPrinterscan(CtReference ref)
     The generic scan method for a reference.
public  DefaultJavaPrettyPrintersetTabCount(int tabCount)
     Sets the current number of tabs.
public  StringtoString()
     Gets the currently pretty-printed string.
public  voidvisitCtAnnotation(CtAnnotation<A> annotation)
    
public  voidvisitCtAnnotationType(CtAnnotationType<A> annotationType)
    
public  voidvisitCtAnonymousExecutable(CtAnonymousExecutable impl)
    
public  voidvisitCtArrayAccess(CtArrayAccess<T, E> arrayAccess)
    
public  voidvisitCtArrayTypeReference(CtArrayTypeReference<T> reference)
    
public  voidvisitCtAssert(CtAssert<T> asserted)
    
public  voidvisitCtAssignment(CtAssignment<T, A> assignement)
    
public  voidvisitCtBinaryOperator(CtBinaryOperator<T> operator)
    
public  voidvisitCtBlock(CtBlock<R> block)
    
public  voidvisitCtBreak(CtBreak breakStatement)
    
public  voidvisitCtCase(CtCase<E> caseStatement)
    
public  voidvisitCtCatch(CtCatch catchBlock)
    
public  voidvisitCtClass(CtClass<T> ctClass)
    
public  voidvisitCtCodeSnippetExpression(CtCodeSnippetExpression<T> expression)
    
public  voidvisitCtCodeSnippetStatement(CtCodeSnippetStatement statement)
    
public  voidvisitCtConditional(CtConditional<T> conditional)
    
public  voidvisitCtConstructor(CtConstructor<T> c)
    
public  voidvisitCtContinue(CtContinue continueStatement)
    
public  voidvisitCtDo(CtDo doLoop)
    
public  voidvisitCtEnum(CtEnum<T> ctEnum)
    
public  voidvisitCtExecutableReference(CtExecutableReference<T> reference)
    
public  voidvisitCtField(CtField<T> f)
    
public  voidvisitCtFieldAccess(CtFieldAccess<T> fieldAccess)
    
public  voidvisitCtFieldReference(CtFieldReference<T> reference)
    
public  voidvisitCtFor(CtFor forLoop)
    
public  voidvisitCtForEach(CtForEach foreach)
    
public  voidvisitCtIf(CtIf ifElement)
    
public  voidvisitCtInterface(CtInterface<T> intrface)
    
public  voidvisitCtInvocation(CtInvocation<T> invocation)
    
public  voidvisitCtLiteral(CtLiteral<T> literal)
    
public  voidvisitCtLocalVariable(CtLocalVariable<T> localVariable)
    
public  voidvisitCtLocalVariableReference(CtLocalVariableReference<T> reference)
    
public  voidvisitCtMethod(CtMethod<T> m)
    
public  voidvisitCtNamedElement(CtNamedElement e)
    
public  voidvisitCtNewArray(CtNewArray<T> newArray)
    
public  voidvisitCtNewClass(CtNewClass<T> newClass)
    
public  voidvisitCtOperatorAssignement(CtOperatorAssignment<T, A> assignment)
    
public  voidvisitCtPackage(CtPackage ctPackage)
    
public  voidvisitCtPackageReference(CtPackageReference reference)
    
public  voidvisitCtParameter(CtParameter<T> parameter)
    
public  voidvisitCtParameterReference(CtParameterReference<T> reference)
    
public  voidvisitCtReturn(CtReturn<R> returnStatement)
    
 voidvisitCtSimpleType(CtSimpleType<T> type)
    
public  voidvisitCtStatementList(CtStatementList<R> statements)
    
public  voidvisitCtSwitch(CtSwitch<E> switchStatement)
    
public  voidvisitCtSynchronized(CtSynchronized synchro)
    
public  voidvisitCtThrow(CtThrow throwStatement)
    
public  voidvisitCtTry(CtTry tryBlock)
    
 voidvisitCtType(CtType<T> type)
    
public  voidvisitCtTypeParameter(CtTypeParameter typeParameter)
    
public  voidvisitCtTypeParameterReference(CtTypeParameterReference ref)
    
public  voidvisitCtTypeReference(CtTypeReference<T> ref)
    
public  voidvisitCtUnaryOperator(CtUnaryOperator<T> operator)
    
public  voidvisitCtVariableAccess(CtVariableAccess<T> variableAccess)
    
public  voidvisitCtWhile(CtWhile whileLoop)
    
public  DefaultJavaPrettyPrinterwrite(String s)
     Generates a string.
public  DefaultJavaPrettyPrinterwriteAnnotationElement(Object value)
     Writes an annotation element.
public  DefaultJavaPrettyPrinterwriteAnnotations(CtElement e)
     Writes the annotations for the given element.
public  DefaultJavaPrettyPrinterwriteExecutableParameters(CtExecutable e)
    
public  DefaultJavaPrettyPrinterwriteExtendsClause(CtClass c)
    
public  DefaultJavaPrettyPrinterwriteGenericsParameter(Collection<CtTypeReference<?>> params)
     Writes a generics parameter.
public  DefaultJavaPrettyPrinterwriteHeader(List<CtSimpleType<?>> types)
     Write the compilation unit header.
public  DefaultJavaPrettyPrinterwriteImplementsClause(CtType t)
    
public  DefaultJavaPrettyPrinterwriteLocalVariable(CtLocalVariable<T> localVariable)
    
public  DefaultJavaPrettyPrinterwriteModifiers(CtModifiable m)
    
public  DefaultJavaPrettyPrinterwriteOperator(BinaryOperatorKind o)
     Writes a binary operator.
protected  voidwriteParameters(Collection<CtTypeReference<?>> params)
     Write some parameters.
protected  voidwriteStatement(CtStatement e)
     Writes a statement.
public  DefaultJavaPrettyPrinterwriteTabs()
    
public  DefaultJavaPrettyPrinterwriteThrowsClause(CtExecutable e)
    
public  DefaultJavaPrettyPrinterwriteTypeReference(CtTypeReference t)
    
public  DefaultJavaPrettyPrinterwriteln()
     Generates a new line starting with the current number of tabs.

Field Detail
JAVA_FILE_EXTENSION
final public static String JAVA_FILE_EXTENSION(Code)
Java file extension (.java).



JAVA_PACKAGE_DECLARATION
final public static String JAVA_PACKAGE_DECLARATION(Code)
Package declaration file name.



context
public Printingcontext context(Code)
The printing context.



env
Environment env(Code)



line
int line(Code)



lineNumberMapping
Map<Integer, Integer> lineNumberMapping(Code)




Constructor Detail
DefaultJavaPrettyPrinter
public DefaultJavaPrettyPrinter(Environment env)(Code)
Creates a new code generator visitor.




Method Detail
calculate
public void calculate(CompilationUnit sourceCompilationUnit, List<CtSimpleType<?>> types)(Code)



decTab
public DefaultJavaPrettyPrinter decTab()(Code)
Decrements the current number of tabs.



enterCtExpression
protected void enterCtExpression(CtExpression e)(Code)
Enters an expression.



enterCtStatement
protected void enterCtStatement(CtStatement s)(Code)
Enters a statement.



exitCtExpression
protected void exitCtExpression(CtExpression e)(Code)
Exits an expression.



getImports
public Collection<CtTypeReference<?>> getImports()(Code)
Gets the imports.



getLineNumberMapping
public Map<Integer, Integer> getLineNumberMapping()(Code)



getPackageDeclaration
public String getPackageDeclaration()(Code)



getResult
public StringBuffer getResult()(Code)



incTab
public DefaultJavaPrettyPrinter incTab()(Code)
Increments the current number of tabs.



makeImports
public void makeImports(CtSimpleType type)(Code)
Make the imports for a given type.



postWriteUnaryOperator
protected void postWriteUnaryOperator(UnaryOperatorKind o)(Code)
Write a post unary operator.



preWriteUnaryOperator
void preWriteUnaryOperator(UnaryOperatorKind o)(Code)
Write a pre unary operator.



quote
public static String quote(String s)(Code)
Quotes a string.



removeLastChar
protected DefaultJavaPrettyPrinter removeLastChar()(Code)
Removes the last non-white charater.



reset
public void reset()(Code)



scan
public DefaultJavaPrettyPrinter scan(CtElement e)(Code)
The generic scan method for an element.



scan
public DefaultJavaPrettyPrinter scan(CtReference ref)(Code)
The generic scan method for a reference.



setTabCount
public DefaultJavaPrettyPrinter setTabCount(int tabCount)(Code)
Sets the current number of tabs.



toString
public String toString()(Code)
Gets the currently pretty-printed string.



visitCtAnnotation
public void visitCtAnnotation(CtAnnotation<A> annotation)(Code)



visitCtAnnotationType
public void visitCtAnnotationType(CtAnnotationType<A> annotationType)(Code)



visitCtAnonymousExecutable
public void visitCtAnonymousExecutable(CtAnonymousExecutable impl)(Code)



visitCtArrayAccess
public void visitCtArrayAccess(CtArrayAccess<T, E> arrayAccess)(Code)



visitCtArrayTypeReference
public void visitCtArrayTypeReference(CtArrayTypeReference<T> reference)(Code)



visitCtAssert
public void visitCtAssert(CtAssert<T> asserted)(Code)



visitCtAssignment
public void visitCtAssignment(CtAssignment<T, A> assignement)(Code)



visitCtBinaryOperator
public void visitCtBinaryOperator(CtBinaryOperator<T> operator)(Code)



visitCtBlock
public void visitCtBlock(CtBlock<R> block)(Code)



visitCtBreak
public void visitCtBreak(CtBreak breakStatement)(Code)



visitCtCase
public void visitCtCase(CtCase<E> caseStatement)(Code)



visitCtCatch
public void visitCtCatch(CtCatch catchBlock)(Code)



visitCtClass
public void visitCtClass(CtClass<T> ctClass)(Code)



visitCtCodeSnippetExpression
public void visitCtCodeSnippetExpression(CtCodeSnippetExpression<T> expression)(Code)



visitCtCodeSnippetStatement
public void visitCtCodeSnippetStatement(CtCodeSnippetStatement statement)(Code)



visitCtConditional
public void visitCtConditional(CtConditional<T> conditional)(Code)



visitCtConstructor
public void visitCtConstructor(CtConstructor<T> c)(Code)



visitCtContinue
public void visitCtContinue(CtContinue continueStatement)(Code)



visitCtDo
public void visitCtDo(CtDo doLoop)(Code)



visitCtEnum
public void visitCtEnum(CtEnum<T> ctEnum)(Code)



visitCtExecutableReference
public void visitCtExecutableReference(CtExecutableReference<T> reference)(Code)



visitCtField
public void visitCtField(CtField<T> f)(Code)



visitCtFieldAccess
public void visitCtFieldAccess(CtFieldAccess<T> fieldAccess)(Code)



visitCtFieldReference
public void visitCtFieldReference(CtFieldReference<T> reference)(Code)



visitCtFor
public void visitCtFor(CtFor forLoop)(Code)



visitCtForEach
public void visitCtForEach(CtForEach foreach)(Code)



visitCtIf
public void visitCtIf(CtIf ifElement)(Code)



visitCtInterface
public void visitCtInterface(CtInterface<T> intrface)(Code)



visitCtInvocation
public void visitCtInvocation(CtInvocation<T> invocation)(Code)



visitCtLiteral
public void visitCtLiteral(CtLiteral<T> literal)(Code)



visitCtLocalVariable
public void visitCtLocalVariable(CtLocalVariable<T> localVariable)(Code)



visitCtLocalVariableReference
public void visitCtLocalVariableReference(CtLocalVariableReference<T> reference)(Code)



visitCtMethod
public void visitCtMethod(CtMethod<T> m)(Code)



visitCtNamedElement
public void visitCtNamedElement(CtNamedElement e)(Code)



visitCtNewArray
public void visitCtNewArray(CtNewArray<T> newArray)(Code)



visitCtNewClass
public void visitCtNewClass(CtNewClass<T> newClass)(Code)



visitCtOperatorAssignement
public void visitCtOperatorAssignement(CtOperatorAssignment<T, A> assignment)(Code)



visitCtPackage
public void visitCtPackage(CtPackage ctPackage)(Code)



visitCtPackageReference
public void visitCtPackageReference(CtPackageReference reference)(Code)



visitCtParameter
public void visitCtParameter(CtParameter<T> parameter)(Code)



visitCtParameterReference
public void visitCtParameterReference(CtParameterReference<T> reference)(Code)



visitCtReturn
public void visitCtReturn(CtReturn<R> returnStatement)(Code)



visitCtSimpleType
void visitCtSimpleType(CtSimpleType<T> type)(Code)



visitCtStatementList
public void visitCtStatementList(CtStatementList<R> statements)(Code)



visitCtSwitch
public void visitCtSwitch(CtSwitch<E> switchStatement)(Code)



visitCtSynchronized
public void visitCtSynchronized(CtSynchronized synchro)(Code)



visitCtThrow
public void visitCtThrow(CtThrow throwStatement)(Code)



visitCtTry
public void visitCtTry(CtTry tryBlock)(Code)



visitCtType
void visitCtType(CtType<T> type)(Code)



visitCtTypeParameter
public void visitCtTypeParameter(CtTypeParameter typeParameter)(Code)



visitCtTypeParameterReference
public void visitCtTypeParameterReference(CtTypeParameterReference ref)(Code)



visitCtTypeReference
public void visitCtTypeReference(CtTypeReference<T> ref)(Code)



visitCtUnaryOperator
public void visitCtUnaryOperator(CtUnaryOperator<T> operator)(Code)



visitCtVariableAccess
public void visitCtVariableAccess(CtVariableAccess<T> variableAccess)(Code)



visitCtWhile
public void visitCtWhile(CtWhile whileLoop)(Code)



write
public DefaultJavaPrettyPrinter write(String s)(Code)
Generates a string.



writeAnnotationElement
public DefaultJavaPrettyPrinter writeAnnotationElement(Object value)(Code)
Writes an annotation element.



writeAnnotations
public DefaultJavaPrettyPrinter writeAnnotations(CtElement e)(Code)
Writes the annotations for the given element.



writeExecutableParameters
public DefaultJavaPrettyPrinter writeExecutableParameters(CtExecutable e)(Code)



writeExtendsClause
public DefaultJavaPrettyPrinter writeExtendsClause(CtClass c)(Code)



writeGenericsParameter
public DefaultJavaPrettyPrinter writeGenericsParameter(Collection<CtTypeReference<?>> params)(Code)
Writes a generics parameter.



writeHeader
public DefaultJavaPrettyPrinter writeHeader(List<CtSimpleType<?>> types)(Code)
Write the compilation unit header.



writeImplementsClause
public DefaultJavaPrettyPrinter writeImplementsClause(CtType t)(Code)



writeLocalVariable
public DefaultJavaPrettyPrinter writeLocalVariable(CtLocalVariable<T> localVariable)(Code)



writeModifiers
public DefaultJavaPrettyPrinter writeModifiers(CtModifiable m)(Code)



writeOperator
public DefaultJavaPrettyPrinter writeOperator(BinaryOperatorKind o)(Code)
Writes a binary operator.



writeParameters
protected void writeParameters(Collection<CtTypeReference<?>> params)(Code)
Write some parameters.



writeStatement
protected void writeStatement(CtStatement e)(Code)
Writes a statement.



writeTabs
public DefaultJavaPrettyPrinter writeTabs()(Code)



writeThrowsClause
public DefaultJavaPrettyPrinter writeThrowsClause(CtExecutable e)(Code)



writeTypeReference
public DefaultJavaPrettyPrinter writeTypeReference(CtTypeReference t)(Code)



writeln
public DefaultJavaPrettyPrinter writeln()(Code)
Generates a new line starting with the current number of tabs.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.