Package org.codehaus.janino
Class UnparseVisitor
java.lang.Object
org.codehaus.janino.UnparseVisitor
- All Implemented Interfaces:
Visitor.AnnotationVisitor
,Visitor.AtomVisitor
,Visitor.BlockStatementVisitor
,Visitor.ComprehensiveVisitor
,Visitor.ElementValueArrayInitializerVisitor
,Visitor.ElementValueVisitor
,Visitor.ImportVisitor
,Visitor.LvalueVisitor
,Visitor.RvalueVisitor
,Visitor.TypeBodyDeclarationVisitor
,Visitor.TypeDeclarationVisitor
,Visitor.TypeVisitor
A visitor that unparses (un-compiles) an AST to a
Writer
. See
main(String[])
for a usage example.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Flushes all generated code.static void
Testing of parsing/unparsing.static void
unparse
(Java.CompilationUnit cu, Writer w) Unparse the givenJava.CompilationUnit
to the givenWriter
.void
void
void
void
void
void
E.g.void
void
void
void
void
void
void
void
void
void
void
void
void
void
void
E.g.void
void
void
void
void
void
void
void
void
E.g.void
void
void
void
E.g.void
void
void
void
E.g.void
void
void
void
void
E.g.void
E.g.void
E.g.void
void
void
void
void
void
void
void
void
E.g.void
E.g.void
void
void
void
void
void
void
void
void
E.g.void
E.g.void
E.g.void
void
void
void
void
void
void
void
void
void
E.g.void
void
-
Constructor Details
-
UnparseVisitor
-
-
Method Details
-
main
Testing of parsing/unparsing.Reads compilation units from the files named on the command line and unparses them to
System.out
.- Throws:
Exception
-
unparse
Unparse the givenJava.CompilationUnit
to the givenWriter
. -
close
public void close()Flushes all generated code. -
unparseCompilationUnit
-
visitSingleTypeImportDeclaration
Description copied from interface:Visitor.ImportVisitor
E.g. 'import pkg.Type
'.- Specified by:
visitSingleTypeImportDeclaration
in interfaceVisitor.ImportVisitor
-
visitTypeImportOnDemandDeclaration
public void visitTypeImportOnDemandDeclaration(Java.CompilationUnit.TypeImportOnDemandDeclaration tiodd) Description copied from interface:Visitor.ImportVisitor
E.g. 'import pkg.*
'.- Specified by:
visitTypeImportOnDemandDeclaration
in interfaceVisitor.ImportVisitor
-
visitSingleStaticImportDeclaration
public void visitSingleStaticImportDeclaration(Java.CompilationUnit.SingleStaticImportDeclaration ssid) Description copied from interface:Visitor.ImportVisitor
E.g. 'import static pkg.Type.member
'.- Specified by:
visitSingleStaticImportDeclaration
in interfaceVisitor.ImportVisitor
-
visitStaticImportOnDemandDeclaration
public void visitStaticImportOnDemandDeclaration(Java.CompilationUnit.StaticImportOnDemandDeclaration siodd) Description copied from interface:Visitor.ImportVisitor
E.g. 'import static pkg.Type.*
'.- Specified by:
visitStaticImportOnDemandDeclaration
in interfaceVisitor.ImportVisitor
-
visitLocalClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitor
E.g. 'class LocalClass { ... }'.- Specified by:
visitLocalClassDeclaration
in interfaceVisitor.TypeDeclarationVisitor
-
visitMemberClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitor
E.g. 'public class TopLevelClass { public class MemberClass { ... } }'.- Specified by:
visitMemberClassDeclaration
in interfaceVisitor.TypeBodyDeclarationVisitor
- Specified by:
visitMemberClassDeclaration
in interfaceVisitor.TypeDeclarationVisitor
-
visitMemberInterfaceDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitor
E.g. 'public class TopLevelClass { public interface MemberInterface { ... } }'.- Specified by:
visitMemberInterfaceDeclaration
in interfaceVisitor.TypeBodyDeclarationVisitor
- Specified by:
visitMemberInterfaceDeclaration
in interfaceVisitor.TypeDeclarationVisitor
-
visitPackageMemberClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitor
E.g. 'public class TopLevelClass { ... }'.- Specified by:
visitPackageMemberClassDeclaration
in interfaceVisitor.TypeDeclarationVisitor
-
visitPackageMemberInterfaceDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitor
E.g. 'public TopLevelInterface { ... }'.- Specified by:
visitPackageMemberInterfaceDeclaration
in interfaceVisitor.TypeDeclarationVisitor
-
visitConstructorDeclarator
Description copied from interface:Visitor.TypeBodyDeclarationVisitor
E.g. 'public MyClass(...) { ... }'.- Specified by:
visitConstructorDeclarator
in interfaceVisitor.TypeBodyDeclarationVisitor
-
visitMethodDeclarator
Description copied from interface:Visitor.TypeBodyDeclarationVisitor
E.g. 'public void meth(...) { ... }'.- Specified by:
visitMethodDeclarator
in interfaceVisitor.TypeBodyDeclarationVisitor
-
visitFieldDeclaration
Description copied from interface:Visitor.TypeBodyDeclarationVisitor
E.g. 'public int field;'.- Specified by:
visitFieldDeclaration
in interfaceVisitor.BlockStatementVisitor
- Specified by:
visitFieldDeclaration
in interfaceVisitor.TypeBodyDeclarationVisitor
-
visitInitializer
Description copied from interface:Visitor.TypeBodyDeclarationVisitor
E.g. 'public class MyClass { static { ... } }'.- Specified by:
visitInitializer
in interfaceVisitor.BlockStatementVisitor
- Specified by:
visitInitializer
in interfaceVisitor.TypeBodyDeclarationVisitor
-
visitBlock
- Specified by:
visitBlock
in interfaceVisitor.BlockStatementVisitor
-
visitBreakStatement
- Specified by:
visitBreakStatement
in interfaceVisitor.BlockStatementVisitor
-
visitContinueStatement
- Specified by:
visitContinueStatement
in interfaceVisitor.BlockStatementVisitor
-
visitAssertStatement
- Specified by:
visitAssertStatement
in interfaceVisitor.BlockStatementVisitor
-
visitDoStatement
- Specified by:
visitDoStatement
in interfaceVisitor.BlockStatementVisitor
-
visitEmptyStatement
- Specified by:
visitEmptyStatement
in interfaceVisitor.BlockStatementVisitor
-
visitExpressionStatement
- Specified by:
visitExpressionStatement
in interfaceVisitor.BlockStatementVisitor
-
visitForStatement
- Specified by:
visitForStatement
in interfaceVisitor.BlockStatementVisitor
-
visitIfStatement
- Specified by:
visitIfStatement
in interfaceVisitor.BlockStatementVisitor
-
visitLabeledStatement
- Specified by:
visitLabeledStatement
in interfaceVisitor.BlockStatementVisitor
-
visitLocalClassDeclarationStatement
- Specified by:
visitLocalClassDeclarationStatement
in interfaceVisitor.BlockStatementVisitor
-
visitLocalVariableDeclarationStatement
- Specified by:
visitLocalVariableDeclarationStatement
in interfaceVisitor.BlockStatementVisitor
-
visitReturnStatement
- Specified by:
visitReturnStatement
in interfaceVisitor.BlockStatementVisitor
-
visitSwitchStatement
- Specified by:
visitSwitchStatement
in interfaceVisitor.BlockStatementVisitor
-
visitSynchronizedStatement
- Specified by:
visitSynchronizedStatement
in interfaceVisitor.BlockStatementVisitor
-
visitThrowStatement
- Specified by:
visitThrowStatement
in interfaceVisitor.BlockStatementVisitor
-
visitTryStatement
- Specified by:
visitTryStatement
in interfaceVisitor.BlockStatementVisitor
-
visitWhileStatement
- Specified by:
visitWhileStatement
in interfaceVisitor.BlockStatementVisitor
-
unparseVariableDeclarator
-
unparseFormalParameter
-
visitMethodInvocation
- Specified by:
visitMethodInvocation
in interfaceVisitor.RvalueVisitor
-
visitAlternateConstructorInvocation
- Specified by:
visitAlternateConstructorInvocation
in interfaceVisitor.BlockStatementVisitor
-
visitSuperConstructorInvocation
- Specified by:
visitSuperConstructorInvocation
in interfaceVisitor.BlockStatementVisitor
-
visitNewClassInstance
- Specified by:
visitNewClassInstance
in interfaceVisitor.RvalueVisitor
-
visitAssignment
- Specified by:
visitAssignment
in interfaceVisitor.RvalueVisitor
-
visitAmbiguousName
- Specified by:
visitAmbiguousName
in interfaceVisitor.LvalueVisitor
-
visitArrayAccessExpression
- Specified by:
visitArrayAccessExpression
in interfaceVisitor.LvalueVisitor
-
visitArrayLength
- Specified by:
visitArrayLength
in interfaceVisitor.RvalueVisitor
-
visitArrayType
- Specified by:
visitArrayType
in interfaceVisitor.TypeVisitor
-
visitBasicType
- Specified by:
visitBasicType
in interfaceVisitor.TypeVisitor
-
visitBinaryOperation
- Specified by:
visitBinaryOperation
in interfaceVisitor.RvalueVisitor
-
visitCast
- Specified by:
visitCast
in interfaceVisitor.RvalueVisitor
-
visitClassLiteral
- Specified by:
visitClassLiteral
in interfaceVisitor.RvalueVisitor
-
visitConditionalExpression
- Specified by:
visitConditionalExpression
in interfaceVisitor.RvalueVisitor
-
visitCrement
- Specified by:
visitCrement
in interfaceVisitor.RvalueVisitor
-
visitFieldAccess
- Specified by:
visitFieldAccess
in interfaceVisitor.LvalueVisitor
-
visitFieldAccessExpression
- Specified by:
visitFieldAccessExpression
in interfaceVisitor.LvalueVisitor
-
visitSuperclassFieldAccessExpression
- Specified by:
visitSuperclassFieldAccessExpression
in interfaceVisitor.LvalueVisitor
-
visitInstanceof
- Specified by:
visitInstanceof
in interfaceVisitor.RvalueVisitor
-
visitIntegerLiteral
- Specified by:
visitIntegerLiteral
in interfaceVisitor.RvalueVisitor
-
visitFloatingPointLiteral
- Specified by:
visitFloatingPointLiteral
in interfaceVisitor.RvalueVisitor
-
visitBooleanLiteral
- Specified by:
visitBooleanLiteral
in interfaceVisitor.RvalueVisitor
-
visitCharacterLiteral
- Specified by:
visitCharacterLiteral
in interfaceVisitor.RvalueVisitor
-
visitStringLiteral
- Specified by:
visitStringLiteral
in interfaceVisitor.RvalueVisitor
-
visitNullLiteral
- Specified by:
visitNullLiteral
in interfaceVisitor.RvalueVisitor
-
visitLocalVariableAccess
- Specified by:
visitLocalVariableAccess
in interfaceVisitor.LvalueVisitor
-
visitNewArray
- Specified by:
visitNewArray
in interfaceVisitor.RvalueVisitor
-
visitNewInitializedArray
- Specified by:
visitNewInitializedArray
in interfaceVisitor.RvalueVisitor
-
visitPackage
- Specified by:
visitPackage
in interfaceVisitor.AtomVisitor
-
visitParameterAccess
- Specified by:
visitParameterAccess
in interfaceVisitor.RvalueVisitor
-
visitQualifiedThisReference
- Specified by:
visitQualifiedThisReference
in interfaceVisitor.RvalueVisitor
-
visitReferenceType
- Specified by:
visitReferenceType
in interfaceVisitor.TypeVisitor
-
visitRvalueMemberType
- Specified by:
visitRvalueMemberType
in interfaceVisitor.TypeVisitor
-
visitSimpleType
- Specified by:
visitSimpleType
in interfaceVisitor.TypeVisitor
-
visitSuperclassMethodInvocation
- Specified by:
visitSuperclassMethodInvocation
in interfaceVisitor.RvalueVisitor
-
visitThisReference
- Specified by:
visitThisReference
in interfaceVisitor.RvalueVisitor
-
visitUnaryOperation
- Specified by:
visitUnaryOperation
in interfaceVisitor.RvalueVisitor
-
visitParenthesizedExpression
- Specified by:
visitParenthesizedExpression
in interfaceVisitor.LvalueVisitor
-
visitAnonymousClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitor
E.g. 'new Superclass() { ... }'.- Specified by:
visitAnonymousClassDeclaration
in interfaceVisitor.TypeDeclarationVisitor
-
visitNewAnonymousClassInstance
- Specified by:
visitNewAnonymousClassInstance
in interfaceVisitor.RvalueVisitor
-
visitMarkerAnnotation
- Specified by:
visitMarkerAnnotation
in interfaceVisitor.AnnotationVisitor
-
visitNormalAnnotation
- Specified by:
visitNormalAnnotation
in interfaceVisitor.AnnotationVisitor
-
visitSingleElementAnnotation
- Specified by:
visitSingleElementAnnotation
in interfaceVisitor.AnnotationVisitor
-
visitElementValueArrayInitializer
- Specified by:
visitElementValueArrayInitializer
in interfaceVisitor.ElementValueArrayInitializerVisitor
-