Class JDTIdentityMapper


  • public class JDTIdentityMapper
    extends java.lang.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.

    • Constructor Summary

      Constructors 
      Constructor Description
      JDTIdentityMapper​(com.ibm.wala.types.ClassLoaderReference clr, org.eclipse.jdt.core.dom.AST ast)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String anonLocalTypeToTypeID​(org.eclipse.jdt.core.dom.ITypeBinding type)  
      com.ibm.wala.types.MethodReference fakeMethodRefNoArgs​(java.lang.String key, java.lang.String typeID, java.lang.String metName, java.lang.String returnTypeID)  
      com.ibm.wala.types.FieldReference getFieldRef​(org.eclipse.jdt.core.dom.IVariableBinding field)  
      com.ibm.wala.types.MethodReference getMethodRef​(org.eclipse.jdt.core.dom.IMethodBinding met)  
      com.ibm.wala.types.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
      java.lang.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JDTIdentityMapper

        public JDTIdentityMapper​(com.ibm.wala.types.ClassLoaderReference clr,
                                 org.eclipse.jdt.core.dom.AST ast)
    • Method Detail

      • getTypeRef

        public com.ibm.wala.types.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 java.lang.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 java.lang.String anonLocalTypeToTypeID​(org.eclipse.jdt.core.dom.ITypeBinding type)
      • getFieldRef

        public com.ibm.wala.types.FieldReference getFieldRef​(org.eclipse.jdt.core.dom.IVariableBinding field)
      • fakeMethodRefNoArgs

        public com.ibm.wala.types.MethodReference fakeMethodRefNoArgs​(java.lang.String key,
                                                                      java.lang.String typeID,
                                                                      java.lang.String metName,
                                                                      java.lang.String returnTypeID)
      • getMethodRef

        public com.ibm.wala.types.MethodReference getMethodRef​(org.eclipse.jdt.core.dom.IMethodBinding met)