/** * This static method goes on the declaring aspect of the inter-type method. */ public static String interMethodDispatcher(UnresolvedType aspectType, UnresolvedType classType, String name) { return makeName("interMethodDispatch1", aspectType.getNameAsIdentifier(), classType.getNameAsIdentifier(), name); }
/** * This field goes on top-most implementers of the interface the field is declared onto */ public static String interFieldInterfaceField(UnresolvedType aspectType, UnresolvedType interfaceType, String name) { return makeName("interField", aspectType.getNameAsIdentifier(), interfaceType.getNameAsIdentifier(), name); }
/** * This static method goes on the aspect that declares the inter-type field */ public static String interFieldSetDispatcher(UnresolvedType aspectType, UnresolvedType onType, String name) { return makeName("interFieldSetDispatch", aspectType.getNameAsIdentifier(), onType.getNameAsIdentifier(), name); }
/** * Create the old style (<1.6.9) format setter name which includes the aspect requesting access and the type containing the * field in the name of the type. At 1.6.9 and above the name is simply ajc$set$<fieldname> */ public static String privilegedAccessMethodForFieldSet(String name, UnresolvedType objectType, UnresolvedType aspectType) { return makeName("privFieldSet", aspectType.getNameAsIdentifier(), objectType.getNameAsIdentifier(), name); }
/** * This static void method goes on the aspect that declares the inter-type field and is called from the appropriate place * (target's initializer, or clinit, or topmost implementer's inits), to initialize the field; */ public static String interFieldInitializer(UnresolvedType aspectType, UnresolvedType classType, String name) { return makeName("interFieldInit", aspectType.getNameAsIdentifier(), classType.getNameAsIdentifier(), name); }
/** * This static method goes on the declaring aspect of the inter-type constructor. */ public static String postIntroducedConstructor(UnresolvedType aspectType, UnresolvedType targetType) { return makeName("postInterConstructor", aspectType.getNameAsIdentifier(), targetType.getNameAsIdentifier()); }
/** * This instance method goes on the interface the field is declared onto as well as its top-most implementors */ public static String interFieldInterfaceSetter(UnresolvedType aspectType, UnresolvedType interfaceType, String name) { return makeName("interFieldSet", aspectType.getNameAsIdentifier(), interfaceType.getNameAsIdentifier(), name); }
/** * This static method goes on the declaring aspect of the inter-type constructor. */ public static String preIntroducedConstructor(UnresolvedType aspectType, UnresolvedType targetType) { return makeName("preInterConstructor", aspectType.getNameAsIdentifier(), targetType.getNameAsIdentifier()); }
public static String inlineAccessMethodForFieldSet(String name, UnresolvedType objectType, UnresolvedType aspectType) { return makeName("inlineAccessFieldSet", aspectType.getNameAsIdentifier(), objectType.getNameAsIdentifier(), name); }
public static String inlineAccessMethodForMethod(String name, UnresolvedType objectType, UnresolvedType aspectType) { return makeName("inlineAccessMethod", aspectType.getNameAsIdentifier(), objectType.getNameAsIdentifier(), name); }
/** * This instance method goes on the interface the field is declared onto as well as its top-most implementors */ public static String interFieldInterfaceGetter(UnresolvedType aspectType, UnresolvedType interfaceType, String name) { return makeName("interFieldGet", aspectType.getNameAsIdentifier(), interfaceType.getNameAsIdentifier(), name); }
/** * This static method goes on the aspect that declares the inter-type field */ public static String interFieldGetDispatcher(UnresolvedType aspectType, UnresolvedType onType, String name) { return makeName("interFieldGetDispatch", aspectType.getNameAsIdentifier(), onType.getNameAsIdentifier(), name); }
/** * This static method goes on the declaring aspect of the inter-type method. */ public static String interMethodBody(UnresolvedType aspectType, UnresolvedType classType, String name) { return makeName("interMethod", aspectType.getNameAsIdentifier(), classType.getNameAsIdentifier(), name); }
/** * Create the old style (<1.6.9) format getter name which includes the aspect requesting access and the type containing the * field in the name of the type. At 1.6.9 and above the name is simply ajc$get$<fieldname> */ public static String privilegedAccessMethodForFieldGet(String name, UnresolvedType objectType, UnresolvedType aspectType) { StringBuilder nameBuilder = new StringBuilder(); nameBuilder.append(makeName("privFieldGet", aspectType.getNameAsIdentifier(), objectType.getNameAsIdentifier(), name)); return nameBuilder.toString(); }
/** * This static method goes on the target class of the inter-type method. */ public static String superDispatchMethod(UnresolvedType classType, String name) { return makeName("superDispatch", classType.getNameAsIdentifier(), name); }
/** * This static method goes on the target class of the inter-type method. */ public static String protectedDispatchMethod(UnresolvedType classType, String name) { return makeName("protectedDispatch", classType.getNameAsIdentifier(), name); }
public static String perTypeWithinLocalAspectOf(UnresolvedType aspectType) { return makeName(aspectType.getNameAsIdentifier(), "localAspectOf"); }
public static String perObjectInterfaceSet(UnresolvedType aspectType) { return makeName(aspectType.getNameAsIdentifier(), "perObjectSet"); }
public static String perTypeWithinFieldForTarget(UnresolvedType aspectType) { return makeName(aspectType.getNameAsIdentifier(), "ptwAspectInstance"); }
private static String makeVisibilityName(int modifiers, UnresolvedType aspectType) { if (Modifier.isPrivate(modifiers)) { return aspectType.getOutermostType().getNameAsIdentifier(); } else if (Modifier.isProtected(modifiers)) { throw new RuntimeException("protected inter-types not allowed"); } else if (Modifier.isPublic(modifiers)) { return ""; } else { return aspectType.getPackageNameAsIdentifier(); } }