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
String
JAVA_FILE_EXTENSION
Java file extension (.java).
final
public
static
String
JAVA_PACKAGE_DECLARATION
Package declaration file name.
public
Printingcontext
context
The printing context.
Environment
env
int
line
Map
<
Integer
,
Integer
>
lineNumberMapping
Constructor Summary
public
DefaultJavaPrettyPrinter
(
Environment
env)
Creates a new code generator visitor.
Method Summary
public
void
calculate
(
CompilationUnit
sourceCompilationUnit,
List
<
CtSimpleType
<?>> types)
public
DefaultJavaPrettyPrinter
decTab
()
Decrements the current number of tabs.
protected
void
enterCtExpression
(
CtExpression
> e)
Enters an expression.
protected
void
enterCtStatement
(
CtStatement
s)
Enters a statement.
protected
void
exitCtExpression
(
CtExpression
> e)
Exits an expression.
public
Collection
<
CtTypeReference
<?>>
getImports
()
Gets the imports.
public
Map
<
Integer
,
Integer
>
getLineNumberMapping
()
public
String
getPackageDeclaration
()
public
StringBuffer
getResult
()
public
DefaultJavaPrettyPrinter
incTab
()
Increments the current number of tabs.
public
void
makeImports
(
CtSimpleType
> type)
Make the imports for a given type.
protected
void
postWriteUnaryOperator
(
UnaryOperatorKind
o)
Write a post unary operator.
void
preWriteUnaryOperator
(
UnaryOperatorKind
o)
Write a pre unary operator.
public
static
String
quote
(
String
s)
Quotes a string.
protected
DefaultJavaPrettyPrinter
removeLastChar
()
Removes the last non-white charater.
public
void
reset
()
public
DefaultJavaPrettyPrinter
scan
(
CtElement
e)
The generic scan method for an element.
public
DefaultJavaPrettyPrinter
scan
(
CtReference
ref)
The generic scan method for a reference.
public
DefaultJavaPrettyPrinter
setTabCount
(int tabCount)
Sets the current number of tabs.
public
String
toString
()
Gets the currently pretty-printed string.
public
void
visitCtAnnotation
(
CtAnnotation
<A> annotation)
public
void
visitCtAnnotationType
(
CtAnnotationType
<A> annotationType)
public
void
visitCtAnonymousExecutable
(
CtAnonymousExecutable
impl)
public
void
visitCtArrayAccess
(
CtArrayAccess
<T, E> arrayAccess)
public
void
visitCtArrayTypeReference
(
CtArrayTypeReference
<T> reference)
public
void
visitCtAssert
(
CtAssert
<T> asserted)
public
void
visitCtAssignment
(
CtAssignment
<T, A> assignement)
public
void
visitCtBinaryOperator
(
CtBinaryOperator
<T> operator)
public
void
visitCtBlock
(
CtBlock
<R> block)
public
void
visitCtBreak
(
CtBreak
breakStatement)
public
void
visitCtCase
(
CtCase
<E> caseStatement)
public
void
visitCtCatch
(
CtCatch
catchBlock)
public
void
visitCtClass
(
CtClass
<T> ctClass)
public
void
visitCtCodeSnippetExpression
(
CtCodeSnippetExpression
<T> expression)
public
void
visitCtCodeSnippetStatement
(
CtCodeSnippetStatement
statement)
public
void
visitCtConditional
(
CtConditional
<T> conditional)
public
void
visitCtConstructor
(
CtConstructor
<T> c)
public
void
visitCtContinue
(
CtContinue
continueStatement)
public
void
visitCtDo
(
CtDo
doLoop)
public
void
visitCtEnum
(
CtEnum
<T> ctEnum)
public
void
visitCtExecutableReference
(
CtExecutableReference
<T> reference)
public
void
visitCtField
(
CtField
<T> f)
public
void
visitCtFieldAccess
(
CtFieldAccess
<T> fieldAccess)
public
void
visitCtFieldReference
(
CtFieldReference
<T> reference)
public
void
visitCtFor
(
CtFor
forLoop)
public
void
visitCtForEach
(
CtForEach
foreach)
public
void
visitCtIf
(
CtIf
ifElement)
public
void
visitCtInterface
(
CtInterface
<T> intrface)
public
void
visitCtInvocation
(
CtInvocation
<T> invocation)
public
void
visitCtLiteral
(
CtLiteral
<T> literal)
public
void
visitCtLocalVariable
(
CtLocalVariable
<T> localVariable)
public
void
visitCtLocalVariableReference
(
CtLocalVariableReference
<T> reference)
public
void
visitCtMethod
(
CtMethod
<T> m)
public
void
visitCtNamedElement
(
CtNamedElement
e)
public
void
visitCtNewArray
(
CtNewArray
<T> newArray)
public
void
visitCtNewClass
(
CtNewClass
<T> newClass)
public
void
visitCtOperatorAssignement
(
CtOperatorAssignment
<T, A> assignment)
public
void
visitCtPackage
(
CtPackage
ctPackage)
public
void
visitCtPackageReference
(
CtPackageReference
reference)
public
void
visitCtParameter
(
CtParameter
<T> parameter)
public
void
visitCtParameterReference
(
CtParameterReference
<T> reference)
public
void
visitCtReturn
(
CtReturn
<R> returnStatement)
void
visitCtSimpleType
(
CtSimpleType
<T> type)
public
void
visitCtStatementList
(
CtStatementList
<R> statements)
public
void
visitCtSwitch
(
CtSwitch
<E> switchStatement)
public
void
visitCtSynchronized
(
CtSynchronized
synchro)
public
void
visitCtThrow
(
CtThrow
throwStatement)
public
void
visitCtTry
(
CtTry
tryBlock)
void
visitCtType
(
CtType
<T> type)
public
void
visitCtTypeParameter
(
CtTypeParameter
typeParameter)
public
void
visitCtTypeParameterReference
(
CtTypeParameterReference
ref)
public
void
visitCtTypeReference
(
CtTypeReference
<T> ref)
public
void
visitCtUnaryOperator
(
CtUnaryOperator
<T> operator)
public
void
visitCtVariableAccess
(
CtVariableAccess
<T> variableAccess)
public
void
visitCtWhile
(
CtWhile
whileLoop)
public
DefaultJavaPrettyPrinter
write
(
String
s)
Generates a string.
public
DefaultJavaPrettyPrinter
writeAnnotationElement
(
Object
value)
Writes an annotation element.
public
DefaultJavaPrettyPrinter
writeAnnotations
(
CtElement
e)
Writes the annotations for the given element.
public
DefaultJavaPrettyPrinter
writeExecutableParameters
(
CtExecutable
> e)
public
DefaultJavaPrettyPrinter
writeExtendsClause
(
CtClass
> c)
public
DefaultJavaPrettyPrinter
writeGenericsParameter
(
Collection
<
CtTypeReference
<?>> params)
Writes a generics parameter.
public
DefaultJavaPrettyPrinter
writeHeader
(
List
<
CtSimpleType
<?>> types)
Write the compilation unit header.
public
DefaultJavaPrettyPrinter
writeImplementsClause
(
CtType
> t)
public
DefaultJavaPrettyPrinter
writeLocalVariable
(
CtLocalVariable
<T> localVariable)
public
DefaultJavaPrettyPrinter
writeModifiers
(
CtModifiable
m)
public
DefaultJavaPrettyPrinter
writeOperator
(
BinaryOperatorKind
o)
Writes a binary operator.
protected
void
writeParameters
(
Collection
<
CtTypeReference
<?>> params)
Write some parameters.
protected
void
writeStatement
(
CtStatement
e)
Writes a statement.
public
DefaultJavaPrettyPrinter
writeTabs
()
public
DefaultJavaPrettyPrinter
writeThrowsClause
(
CtExecutable
> e)
public
DefaultJavaPrettyPrinter
writeTypeReference
(
CtTypeReference
> t)
public
DefaultJavaPrettyPrinter
writeln
()
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.