abc.aspectj.types
Class AJTypeSystem_c

java.lang.Object
  extended by JjTypeSystem_c
      extended by abc.aspectj.types.AJTypeSystem_c
All Implemented Interfaces:
AJTypeSystem
Direct Known Subclasses:
EAJTypeSystem_c

public class AJTypeSystem_c
extends JjTypeSystem_c
implements AJTypeSystem

Author:
Oege de Moor

Field Summary
protected  Flags AJ_METHOD_FLAGS
          All flags allowed for a method.
protected  Flags ASPECT_FLAGS
           
protected  ClassType JOINPOINT_
           
protected  Flags MEMBER_CLASS_FLAGS
          All flags allowed for a member class.
protected  ClassType NOASPECTBOUND_
           
protected  Flags POINTCUT_FLAGS
           
 
Constructor Summary
AJTypeSystem_c()
           
 
Method Summary
 MethodInstance adviceInstance(Position pos, ReferenceType container, Flags flags, Type returnType, java.lang.String name, java.util.List argTypes, java.util.List excTypes, AdviceSpec spec)
           
 void checkClassConformance(ClassType ct)
          Assert that ct implements all abstract methods required; that is, if it is a concrete class, then it must implement all interfaces and abstract methods that it or it's superclasses declare, and if it is an abstract class then any methods that it overrides are overridden correctly.
 void checkMemberClassFlags(Flags f)
           
 void checkMethodFlags(Flags f)
           
 void checkPointcutFlags(Flags f)
           
 void checkTopLevelClassFlags(Flags f)
           
protected  boolean classAccessible(ClassType targetClass, ClassType contextClass)
           
 AspectType createAspectType(LazyClassInitializer init, Source fromSource, int perKind)
           
 AspectType createAspectType(Source fromSource, int perKind)
           
 Context createContext()
           
 java.util.List findAcceptableMethods(ReferenceType container, java.lang.String name, java.util.List argTypes, ClassType currClass)
           
 FieldInstance findField(ReferenceType container, java.lang.String name, ClassType currClass)
          Requires: all type arguments are canonical.
 java.util.List findFieldInstances(ReferenceType container, java.lang.String name)
           
 PointcutInstance_c findPointCutNamed(ClassType ct, java.lang.String name)
           
 void initialize(LoadedClassResolver loadedResolver, ExtensionInfo extInfo)
           
 ConstructorInstance interTypeConstructorInstance(Position pos, java.lang.String id, ClassType origin, ClassType container, Flags flags, java.util.List argTypes, java.util.List excTypes)
           
 FieldInstance interTypeFieldInstance(Position pos, java.lang.String id, ClassType origin, ReferenceType container, Flags flags, Type type, java.lang.String name)
           
 MethodInstance interTypeMethodInstance(Position pos, java.lang.String id, ClassType origin, ReferenceType container, Flags flags, Flags oflags, Type returnType, java.lang.String name, java.util.List argTypes, java.util.List excTypes)
           
 boolean isAccessible(MemberInstance mi, Context context)
           
 boolean isAccessibleIgnorePrivileged(MemberInstance mi, Context context)
           
 ClassType JoinPoint()
           
 ClassType JoinPointStaticPart()
           
 ClassType NoAspectBound()
           
 java.util.List overrides(MethodInstance mi)
           
 MethodInstance pointcutInstance(Position pos, ReferenceType container, Flags flags, Type returnType, java.lang.String name, java.util.List argTypes, java.util.List excTypes)
           
 boolean refHostOfITD(AJContext c, MemberInstance mi)
          Disambiguation of references to fields and methods that do *not* have an explicit target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JOINPOINT_

protected ClassType JOINPOINT_

NOASPECTBOUND_

protected ClassType NOASPECTBOUND_

ASPECT_FLAGS

protected final Flags ASPECT_FLAGS

MEMBER_CLASS_FLAGS

protected final Flags MEMBER_CLASS_FLAGS
All flags allowed for a member class.


AJ_METHOD_FLAGS

protected final Flags AJ_METHOD_FLAGS
All flags allowed for a method.


POINTCUT_FLAGS

protected final Flags POINTCUT_FLAGS
Constructor Detail

AJTypeSystem_c

public AJTypeSystem_c()
Method Detail

initialize

public void initialize(LoadedClassResolver loadedResolver,
                       ExtensionInfo extInfo)
                throws SemanticException
Throws:
SemanticException

JoinPoint

public ClassType JoinPoint()
Specified by:
JoinPoint in interface AJTypeSystem

JoinPointStaticPart

public ClassType JoinPointStaticPart()
Specified by:
JoinPointStaticPart in interface AJTypeSystem

NoAspectBound

public ClassType NoAspectBound()
Specified by:
NoAspectBound in interface AJTypeSystem

checkTopLevelClassFlags

public void checkTopLevelClassFlags(Flags f)
                             throws SemanticException
Throws:
SemanticException

adviceInstance

public MethodInstance adviceInstance(Position pos,
                                     ReferenceType container,
                                     Flags flags,
                                     Type returnType,
                                     java.lang.String name,
                                     java.util.List argTypes,
                                     java.util.List excTypes,
                                     AdviceSpec spec)
