Package org.aspectj.weaver.patterns

Examples of org.aspectj.weaver.patterns.PerSingleton


    if (!isValid) {
      throw new RuntimeException("Must validate first");
    }
    PerClause parentPerClause = (parent != null ? parent.getPerClause() : null);
    if (parentPerClause == null) {
      parentPerClause = new PerSingleton();
    }
    PerClause.Kind perclauseKind = PerClause.SINGLETON;
    String perclauseString = null;

    if (concreteAspect.perclause != null) {
View Full Code Here


        PerClause pc = ((AspectDeclaration) declaration).perClause;
        if (pc != null) {
          return pc;
        }
      }
      return new PerSingleton();
    } else {
      // for @Aspect, we do need the real kind though we don't need the
      // real perClause
      // at least try to get the right perclause
      PerClause pc = null;
View Full Code Here

      NameValuePair aspectPerClause = getAnnotationElement(aspect, VALUE);
      final PerClause perClause;
      if (aspectPerClause == null) {
        // empty value means singleton unless inherited
        if (!extendsAspect) {
          perClause = new PerSingleton();
        } else {
          perClause = new PerFromSuper(struct.enclosingType.getSuperclass().getPerClause().getKind());
        }
      } else {
        String perX = aspectPerClause.getValue().stringifyValue();
        if (perX == null || perX.length() <= 0) {
          perClause = new PerSingleton();
        } else {
          perClause = parsePerClausePointcut(perX, struct);
        }
      }
      if (perClause == null) {
View Full Code Here

    } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTYPEWITHIN.getName())) {
      pointcutString = PerClause.KindAnnotationPrefix.PERTYPEWITHIN.extractPointcut(perClauseString);
      typePattern = parseTypePattern(pointcutString, struct);
      perClause = new PerTypeWithin(typePattern);
    } else if (perClauseString.equalsIgnoreCase(PerClause.SINGLETON.getName() + "()")) {
      perClause = new PerSingleton();
    } else {
      // could not parse the @AJ perclause - fallback to singleton and
      // issue an error
      reportError("@Aspect per clause cannot be read '" + perClauseString + "'", struct);
      return null;
View Full Code Here

  public PerClause parsePerClause(Parser parser) {
    PatternParser patternParser = new PatternParser(tokenSource);
    try {
      PerClause ret = patternParser.maybeParsePerClause();
      checkEof(parser);
      if (ret == null) return new PerSingleton();
      else return ret;
    } catch (ParserException pe) {
      reportError(parser, pe);
      return new PerSingleton();
    }
   
  }
View Full Code Here

    EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(scope);

    if (perClause == null) {
      PerClause.Kind kind = lookupPerClauseKind(binding.superclass);
      if (kind == null) {
        perClause = new PerSingleton();
      } else {
        perClause = new PerFromSuper(kind);
      }
    }
View Full Code Here

    if (bytes != null) {
      return bytes;
    }
    PerClause parentPerClause = (parent != null ? parent.getPerClause() : null);
    if (parentPerClause == null) {
      parentPerClause = new PerSingleton();
    }
    PerClause.Kind perclauseKind = PerClause.SINGLETON;
    String perclauseString = null;

    if (concreteAspect.perclause != null) {
View Full Code Here

      NameValuePair aspectPerClause = getAnnotationElement(aspect, VALUE);
      final PerClause perClause;
      if (aspectPerClause == null) {
        // empty value means singleton unless inherited
        if (!extendsAspect) {
          perClause = new PerSingleton();
        } else {
          perClause = new PerFromSuper(struct.enclosingType.getSuperclass().getPerClause().getKind());
        }
      } else {
        String perX = aspectPerClause.getValue().stringifyValue();
        if (perX == null || perX.length() <= 0) {
          perClause = new PerSingleton();
        } else {
          perClause = parsePerClausePointcut(perX, struct);
        }
      }
      if (perClause == null) {
View Full Code Here

    } else if (perClauseString.startsWith(PerClause.KindAnnotationPrefix.PERTYPEWITHIN.getName())) {
      pointcutString = PerClause.KindAnnotationPrefix.PERTYPEWITHIN.extractPointcut(perClauseString);
      typePattern = parseTypePattern(pointcutString, struct);
      perClause = new PerTypeWithin(typePattern);
    } else if (perClauseString.equalsIgnoreCase(PerClause.SINGLETON.getName() + "()")) {
      perClause = new PerSingleton();
    } else {
      // could not parse the @AJ perclause - fallback to singleton and
      // issue an error
      reportError("@Aspect per clause cannot be read '" + perClauseString + "'", struct);
      return null;
View Full Code Here

      NameValuePair aspectPerClause = getAnnotationElement(aspect, VALUE);
      final PerClause perClause;
      if (aspectPerClause == null) {
        // empty value means singleton unless inherited
        if (!extendsAspect) {
          perClause = new PerSingleton();
        } else {
          perClause = new PerFromSuper(struct.enclosingType.getSuperclass().getPerClause().getKind());
        }
      } else {
        String perX = aspectPerClause.getValue().stringifyValue();
        if (perX == null || perX.length() <= 0) {
          perClause = new PerSingleton();
        } else {
          perClause = parsePerClausePointcut(perX, struct);
        }
      }
      if (perClause == null) {
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.patterns.PerSingleton

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.