com.dp4j.ast
Class Resolver

java.lang.Object
  extended by com.dp4j.ast.Resolver

public class Resolver
extends Object

Author:
simpatico

Field Summary
static String dot
           
static String init
           
protected  com.sun.tools.javac.code.Symtab symTable
           
protected  Types typeUtils
           
 
Constructor Summary
Resolver(com.sun.tools.javac.model.JavacElements elementUtils, com.sun.source.util.Trees trees, com.sun.tools.javac.tree.TreeMaker tm, TypeElement encClass, Types typeUtils, com.sun.tools.javac.code.Symtab symTable, List<? extends Element> pkgClasses)
           
 
Method Summary
 com.sun.tools.javac.code.Symbol contains(Iterable<? extends Element> list, List<? extends com.sun.tools.javac.code.Type> typeParams, com.sun.tools.javac.util.Name varName, List<? extends com.sun.tools.javac.code.Type> args)
           
 com.sun.tools.javac.tree.JCTree.JCMethodInvocation forName(com.sun.tools.javac.code.Symbol accessor, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 com.sun.tools.javac.tree.JCTree.JCExpression getAccessor(com.sun.tools.javac.tree.JCTree.JCFieldAccess fa)
           
 com.sun.tools.javac.code.Symbol getAccessor(com.sun.tools.javac.tree.JCTree.JCFieldAccess fa, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 List<com.sun.tools.javac.code.Symbol> getArgs(com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> args, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 List<com.sun.tools.javac.code.Type> getArgTypes(com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> args, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 com.sun.tools.javac.code.Symbol getBoxedSymbol(com.sun.tools.javac.code.Symbol primitive)
           
 com.sun.tools.javac.code.Type getBoxedType(com.sun.tools.javac.code.Symbol s)
           
 com.sun.tools.javac.code.Type getBoxedType(com.sun.tools.javac.code.Type s)
           
 List<com.sun.tools.javac.code.Symbol> getEnclosedElements(com.sun.tools.javac.code.Symbol accessor)
           
 com.sun.tools.javac.tree.JCTree.JCExpression getInvokationExp(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 com.sun.tools.javac.code.Symbol getInvokationTarget(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 com.sun.tools.javac.util.Name getName(com.sun.tools.javac.tree.JCTree.JCExpression exp)
           
 com.sun.tools.javac.util.Name getName(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi)
           
 com.sun.tools.javac.util.Name getName(com.sun.tools.javac.util.Name className)
           
 com.sun.tools.javac.util.Name getName(String className)
           
 com.sun.tools.javac.code.Symbol getSymbol(com.sun.source.tree.CompilationUnitTree cut, Node n, com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> typeParams, com.sun.tools.javac.util.Name varName, com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> args)
           
 com.sun.tools.javac.code.Symbol getSymbol(com.sun.tools.javac.tree.JCTree.JCExpression exp, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 com.sun.tools.javac.code.Symbol.MethodSymbol getSymbol(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi, com.sun.source.tree.CompilationUnitTree cut, Node n)
          cannot handle just like a fieldAccess? No, need to strip args and params
 com.sun.tools.javac.code.Symbol getSymbol(com.sun.tools.javac.util.Name varName, com.sun.tools.javac.code.Symbol accessor, com.sun.source.tree.CompilationUnitTree cut, Node n, boolean lookingUp)
           
 com.sun.tools.javac.code.Type getType(com.sun.tools.javac.tree.JCTree.JCExpression exp, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 com.sun.tools.javac.code.Type getType(com.sun.tools.javac.tree.JCTree.JCLiteral ifExp)
           
 com.sun.tools.javac.code.Type getType(com.sun.tools.javac.code.Symbol s)
           
 com.sun.tools.javac.tree.JCTree.JCNewArray getTypedArray(com.sun.tools.javac.tree.JCTree.JCNewArray arr, com.sun.source.tree.CompilationUnitTree cut, Node n)
           
 com.sun.tools.javac.code.Symbol getTypeSymbol(com.sun.tools.javac.code.Symbol s)
           
static
<T> com.sun.tools.javac.util.List<T>
inject(T stmt, boolean before, com.sun.tools.javac.util.List<? extends T> stats, boolean skipStmt, T... newStmts)
           
static
<T> com.sun.tools.javac.util.List<T>
injectAfter(T stmt, com.sun.tools.javac.util.List<? extends T> stats, boolean skipStmt, T... newStmts)
           
static
<T> com.sun.tools.javac.util.List<T>
injectBefore(T stmt, com.sun.tools.javac.util.List<? extends T> stats, boolean skipStmt, T... newStmts)
           
 boolean sameArg(com.sun.tools.javac.code.Type actual, com.sun.tools.javac.code.Type formal)
           
 boolean sameMethod(com.sun.tools.javac.util.List<? extends com.sun.tools.javac.code.Symbol> formalArgs, List<? extends com.sun.tools.javac.code.Type> args, com.sun.tools.javac.util.List<? extends com.sun.tools.javac.code.Symbol> formalTypeParams, List<? extends com.sun.tools.javac.code.Type> typeParams, boolean varArgs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeUtils

protected final Types typeUtils

symTable

protected final com.sun.tools.javac.code.Symtab symTable

init

public static final String init
See Also:
Constant Field Values

dot

public static final String dot
See Also:
Constant Field Values
Constructor Detail

Resolver

public Resolver(com.sun.tools.javac.model.JavacElements elementUtils,
                com.sun.source.util.Trees trees,
                com.sun.tools.javac.tree.TreeMaker tm,
                TypeElement encClass,
                Types typeUtils,
                com.sun.tools.javac.code.Symtab symTable,
                List<? extends Element> pkgClasses)
Method Detail

getEnclosedElements

public List<com.sun.tools.javac.code.Symbol> getEnclosedElements(com.sun.tools.javac.code.Symbol accessor)

forName

public com.sun.tools.javac.tree.JCTree.JCMethodInvocation forName(com.sun.tools.javac.code.Symbol accessor,
                                                                  com.sun.source.tree.CompilationUnitTree cut,
                                                                  Node n)

getSymbol

public com.sun.tools.javac.code.Symbol getSymbol(com.sun.source.tree.CompilationUnitTree cut,
                                                 Node n,
                                                 com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> typeParams,
                                                 com.sun.tools.javac.util.Name varName,
                                                 com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> args)

getSymbol

public com.sun.tools.javac.code.Symbol getSymbol(com.sun.tools.javac.util.Name varName,
                                                 com.sun.tools.javac.code.Symbol accessor,
                                                 com.sun.source.tree.CompilationUnitTree cut,
                                                 Node n,
                                                 boolean lookingUp)

getSymbol

public com.sun.tools.javac.code.Symbol.MethodSymbol getSymbol(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi,
                                                              com.sun.source.tree.CompilationUnitTree cut,
                                                              Node n)
cannot handle just like a fieldAccess? No, need to strip args and params

Parameters:
mi -
cut -
n -
Returns:
the method symbol of mi

getSymbol

public com.sun.tools.javac.code.Symbol getSymbol(com.sun.tools.javac.tree.JCTree.JCExpression exp,
                                                 com.sun.source.tree.CompilationUnitTree cut,
                                                 Node n)

getAccessor

public com.sun.tools.javac.code.Symbol getAccessor(com.sun.tools.javac.tree.JCTree.JCFieldAccess fa,
                                                   com.sun.source.tree.CompilationUnitTree cut,
                                                   Node n)

getAccessor

public com.sun.tools.javac.tree.JCTree.JCExpression getAccessor(com.sun.tools.javac.tree.JCTree.JCFieldAccess fa)

getType

public com.sun.tools.javac.code.Type getType(com.sun.tools.javac.tree.JCTree.JCLiteral ifExp)

getType

public com.sun.tools.javac.code.Type getType(com.sun.tools.javac.tree.JCTree.JCExpression exp,
                                             com.sun.source.tree.CompilationUnitTree cut,
                                             Node n)

getTypedArray

public com.sun.tools.javac.tree.JCTree.JCNewArray getTypedArray(com.sun.tools.javac.tree.JCTree.JCNewArray arr,
                                                                com.sun.source.tree.CompilationUnitTree cut,
                                                                Node n)

getName

public com.sun.tools.javac.util.Name getName(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi)

getName

public com.sun.tools.javac.util.Name getName(com.sun.tools.javac.tree.JCTree.JCExpression exp)

getInvokationTarget

public com.sun.tools.javac.code.Symbol getInvokationTarget(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi,
                                                           com.sun.source.tree.CompilationUnitTree cut,
                                                           Node n)

getInvokationExp

public com.sun.tools.javac.tree.JCTree.JCExpression getInvokationExp(com.sun.tools.javac.tree.JCTree.JCMethodInvocation mi,
                                                                     com.sun.source.tree.CompilationUnitTree cut,
                                                                     Node n)

getBoxedSymbol

public com.sun.tools.javac.code.Symbol getBoxedSymbol(com.sun.tools.javac.code.Symbol primitive)

sameMethod

public boolean sameMethod(com.sun.tools.javac.util.List<? extends com.sun.tools.javac.code.Symbol> formalArgs,
                          List<? extends com.sun.tools.javac.code.Type> args,
                          com.sun.tools.javac.util.List<? extends com.sun.tools.javac.code.Symbol> formalTypeParams,
                          List<? extends com.sun.tools.javac.code.Type> typeParams,
                          boolean varArgs)

contains

public com.sun.tools.javac.code.Symbol contains(Iterable<? extends Element> list,
                                                List<? extends com.sun.tools.javac.code.Type> typeParams,
                                                com.sun.tools.javac.util.Name varName,
                                                List<? extends com.sun.tools.javac.code.Type> args)

getTypeSymbol

public com.sun.tools.javac.code.Symbol getTypeSymbol(com.sun.tools.javac.code.Symbol s)

getType

public com.sun.tools.javac.code.Type getType(com.sun.tools.javac.code.Symbol s)

getArgs

public List<com.sun.tools.javac.code.Symbol> getArgs(com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> args,
                                                     com.sun.source.tree.CompilationUnitTree cut,
                                                     Node n)

getArgTypes

public List<com.sun.tools.javac.code.Type> getArgTypes(com.sun.tools.javac.util.List<com.sun.tools.javac.tree.JCTree.JCExpression> args,
                                                       com.sun.source.tree.CompilationUnitTree cut,
                                                       Node n)

sameArg

public boolean sameArg(com.sun.tools.javac.code.Type actual,
                       com.sun.tools.javac.code.Type formal)

getBoxedType

public com.sun.tools.javac.code.Type getBoxedType(com.sun.tools.javac.code.Symbol s)

getBoxedType

public com.sun.tools.javac.code.Type getBoxedType(com.sun.tools.javac.code.Type s)

getName

public com.sun.tools.javac.util.Name getName(com.sun.tools.javac.util.Name className)

getName

public com.sun.tools.javac.util.Name getName(String className)

injectBefore

public static <T> com.sun.tools.javac.util.List<T> injectBefore(T stmt,
                                                                com.sun.tools.javac.util.List<? extends T> stats,
                                                                boolean skipStmt,
                                                                T... newStmts)

injectAfter

public static <T> com.sun.tools.javac.util.List<T> injectAfter(T stmt,
                                                               com.sun.tools.javac.util.List<? extends T> stats,
                                                               boolean skipStmt,
                                                               T... newStmts)

inject

public static <T> com.sun.tools.javac.util.List<T> inject(T stmt,
                                                          boolean before,
                                                          com.sun.tools.javac.util.List<? extends T> stats,
                                                          boolean skipStmt,
                                                          T... newStmts)


Copyright © 2011. All Rights Reserved.