Specified by:
adviceInstance in interface AJTypeSystem

pointcutInstance

public MethodInstance pointcutInstance(Position pos,
                                       ReferenceType container,
                                       Flags flags,
                                       Type returnType,
                                       java.lang.String name,
                                       java.util.List argTypes,
                                       java.util.List excTypes)
Specified by:
pointcutInstance in interface AJTypeSystem

interTypeFieldInstance

public FieldInstance interTypeFieldInstance(Position pos,
                                            java.lang.String id,
                                            ClassType origin,
                                            ReferenceType container,
                                            Flags flags,
                                            Type type,
                                            java.lang.String name)
Specified by:
interTypeFieldInstance in interface AJTypeSystem

interTypeMethodInstance

public MethodInstance interTypeMethodInstance(Position pos,
                                              java.lang.String id,
                                              ClassType origin,
                                              ReferenceType container,
                                              Flags flags,
                                              Flags oflags,
                                              Type returnType,
                                              java.lang.String name,
                                              java.util.List argTypes,
                                              java.util.List excTypes)
Specified by:
interTypeMethodInstance in interface AJTypeSystem

interTypeConstructorInstance

public ConstructorInstance interTypeConstructorInstance(Position pos,
                                                        java.lang.String id,
                                                        ClassType origin,
                                                        ClassType container,
                                                        Flags flags,
                                                        java.util.List argTypes,
                                                        java.util.List excTypes)
Specified by:
interTypeConstructorInstance in interface AJTypeSystem

classAccessible

protected boolean classAccessible(ClassType targetClass,
                                  ClassType contextClass)

isAccessible

public boolean isAccessible(MemberInstance mi,
                            Context context)

isAccessibleIgnorePrivileged

public boolean isAccessibleIgnorePrivileged(MemberInstance mi,
                                            Context context)
Specified by:
isAccessibleIgnorePrivileged in interface AJTypeSystem

refHostOfITD

public boolean refHostOfITD(AJContext c,
                            MemberInstance mi)
Disambiguation of references to fields and methods that do *not* have an explicit target. We need to determine whether the implicit receiver of this reference is the host of an intertype declaration, or whether it is a receiver (possibly an inner class) in an aspect. If the reference does not occur inside an intertype declaration, it is treated according to the normal rules of Java. If it inside an intertype declaration, we try to determine whether it might refer to the host. To this end, we look up the member name (and only the name, not taking into account the parameter types of a method) in the context. The lookup starts in the current scope, and continues until we reach the scope of the smallest enclosing intertype decl. It is in this scope that all the members of the host (that are visible from the aspect) are introduced. If the member name does occur in this scope we return true; in all other cases (if the name was found earlier, or it does not occur in the ITD scope) we return false.

Specified by:
refHostOfITD in interface AJTypeSystem

createContext

public Context createContext()

checkMemberClassFlags

public void checkMemberClassFlags(Flags f)
                           throws SemanticException
Throws:
SemanticException

findField

public FieldInstance findField(ReferenceType container,
                               java.lang.String name,
                               ClassType currClass)
                        throws SemanticException
Requires: all type arguments are canonical. Returns the fieldMatch named 'name' defined on 'type' visible from currrClass. If no such field may be found, returns a fieldmatch with an error explaining why. name and currClass may be null, in which case they will not restrict the output. This needs to be overridden for AspectJ because it is possible for the currClass to have multiple fields by the desired name, introduced by different aspects, that have different accessibility characteristics.

Throws:
SemanticException

findFieldInstances

public java.util.List findFieldInstances(ReferenceType container,
                                         java.lang.String name)
                                  throws SemanticException
Throws:
SemanticException

checkClassConformance

public void checkClassConformance(ClassType ct)
                           throws SemanticException
Assert that ct implements all abstract methods required; that is, if it is a concrete class, then it must implement all interfaces and abstract methods that it or it's superclasses declare, and if it is an abstract class then any methods that it overrides are overridden correctly.

Throws:
SemanticException

checkMethodFlags

public void checkMethodFlags(Flags f)
                      throws SemanticException
Throws:
SemanticException

checkPointcutFlags

public void checkPointcutFlags(Flags f)
                        throws SemanticException
Specified by:
checkPointcutFlags in interface AJTypeSystem
Throws:
SemanticException

findAcceptableMethods

public java.util.List findAcceptableMethods(ReferenceType container,
                                            java.lang.String name,
                                            java.util.List argTypes,
                                            ClassType currClass)
                                     throws SemanticException
Throws:
SemanticException

createAspectType

public final AspectType createAspectType(Source fromSource,
                                         int perKind)
Specified by:
createAspectType in interface AJTypeSystem

createAspectType

public AspectType createAspectType(LazyClassInitializer init,
                                   Source fromSource,
                                   int perKind)

overrides

public java.util.List overrides(MethodInstance mi)

findPointCutNamed

public PointcutInstance_c findPointCutNamed(ClassType ct,
                                            java.lang.String name)
                                     throws SemanticException
Specified by:
findPointCutNamed in interface AJTypeSystem
Throws:
SemanticException