Package org.aspectj.apache.bcel.classfile.annotation

Examples of org.aspectj.apache.bcel.classfile.annotation.Annotation


          AjcMemberMaker.interFieldClassField(field, aspectType));
       
        if (annotationsOnRealMember!=null) {
          for (int i = 0; i < annotationsOnRealMember.length; i++) {
            AnnotationX annotationX = annotationsOnRealMember[i];
            Annotation a = annotationX.getBcelAnnotation();
            AnnotationGen ag = new AnnotationGen(a,weaver.getLazyClassGen().getConstantPoolGen(),true)
            fg.addAnnotation(ag);
          }
        }
       
        gen.addField(fg.getField(),getSourceLocation());
         
      }
        return true;
    } else if (onInterface && gen.getType().isTopmostImplementor(onType)) {
      // wew know that we can't be static since we don't allow statics on interfaces
      if (field.isStatic()) throw new RuntimeException("unimplemented");
      weaver.addInitializer(this);
      //System.err.println("impl body on " + gen.getType() + " for " + munger);
     
     
      Type fieldType =   BcelWorld.makeBcelType(field.getType());
       
      FieldGen fg = makeFieldGen(gen,AjcMemberMaker.interFieldInterfaceField(field, onType, aspectType));
         
        if (annotationsOnRealMember!=null) {
          for (int i = 0; i < annotationsOnRealMember.length; i++) {
            AnnotationX annotationX = annotationsOnRealMember[i];
            Annotation a = annotationX.getBcelAnnotation();
            AnnotationGen ag = new AnnotationGen(a,weaver.getLazyClassGen().getConstantPoolGen(),true)
            fg.addAnnotation(ag);
          }
        }
       
View Full Code Here


     * @param runtimeAnnotations
     * @param struct
     * @return true if found
     */
    private static boolean handleAspectAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeStruct struct) {
        Annotation aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.ASPECT_ANNOTATION);
        if (aspect != null) {
            // semantic check for inheritance (only one level up)
            boolean extendsAspect = false;
            if (!"java.lang.Object".equals(struct.enclosingType.getSuperclass().getName())) {
                if (!struct.enclosingType.getSuperclass().isAbstract() && struct.enclosingType.getSuperclass().isAspect()) {
View Full Code Here

     * @param runtimeAnnotations
     * @param struct
     * @return true if found
     */
    private static boolean handlePrecedenceAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeStruct struct) {
        Annotation aspect = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPRECEDENCE_ANNOTATION);
        if (aspect != null) {
            ElementNameValuePair precedence = getAnnotationElement(aspect, VALUE);
            if (precedence != null) {
                String precedencePattern = precedence.getValue().stringifyValue();
                PatternParser parser = new PatternParser(precedencePattern);
View Full Code Here

     * @param runtimeAnnotations
     * @param struct
     * @return true if found
     */
    private static boolean handleDeclareParentsAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeFieldStruct struct) {//, ResolvedPointcutDefinition preResolvedPointcut) {
        Annotation decp = getAnnotation(runtimeAnnotations, AjcMemberMaker.DECLAREPARENTS_ANNOTATION);
        if (decp != null) {
            ElementNameValuePair decpPatternNVP = getAnnotationElement(decp, VALUE);
            String decpPattern = decpPatternNVP.getValue().stringifyValue();
            if (decpPattern != null) {
                TypePattern typePattern = parseTypePattern(decpPattern, struct);
View Full Code Here

     * @param runtimeAnnotations
     * @param struct
     * @return true if found
     */
    private static boolean handleBeforeAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) {
        Annotation before = getAnnotation(runtimeAnnotations, AjcMemberMaker.BEFORE_ANNOTATION);
        if (before != null) {
            ElementNameValuePair beforeAdvice = getAnnotationElement(before, VALUE);
            if (beforeAdvice != null) {
                // this/target/args binding
                FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
View Full Code Here

     * @param runtimeAnnotations
     * @param struct
     * @return true if found
     */
    private static boolean handleAfterAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) {
        Annotation after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTER_ANNOTATION);
        if (after != null) {
            ElementNameValuePair afterAdvice = getAnnotationElement(after, VALUE);
            if (afterAdvice != null) {
                // this/target/args binding
                FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
View Full Code Here

            AjAttributeMethodStruct struct,
            ResolvedPointcutDefinition preResolvedPointcut,
            BcelMethod owningMethod)
    throws ReturningFormalNotDeclaredInAdviceSignatureException
    {
        Annotation after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTERRETURNING_ANNOTATION);
        if (after != null) {
            ElementNameValuePair annValue = getAnnotationElement(after, VALUE);
            ElementNameValuePair annPointcut = getAnnotationElement(after, POINTCUT);
            ElementNameValuePair annReturned = getAnnotationElement(after, RETURNING);
View Full Code Here

            AjAttributeMethodStruct struct,
            ResolvedPointcutDefinition preResolvedPointcut,
            BcelMethod owningMethod)
    throws ThrownFormalNotDeclaredInAdviceSignatureException
    {
        Annotation after = getAnnotation(runtimeAnnotations, AjcMemberMaker.AFTERTHROWING_ANNOTATION);
        if (after != null) {
            ElementNameValuePair annValue = getAnnotationElement(after, VALUE);
            ElementNameValuePair annPointcut = getAnnotationElement(after, POINTCUT);
            ElementNameValuePair annThrown = getAnnotationElement(after, THROWING);
View Full Code Here

     * @param runtimeAnnotations
     * @param struct
     * @return true if found
     */
    private static boolean handleAroundAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct, ResolvedPointcutDefinition preResolvedPointcut) {
        Annotation around = getAnnotation(runtimeAnnotations, AjcMemberMaker.AROUND_ANNOTATION);
        if (around != null) {
            ElementNameValuePair aroundAdvice = getAnnotationElement(around, VALUE);
            if (aroundAdvice != null) {
                // this/target/args binding
                FormalBinding[] bindings = new org.aspectj.weaver.patterns.FormalBinding[0];
View Full Code Here

     *
     * @param runtimeAnnotations
     * @param struct
     */
    private static void handlePointcutAnnotation(RuntimeAnnotations runtimeAnnotations, AjAttributeMethodStruct struct) {
        Annotation pointcut = getAnnotation(runtimeAnnotations, AjcMemberMaker.POINTCUT_ANNOTATION);
        if (pointcut != null) {
            ElementNameValuePair pointcutExpr = getAnnotationElement(pointcut, VALUE);

            // semantic check: the method must return void, or be "public static boolean" for if() support
            if (!(Type.VOID.equals(struct.method.getReturnType())
View Full Code Here

TOP

Related Classes of org.aspectj.apache.bcel.classfile.annotation.Annotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.