org.aspectj.ajdt.internal.compiler.lookup
Class EclipseFactory

java.lang.Object
  extended by org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory

public class EclipseFactory
extends java.lang.Object


Field Summary
static boolean DEBUG
           
static int debug_mungerCount
           
 java.util.List<ConcreteTypeMunger> finishedTypeMungers
           
 PushinCollector pushinCollector
           
 
Constructor Summary
EclipseFactory(LookupEnvironment lookupEnvironment, AjBuildManager buildManager)
           
EclipseFactory(LookupEnvironment lookupEnvironment, World world, boolean xSer)
           
 
Method Summary
 void addSourceTypeBinding(SourceTypeBinding binding, CompilationUnitDeclaration unit)
           
 void addTypeBinding(TypeBinding binding)
           
 void addTypeBindingAndStoreInWorld(TypeBinding binding)
           
 boolean areTypeMungersFinished()
           
static ASTNode astForLocation(IHasPosition location)
           
 void cleanup()
           
 SyntheticFieldBinding createSyntheticFieldBinding(SourceTypeBinding owningType, ResolvedMember member)
          Build a new Eclipse SyntheticFieldBinding for an AspectJ ResolvedMember.
 void finishedCompilationUnit(CompilationUnitDeclaration unit)
           
 void finishTypeMungers()
           
 TypeVariableDeclaringElement fromBinding(Binding declaringElement)
           
 ResolvedMember fromBinding(MethodBinding binding)
           
 UnresolvedType fromBinding(TypeBinding binding)
          Some generics notes: Andy 6-May-05 We were having trouble with parameterized types in a couple of places - due to TypeVariableBindings.
 UnresolvedType[] fromBindings(TypeBinding[] bindings)
           
 ResolvedType fromEclipse(ReferenceBinding binding)
           
 ResolvedType[] fromEclipse(ReferenceBinding[] bindings)
           
static EclipseFactory fromLookupEnvironment(LookupEnvironment env)
           
static EclipseFactory fromScopeLookupEnvironment(Scope scope)
           
 ResolvedType fromTypeBindingToRTX(TypeBinding tb)
           
 java.util.List<DeclareAnnotation> getDeclareAnnotationOnFields()
           
 java.util.List<DeclareAnnotation> getDeclareAnnotationOnMethods()
           
 java.util.List<DeclareAnnotation> getDeclareAnnotationOnTypes()
           
 java.util.List<DeclareParents> getDeclareParents()
           
 int getItdVersion()
           
 LookupEnvironment getLookupEnvironment()
           
