Package org.aspectj.weaver.patterns

Examples of org.aspectj.weaver.patterns.PerSingleton


    } 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

        // it can happen that extends is null, for precedence only declaration
        if (m_concreteAspect.extend == null && m_concreteAspect.precedence != null) {
            if (m_concreteAspect.pointcuts.isEmpty()) {
                m_isValid = true;
                m_perClause = new PerSingleton();
                m_parent = null;
                return true;// no need to checks more in that special case
            } else {
                reportError("Attempt to use nested pointcuts without extends clause: "+stringify());
                return false;
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 (!isAnnotationStyleAspect()) {
             if(declaration instanceof AspectDeclaration) {
               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;
          if (declaration instanceof AspectDeclaration)
View Full Code Here

            ElementNameValuePair 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

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.