Class JDTIdentityMapper

java.lang.Object
com.ibm.wala.cast.java.translator.jdt.JDTIdentityMapper

public class JDTIdentityMapper extends Object
Class responsible for mapping JDT type system objects representing types, methods and fields to the corresponding WALA TypeReferences, MethodReferences and FieldReferences. Used during translation and by clients to help correlate WALA analysis results to the various AST nodes.

In English: keeps a hashtable of WALA "type references", "field references", etc. which describe types, fields, etc. Creates these from their JDT equivalents and keeps the hashtable linking the two representations.

Author:
rfuhrer
  • Constructor Details

    • JDTIdentityMapper

      public JDTIdentityMapper(ClassLoaderReference clr, org.eclipse.jdt.core.dom.AST ast)
  • Method Details

    • getTypeRef

      public TypeReference getTypeRef(org.eclipse.jdt.core.dom.ITypeBinding type)
      Create (or reuse) a TypeReference for the given JDT Type Binding.
      This method canonicalizes the TypeReferences
    • typeToTypeID

      public String typeToTypeID(org.eclipse.jdt.core.dom.ITypeBinding type)
      Translates the given Polyglot type to a name suitable for use in a DOMO TypeReference (i.e. a bytecode-compliant type name).
    • anonLocalTypeToTypeID

      public String anonLocalTypeToTypeID(org.eclipse.jdt.core.dom.ITypeBinding type)
    • getFieldRef

      public FieldReference getFieldRef(org.eclipse.jdt.core.dom.IVariableBinding field)
    • fakeMethodRefNoArgs

      public MethodReference fakeMethodRefNoArgs(String key, String typeID, String metName, String returnTypeID)
    • getMethodRef

      public MethodReference getMethodRef(org.eclipse.jdt.core.dom.IMethodBinding met)