Package org.codehaus.aspectwerkz.regexp

Examples of org.codehaus.aspectwerkz.regexp.PatternTuple


            StringBuffer memberPattern = new StringBuffer();
            memberPattern.append(returnType);
            memberPattern.append(methodPattern);
            memberPattern.append(parameterTypes);

            return new PatternTuple(null, classPattern, memberPattern.toString(), isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("method pattern is not well formed [" + pattern + ']');
        }
    }
View Full Code Here


            }
            StringBuffer memberPattern = new StringBuffer();
            memberPattern.append(methodPattern);
            memberPattern.append(parameterTypes);

            return new PatternTuple(null, classPattern, memberPattern.toString(), isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("constructor pattern is not well formed [" + pattern + ']');
        }
    }
View Full Code Here

            StringBuffer memberPattern = new StringBuffer();
            memberPattern.append(fieldType);
            memberPattern.append(fieldPattern);

            return new PatternTuple(null, classPattern, memberPattern.toString(), isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("field pattern is not well formed [" + pattern + ']');
        }
    }
View Full Code Here

            memberPattern.append(methodPattern);
            memberPattern.append(parameterTypes);
            memberPattern.append('#');
            memberPattern.append(exceptionName);

            return new PatternTuple(null, classPattern, memberPattern.toString(), isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("throws pattern is not well formed [" + pattern + ']');
        }
    }
View Full Code Here

            if (classPattern.endsWith("+")) {
                classPattern = classPattern.substring(0, classPattern.length() - 1);
                isHierarchical = true;
            }

            return new PatternTuple(null, classPattern, classPattern, isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("class pattern is not well formed [" + pattern + "]");
        }
    }
View Full Code Here

            StringBuffer memberPattern = new StringBuffer();
            memberPattern.append(returnType);
            memberPattern.append(methodPattern);
            memberPattern.append(parameterTypes);

            return new PatternTuple(null, classPattern, memberPattern.toString(), isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("method pattern is not well formed [" + pattern + "]");
        }
    }
View Full Code Here

            StringBuffer memberPattern = new StringBuffer();
            memberPattern.append(fieldType);
            memberPattern.append(fieldPattern);

            return new PatternTuple(null, classPattern, memberPattern.toString(), isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("field pattern is not well formed [" + pattern + "]");
        }
    }
View Full Code Here

            memberPattern.append(methodPattern);
            memberPattern.append(parameterTypes);
            memberPattern.append('#');
            memberPattern.append(exceptionName);

            return new PatternTuple(null, classPattern, memberPattern.toString(), isHierarchical);
        }
        catch (Exception e) {
            throw new DefinitionException("throws pattern is not well formed [" + pattern + "]");
        }
    }
View Full Code Here

            buf.append(calleeClassPattern);
            buf.append(AspectWerkzDefinition.CALLER_SIDE_DELIMITER);
            buf.append(calleeMethodPattern);

            // TODO: should perhaps add both a caller class and callee class field in the tuple
            return new PatternTuple(callerClassPattern, calleeClassPattern, buf.toString(), isHierarchical, isHierarchicalCallee);
        }
        catch (Exception e) {
            throw new DefinitionException("caller side pattern is not well formed [" + pattern + "]");
        }
    }
View Full Code Here

    /**
     * Compiles the pattern for the expression.
     */
    protected void compilePattern() {
        PatternTuple tuple = null;
        if (m_type == null) {
            throw new ExpressionException("pointcut type in context can not be null");
        }
        if (m_type.equals(PointcutType.EXECUTION)) {
            tuple = PatternFactory.createMethodPatternTuple(m_expression, m_package);
            m_memberPattern = Pattern.compileMethodPattern(tuple.getMemberPattern());
            m_isHierarchical = tuple.isHierarchical();
            m_classPattern = Pattern.compileClassPattern(tuple.getCalleeClassPattern());
        }
        else if (m_type.equals(PointcutType.CALL)) {
            tuple = PatternFactory.createCallPatternTuple(m_expression, m_package);
            m_memberPattern = Pattern.compileCallerSidePattern(tuple.getMemberPattern());
            m_isHierarchical = tuple.isHierarchical();
            m_isHierarchicalCallee = tuple.isHierarchicalCallee();
            m_classPattern = Pattern.compileClassPattern(tuple.getCallerClassPattern());
        }
        else if (m_type.equals(PointcutType.SET) || m_type.equals(PointcutType.GET)) {
            tuple = PatternFactory.createFieldPatternTuple(m_expression, m_package);
            m_memberPattern = Pattern.compileFieldPattern(tuple.getMemberPattern());
            m_isHierarchical = tuple.isHierarchical();
            m_classPattern = Pattern.compileClassPattern(tuple.getCalleeClassPattern());
        }
        else if (m_type.equals(PointcutType.THROWS)) {
            tuple = PatternFactory.createThrowsPatternTuple(m_expression, m_package);
            m_memberPattern = Pattern.compileThrowsPattern(tuple.getMemberPattern());
            m_isHierarchical = tuple.isHierarchical();
            m_classPattern = Pattern.compileClassPattern(tuple.getCalleeClassPattern());
        }
        else if (m_type.equals(PointcutType.CFLOW)) {
            // cflow compiled as caller side pattern
            tuple = PatternFactory.createCallPatternTuple(m_expression, m_package);
            m_memberPattern = Pattern.compileCallerSidePattern(tuple.getMemberPattern());
            m_isHierarchical = tuple.isHierarchical();
            m_classPattern = Pattern.compileClassPattern(tuple.getCalleeClassPattern());
        }
        else if (m_type.equals(PointcutType.CLASS)) {
            tuple = PatternFactory.createClassPatternTuple(m_expression, m_package);
            m_isHierarchical = tuple.isHierarchical();
            m_classPattern = Pattern.compileClassPattern(tuple.getCalleeClassPattern());
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.regexp.PatternTuple

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.