static java.lang.String getName(TypeBinding binding)
           
 java.util.List<ConcreteTypeMunger> getTypeMungers()
           
 World getWorld()
           
 FieldBinding internalMakeFieldBinding(ResolvedMember member, java.util.List aliases)
          Take a normal AJ member and convert it into an eclipse fieldBinding.
 MethodBinding internalMakeMethodBinding(ResolvedMember member, java.util.List aliases)
           
 MethodBinding internalMakeMethodBinding(ResolvedMember member, java.util.List aliases, UnresolvedType aliasTargetType)
          Take a normal AJ member and convert it into an eclipse methodBinding.
 boolean isXSerializableAspects()
           
 EclipseTypeMunger makeEclipseTypeMunger(ConcreteTypeMunger concrete)
           
 FieldBinding makeFieldBinding(NewFieldTypeMunger nftm)
           
 FieldBinding makeFieldBinding(ResolvedMember member)
          Convert a resolvedmember into an eclipse field binding
 FieldBinding makeFieldBinding(ResolvedMember member, java.util.List aliases)
          Convert a resolvedmember into an eclipse field binding
 MethodBinding makeMethodBinding(NewMethodTypeMunger nmtm)
           
 MethodBinding makeMethodBinding(ResolvedMember member)
          Convert a resolvedmember into an eclipse method binding.
 MethodBinding makeMethodBinding(ResolvedMember member, java.util.List aliases)
          Convert a resolvedmember into an eclipse method binding.
 MethodBinding makeMethodBinding(ResolvedMember member, java.util.List aliases, UnresolvedType aliasTargetType)
          Creates a method binding for a resolvedmember taking into account type variable aliases - this variant can take an aliasTargetType and should be used when the alias target type cannot be retrieved from the resolvedmember.
 MethodBinding makeMethodBindingForCall(Member member)
           
 ResolvedMember makeResolvedMember(FieldBinding binding)
           
 ResolvedMember makeResolvedMember(FieldBinding binding, TypeBinding receiverType)
           
 ResolvedMemberImpl makeResolvedMember(MethodBinding binding)
           
 ResolvedMemberImpl makeResolvedMember(MethodBinding binding, Shadow.Kind shadowKind)
           
 ResolvedMemberImpl makeResolvedMember(MethodBinding binding, TypeBinding declaringType)
           
 ResolvedMemberImpl makeResolvedMember(MethodBinding binding, TypeBinding declaringType, MemberKind memberKind)
           
 ResolvedMemberImpl makeResolvedMemberForITD(MethodBinding binding, TypeBinding declaringType, java.util.Map recoveryAliases)
          Construct a resolvedmember from a methodbinding.
 Shadow makeShadow(ASTNode location, ReferenceContext context)
           
 Shadow makeShadow(ReferenceContext context)
           
 TypeBinding makeTypeBinding(UnresolvedType typeX)
           
 TypeBinding[] makeTypeBindings(UnresolvedType[] types)
           
 void minicleanup()
           
 void showMessage(IMessage.Kind kind, java.lang.String message, ISourceLocation loc1, ISourceLocation loc2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

debug_mungerCount

public static int debug_mungerCount

pushinCollector

public PushinCollector pushinCollector

finishedTypeMungers

public java.util.List<ConcreteTypeMunger> finishedTypeMungers
Constructor Detail

EclipseFactory

public EclipseFactory(LookupEnvironment lookupEnvironment,
                      AjBuildManager buildManager)

EclipseFactory

public EclipseFactory(LookupEnvironment lookupEnvironment,
                      World world,
                      boolean xSer)
Method Detail

fromLookupEnvironment

public static EclipseFactory fromLookupEnvironment(LookupEnvironment env)

getLookupEnvironment

public LookupEnvironment getLookupEnvironment()

fromScopeLookupEnvironment

public static EclipseFactory fromScopeLookupEnvironment(Scope scope)

getWorld

public World getWorld()

showMessage

public void showMessage(IMessage.Kind kind,
                        java.lang.String message,
                        ISourceLocation loc1,
                        ISourceLocation loc2)

fromEclipse

public ResolvedType fromEclipse(ReferenceBinding binding)

fromTypeBindingToRTX

public ResolvedType fromTypeBindingToRTX(TypeBinding tb)

fromEclipse

public ResolvedType[] fromEclipse(ReferenceBinding[] bindings)

getName

public static java.lang.String getName(TypeBinding binding)

fromBinding

public UnresolvedType fromBinding(TypeBinding binding)
Some generics notes: Andy 6-May-05 We were having trouble with parameterized types in a couple of places - due to TypeVariableBindings. When we see a TypeVariableBinding now we default to either the firstBound if it is specified or java.lang.Object. Not sure when/if this gets us unstuck? It does mean we forget that it is a type variable when going back the other way from the UnresolvedType and that would seem a bad thing - but I've yet to see the reason we need to remember the type variable. Adrian 10-July-05 When we forget it's a type variable we come unstuck when getting the declared members of a parameterized type - since we don't know it's a type variable we can't replace it with the type parameter.


fromBindings

public UnresolvedType[] fromBindings(TypeBinding[] bindings)

astForLocation

public static ASTNode astForLocation(IHasPosition location)

getDeclareParents

public java.util.List<DeclareParents> getDeclareParents()

getDeclareAnnotationOnTypes

public java.util.List<DeclareAnnotation> getDeclareAnnotationOnTypes()

getDeclareAnnotationOnFields

public java.util.List<DeclareAnnotation> getDeclareAnnotationOnFields()

getDeclareAnnotationOnMethods

public java.util.List<DeclareAnnotation> getDeclareAnnotationOnMethods()

areTypeMungersFinished

public boolean areTypeMungersFinished()

finishTypeMungers

public void finishTypeMungers()

makeEclipseTypeMunger

public EclipseTypeMunger makeEclipseTypeMunger(ConcreteTypeMunger concrete)

getTypeMungers

public java.util.List<ConcreteTypeMunger> getTypeMungers()

makeResolvedMember

public ResolvedMemberImpl makeResolvedMember(MethodBinding binding)

makeResolvedMember

public ResolvedMemberImpl makeResolvedMember(MethodBinding binding,
                                             Shadow.Kind shadowKind)

makeResolvedMemberForITD

public ResolvedMemberImpl makeResolvedMemberForITD(MethodBinding binding,
                                                   TypeBinding declaringType,
                                                   java.util.Map recoveryAliases)
Construct a resolvedmember from a methodbinding. The supplied map tells us about any typevariablebindings that replaced typevariables whilst the compiler was resolving types - this only happens if it is a generic itd that shares type variables with its target type.


makeResolvedMember

public ResolvedMemberImpl makeResolvedMember(MethodBinding binding,
                                             TypeBinding declaringType)

makeResolvedMember

public ResolvedMemberImpl makeResolvedMember(MethodBinding binding,
                                             TypeBinding declaringType,
                                             MemberKind memberKind)

makeResolvedMember

public ResolvedMember makeResolvedMember(FieldBinding binding)

makeResolvedMember

public ResolvedMember makeResolvedMember(FieldBinding binding,
                                         TypeBinding receiverType)

makeTypeBinding

public TypeBinding makeTypeBinding(UnresolvedType typeX)

makeTypeBindings

public TypeBinding[] makeTypeBindings(UnresolvedType[] types)

makeFieldBinding

public FieldBinding makeFieldBinding(NewFieldTypeMunger nftm)

makeFieldBinding

public FieldBinding makeFieldBinding(ResolvedMember member,
                                     java.util.List aliases)
Convert a resolvedmember into an eclipse field binding


makeFieldBinding

public FieldBinding makeFieldBinding(ResolvedMember member)
Convert a resolvedmember into an eclipse field binding


createSyntheticFieldBinding

public SyntheticFieldBinding createSyntheticFieldBinding(SourceTypeBinding owningType,
                                                         ResolvedMember member)
Build a new Eclipse SyntheticFieldBinding for an AspectJ ResolvedMember.


internalMakeFieldBinding

public FieldBinding internalMakeFieldBinding(ResolvedMember member,
                                             java.util.List aliases)
Take a normal AJ member and convert it into an eclipse fieldBinding. Taking into account any aliases that it may include due to being a generic itd. Any aliases are put into the typeVariableToBinding map so that they will be substituted as appropriate in the returned fieldbinding.


makeMethodBinding

public MethodBinding makeMethodBinding(NewMethodTypeMunger nmtm)

makeMethodBinding

public MethodBinding makeMethodBinding(ResolvedMember member,
                                       java.util.List aliases)
Convert a resolvedmember into an eclipse method binding.


makeMethodBinding

public MethodBinding makeMethodBinding(ResolvedMember member,
                                       java.util.List aliases,
                                       UnresolvedType aliasTargetType)
Creates a method binding for a resolvedmember taking into account type variable aliases - this variant can take an aliasTargetType and should be used when the alias target type cannot be retrieved from the resolvedmember.


makeMethodBinding

public MethodBinding makeMethodBinding(ResolvedMember member)
Convert a resolvedmember into an eclipse method binding.


internalMakeMethodBinding

public MethodBinding internalMakeMethodBinding(ResolvedMember member,
                                               java.util.List aliases)

internalMakeMethodBinding

public MethodBinding internalMakeMethodBinding(ResolvedMember member,
                                               java.util.List aliases,
                                               UnresolvedType aliasTargetType)
Take a normal AJ member and convert it into an eclipse methodBinding. Taking into account any aliases that it may include due to being a generic ITD. Any aliases are put into the typeVariableToBinding map so that they will be substituted as appropriate in the returned methodbinding


makeMethodBindingForCall

public MethodBinding makeMethodBindingForCall(Member member)

finishedCompilationUnit

public void finishedCompilationUnit(CompilationUnitDeclaration unit)

addTypeBinding

public void addTypeBinding(TypeBinding binding)

addTypeBindingAndStoreInWorld

public void addTypeBindingAndStoreInWorld(TypeBinding binding)

makeShadow

public Shadow makeShadow(ASTNode location,
                         ReferenceContext context)

makeShadow

public Shadow makeShadow(ReferenceContext context)

addSourceTypeBinding

public void addSourceTypeBinding(SourceTypeBinding binding,
                                 CompilationUnitDeclaration unit)

isXSerializableAspects

public boolean isXSerializableAspects()

fromBinding

public ResolvedMember fromBinding(MethodBinding binding)

fromBinding

public TypeVariableDeclaringElement fromBinding(Binding declaringElement)

cleanup

public void cleanup()

minicleanup

public void minicleanup()

getItdVersion

public int getItdVersion()