Save This Page
Home » openjdk-7 » com.sun.tools » javac » tree » [javadoc | source]
com.sun.tools.javac.tree
public class: TreeMaker [javadoc | source]
java.lang.Object
   com.sun.tools.javac.tree.TreeMaker

All Implemented Interfaces:
    Factory

Factory class for trees.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Nested Class Summary:
class  TreeMaker.AnnotationBuilder   
Field Summary
protected static final  Key<TreeMaker> treeMakerKey    The context key for the tree factory. 
public  int pos    The position at which subsequent trees will be created. 
public  JCCompilationUnit toplevel    The toplevel tree to which created trees belong. 
 Names names    The current name table. 
 Types types     
 Symtab syms    The current symbol table. 
 AnnotationBuilder annotationBuilder     
Constructor:
 protected TreeMaker(Context context) 
    Create a tree maker with null toplevel and NOPOS as initial position.
 TreeMaker(JCCompilationUnit toplevel,
    Names names,
    Types types,
    Symtab syms) 
    Create a tree maker with a given toplevel and FIRSTPOS as initial position.
Method from com.sun.tools.javac.tree.TreeMaker Summary:
Annotation,   Annotation,   Annotations,   AnonymousClassDef,   App,   App,   Apply,   Assert,   Assign,   Assignment,   Assignop,   Binary,   Block,   Break,   Call,   Case,   Catch,   ClassDef,   ClassLiteral,   ClassLiteral,   Conditional,   Continue,   Create,   DoLoop,   Erroneous,   Erroneous,   Exec,   ForLoop,   ForeachLoop,   Ident,   Ident,   Ident,   Idents,   If,   Import,   Indexed,   Indexed,   Labelled,   LetExpr,   LetExpr,   Literal,   Literal,   MethodDef,   MethodDef,   MethodDef,   Modifiers,   Modifiers,   NewArray,   NewClass,   Param,   Params,   Parens,   QualIdent,   Return,   Select,   Select,   Skip,   Super,   Switch,   Synchronized,   This,   Throw,   TopLevel,   Try,   Try,   Type,   TypeApply,   TypeArray,   TypeBoundKind,   TypeCast,   TypeCast,   TypeIdent,   TypeParam,   TypeParameter,   TypeParams,   TypeTest,   TypeUnion,   Types,   Unary,   VarDef,   VarDef,   WhileLoop,   Wildcard,   at,   at,   forToplevel,   instance,   isUnqualifiable,   paramName,   typaramName
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.tree.TreeMaker Detail:
 public JCAnnotation Annotation(Attribute a) 
    Create an annotation tree from an attribute.
 public JCAnnotation Annotation(JCTree annotationType,
    List<JCExpression> args) 
 public List<JCAnnotation> Annotations(List<Compound> attributes) 
    Create annotation trees from annotations.
 public JCClassDecl AnonymousClassDef(JCModifiers mods,
    List<JCTree> defs) 
 public JCMethodInvocation App(JCExpression meth) 
    Create a no-arg method invocation from a method tree
 public JCMethodInvocation App(JCExpression meth,
    List<JCExpression> args) 
    Create a method invocation from a method tree and a list of argument trees.
 public JCMethodInvocation Apply(List<JCExpression> typeargs,
    JCExpression fn,
    List<JCExpression> args) 
 public JCAssert Assert(JCExpression cond,
    JCExpression detail) 
 public JCAssign Assign(JCExpression lhs,
    JCExpression rhs) 
 public JCStatement Assignment(Symbol v,
    JCExpression rhs) 
    Construct an assignment from a variable symbol and a right hand side.
 public JCAssignOp Assignop(int opcode,
    JCTree lhs,
    JCTree rhs) 
 public JCBinary Binary(int opcode,
    JCExpression lhs,
    JCExpression rhs) 
 public JCBlock Block(long flags,
    List<JCStatement> stats) 
 public JCBreak Break(Name label) 
 public JCStatement Call(JCExpression apply) 
    Wrap a method invocation in an expression statement or return statement, depending on whether the method invocation expression's type is void.
 public JCCase Case(JCExpression pat,
    List<JCStatement> stats) 
 public JCCatch Catch(JCVariableDecl param,
    JCBlock body) 
 public JCClassDecl ClassDef(JCModifiers mods,
    Name name,
    List<JCTypeParameter> typarams,
    JCExpression extending,
    List<JCExpression> implementing,
    List<JCTree> defs) 
 public JCExpression ClassLiteral(ClassSymbol clazz) 
    Create a tree representing a class literal.
 public JCExpression ClassLiteral(Type t) 
    Create a tree representing a class literal.
 public JCConditional Conditional(JCExpression cond,
    JCExpression thenpart,
    JCExpression elsepart) 
 public JCContinue Continue(Name label) 
 public JCExpression Create(Symbol ctor,
    List<JCExpression> args) 
    Create a method invocation from a method tree and a list of argument trees.
 public JCDoWhileLoop DoLoop(JCStatement body,
    JCExpression cond) 
 public JCErroneous Erroneous() 
 public JCErroneous Erroneous(List<JCTree> errs) 
 public JCExpressionStatement Exec(JCExpression expr) 
 public JCForLoop ForLoop(List<JCStatement> init,
    JCExpression cond,
    List<JCExpressionStatement> step,
    JCStatement body) 
 public JCEnhancedForLoop ForeachLoop(JCVariableDecl var,
    JCExpression expr,
    JCStatement body) 
 public JCIdent Ident(Name name) 
 public JCIdent Ident(Symbol sym) 
    Create an identifier from a symbol.
 public JCExpression Ident(JCVariableDecl param) 
    Create an identifier that refers to the variable declared in given variable declaration.
 public List<JCExpression> Idents(List<JCVariableDecl> params) 
    Create a list of identifiers referring to the variables declared in given list of variable declarations.
 public JCIf If(JCExpression cond,
    JCStatement thenpart,
    JCStatement elsepart) 
 public JCImport Import(JCTree qualid,
    boolean importStatic) 
 public JCArrayAccess Indexed(JCExpression indexed,
    JCExpression index) 
 public JCArrayAccess Indexed(Symbol v,
    JCExpression index) 
    Construct an index expression from a variable and an expression.
 public JCLabeledStatement Labelled(Name label,
    JCStatement body) 
 public LetExpr LetExpr(List<JCVariableDecl> defs,
    JCTree expr) 
 public LetExpr LetExpr(JCVariableDecl def,
    JCTree expr) 
 public JCLiteral Literal(Object value) 
 public JCLiteral Literal(int tag,
    Object value) 
 public JCMethodDecl MethodDef(MethodSymbol m,
    JCBlock body) 
    Create a method definition from a method symbol and a method body.
 public JCMethodDecl MethodDef(MethodSymbol m,
    Type mtype,
    JCBlock body) 
    Create a method definition from a method symbol, method type and a method body.
 public JCMethodDecl MethodDef(JCModifiers mods,
    Name name,
    JCExpression restype,
    List<JCTypeParameter> typarams,
    List<JCVariableDecl> params,
    List<JCExpression> thrown,
    JCBlock body,
    JCExpression defaultValue) 
 public JCModifiers Modifiers(long flags) 
 public JCModifiers Modifiers(long flags,
    List<JCAnnotation> annotations) 
 public JCNewArray NewArray(JCExpression elemtype,
    List<JCExpression> dims,
    List<JCExpression> elems) 
 public JCNewClass NewClass(JCExpression encl,
    List<JCExpression> typeargs,
    JCExpression clazz,
    List<JCExpression> args,
    JCClassDecl def) 
 public JCVariableDecl Param(Name name,
    Type argtype,
    Symbol owner) 
    Create a value parameter tree from its name, type, and owner.
 public List<JCVariableDecl> Params(List<Type> argtypes,
    Symbol owner) 
    Create a a list of value parameter trees x0, ..., xn from a list of their types and an their owner.
 public JCParens Parens(JCExpression expr) 
 public JCExpression QualIdent(Symbol sym) 
    Create a qualified identifier from a symbol, adding enough qualifications to make the reference unique.
 public JCReturn Return(JCExpression expr) 
 public JCFieldAccess Select(JCExpression selected,
    Name selector) 
 public JCExpression Select(JCExpression base,
    Symbol sym) 
    Create a selection node from a qualifier tree and a symbol.
 public JCSkip Skip() 
 public JCIdent Super(Type t,
    TypeSymbol owner) 
    Create a tree representing `super', given its type and owner.
 public JCSwitch Switch(JCExpression selector,
    List<JCCase> cases) 
 public JCSynchronized Synchronized(JCExpression lock,
    JCBlock body) 
 public JCExpression This(Type t) 
    Create a tree representing `this', given its type.
 public JCThrow Throw(JCTree expr) 
 public JCCompilationUnit TopLevel(List<JCAnnotation> packageAnnotations,
    JCExpression pid,
    List<JCTree> defs) 
    Create given tree node at current position.
 public JCTry Try(JCBlock body,
    List<JCCatch> catchers,
    JCBlock finalizer) 
 public JCTry Try(List<JCTree> resources,
    JCBlock body,
    List<JCCatch> catchers,
    JCBlock finalizer) 
 public JCExpression Type(Type t) 
    Create a tree representing given type.
 public JCTypeApply TypeApply(JCExpression clazz,
    List<JCExpression> arguments) 
 public JCArrayTypeTree TypeArray(JCExpression elemtype) 
 public TypeBoundKind TypeBoundKind(BoundKind kind) 
 public JCTypeCast TypeCast(JCTree clazz,
    JCExpression expr) 
 public JCTypeCast TypeCast(Type type,
    JCExpression expr) 
    Make an attributed type cast expression.
 public JCPrimitiveTypeTree TypeIdent(int typetag) 
 public JCTypeParameter TypeParam(Name name,
    TypeVar tvar) 
    Create a type parameter tree from its name and type.
 public JCTypeParameter TypeParameter(Name name,
    List<JCExpression> bounds) 
 public List<JCTypeParameter> TypeParams(List<Type> typarams) 
    Create a list of type parameter trees from a list of type variables.
 public JCInstanceOf TypeTest(JCExpression expr,
    JCTree clazz) 
 public JCTypeUnion TypeUnion(List<JCExpression> components) 
 public List<JCExpression> Types(List<Type> ts) 
    Create a list of trees representing given list of types.
 public JCUnary Unary(int opcode,
    JCExpression arg) 
 public JCVariableDecl VarDef(VarSymbol v,
    JCExpression init) 
    Create a variable definition from a variable symbol and an initializer expression.
 public JCVariableDecl VarDef(JCModifiers mods,
    Name name,
    JCExpression vartype,
    JCExpression init) 
 public JCWhileLoop WhileLoop(JCExpression cond,
    JCStatement body) 
 public JCWildcard Wildcard(TypeBoundKind kind,
    JCTree type) 
 public TreeMaker at(int pos) 
    Reassign current position.
 public TreeMaker at(DiagnosticPosition pos) 
    Reassign current position.
 public TreeMaker forToplevel(JCCompilationUnit toplevel) 
    Create a new tree maker for a given toplevel.
 public static TreeMaker instance(Context context) 
    Get the TreeMaker instance.
 boolean isUnqualifiable(Symbol sym) 
    Can given symbol be referred to in unqualified form?
 public Name paramName(int i) 
    The name of synthetic parameter number `i'.
 public Name typaramName(int i) 
    The name of synthetic type parameter number `i'.