Package org.codehaus.aspectwerkz.pointcut

Examples of org.codehaus.aspectwerkz.pointcut.FieldPointcut


                List postAdvices = new ArrayList();

                List pointcuts = m_system.getGetFieldPointcuts(m_classMetaData, m_fieldMetaData);

                for (Iterator it = pointcuts.iterator(); it.hasNext();) {
                    FieldPointcut fieldPointcut = (FieldPointcut)it.next();

                    int[] preAdviceIndexes = fieldPointcut.getPreAdviceIndexes();
                    for (int j = 0; j < preAdviceIndexes.length; j++) {
                        preAdvices.add(new Integer(preAdviceIndexes[j]));
                    }

                    int[] postAdviceIndexes = fieldPointcut.getPostAdviceIndexes();
                    for (int j = 0; j < postAdviceIndexes.length; j++) {
                        postAdvices.add(new Integer(postAdviceIndexes[j]));
                    }
                }
View Full Code Here


                List postAdvices = new ArrayList();

                List pointcuts = m_system.getSetFieldPointcuts(m_classMetaData, m_fieldMetaData);

                for (Iterator it = pointcuts.iterator(); it.hasNext();) {
                    FieldPointcut fieldPointcut = (FieldPointcut)it.next();

                    int[] preAdviceIndexes = fieldPointcut.getPreAdviceIndexes();
                    for (int j = 0; j < preAdviceIndexes.length; j++) {
                        preAdvices.add(new Integer(preAdviceIndexes[j]));
                    }

                    int[] postAdviceIndexes = fieldPointcut.getPostAdviceIndexes();
                    for (int j = 0; j < postAdviceIndexes.length; j++) {
                        postAdvices.add(new Integer(postAdviceIndexes[j]));
                    }
                }
View Full Code Here

                List adviceWeavingRules = aspectDefinition.getAdviceWeavingRules();
                for (Iterator it2 = adviceWeavingRules.iterator(); it2.hasNext();) {
                    AdviceWeavingRule weavingRule = (AdviceWeavingRule)it2.next();

                    // create set field pointcut
                    FieldPointcut pointcut = new FieldPointcut(uuid, weavingRule.getExpression());

                    // add all referenced poincuts definitions
                    boolean hasSetFieldPointcut = false;
                    List pointcutRefs = weavingRule.getPointcutRefs();
                    for (Iterator it3 = pointcutRefs.iterator(); it3.hasNext();) {
                        PointcutDefinition pointcutDefinition =
                                aspectDefinition.getPointcutDef((String)it3.next());

                        if (pointcutDefinition != null && pointcutDefinition.getType().
                                equalsIgnoreCase(PointcutDefinition.SET_FIELD)) {
                            pointcut.addPointcutDef(pointcutDefinition);
                            hasSetFieldPointcut = true;
                        }
                    }

                    // check if the weaving rule had a set field pointcut, if not continue
                    if (!hasSetFieldPointcut) {
                        continue;
                    }

                    // add pre and post advices
                    List adviceRefs = weavingRule.getAdviceRefs();
                    for (Iterator it3 = adviceRefs.iterator(); it3.hasNext();) {
                        String adviceRef = (String)it3.next();
                        if (AspectWerkz.getSystem(uuid).
                                getAdvice(adviceRef) instanceof PreAdvice) {
                            pointcut.addPreAdvice(adviceRef);
                        }
                        else if (AspectWerkz.getSystem(uuid).
                                getAdvice(adviceRef) instanceof PostAdvice) {
                            pointcut.addPostAdvice(adviceRef);
                        }
                    }

                    // add advices from advice stacks
                    List adviceStackRefs = weavingRule.getAdviceStackRefs();
                    for (Iterator it3 = adviceStackRefs.iterator(); it3.hasNext();) {
                        AdviceStackDefinition adviceStackDefinition =
                                definition.getAdviceStackDefinition((String)it3.next());

                        adviceRefs = adviceStackDefinition.getAdviceRefs();
                        for (Iterator it4 = adviceRefs.iterator(); it4.hasNext();) {
                            String adviceRef = (String)it4.next();
                            if (AspectWerkz.getSystem(uuid).
                                    getAdvice(adviceRef) instanceof PreAdvice) {
                                pointcut.addPreAdvice(adviceRef);
                            }
                            else if (AspectWerkz.getSystem(uuid).
                                    getAdvice(adviceRef) instanceof PostAdvice) {
                                pointcut.addPostAdvice(adviceRef);
                            }
                        }
                    }

                    // add the set field pointcut
View Full Code Here

                List adviceWeavingRules = aspectDefinition.getAdviceWeavingRules();
                for (Iterator it2 = adviceWeavingRules.iterator(); it2.hasNext();) {
                    AdviceWeavingRule weavingRule = (AdviceWeavingRule)it2.next();

                    // create get field pointcut
                    FieldPointcut pointcut = new FieldPointcut(uuid, weavingRule.getExpression());

                    // add all referenced poincuts definitions
                    boolean hasGetFieldPointcut = false;
                    List pointcutRefs = weavingRule.getPointcutRefs();
                    for (Iterator it3 = pointcutRefs.iterator(); it3.hasNext();) {
                        PointcutDefinition pointcutDefinition =
                                aspectDefinition.getPointcutDef((String)it3.next());
                        if (pointcutDefinition != null && pointcutDefinition.getType().
                                equalsIgnoreCase(PointcutDefinition.GET_FIELD)) {
                            pointcut.addPointcutDef(pointcutDefinition);
                            hasGetFieldPointcut = true;
                        }
                    }

                    // check if the weaving rule had a get field pointcut, if not continue
                    if (!hasGetFieldPointcut) {
                        continue;
                    }

                    // add pre and post advices
                    List adviceRefs = weavingRule.getAdviceRefs();
                    for (Iterator it3 = adviceRefs.iterator(); it3.hasNext();) {
                        String adviceRef = (String)it3.next();
                        if (AspectWerkz.getSystem(uuid).
                                getAdvice(adviceRef) instanceof PreAdvice) {
                            pointcut.addPreAdvice(adviceRef);
                        }
                        else if (AspectWerkz.getSystem(uuid).
                                getAdvice(adviceRef) instanceof PostAdvice) {
                            pointcut.addPostAdvice(adviceRef);
                        }
                    }

                    // add advices from advice stacks
                    List adviceStackRefs = weavingRule.getAdviceStackRefs();
                    for (Iterator it3 = adviceStackRefs.iterator(); it3.hasNext();) {
                        AdviceStackDefinition adviceStackDefinition =
                                definition.getAdviceStackDefinition((String)it3.next());

                        adviceRefs = adviceStackDefinition.getAdviceRefs();
                        for (Iterator it4 = adviceRefs.iterator(); it4.hasNext();) {
                            String adviceRef = (String)it4.next();
                            if (AspectWerkz.getSystem(uuid).getAdvice(adviceRef) instanceof PreAdvice) {
                                pointcut.addPreAdvice(adviceRef);
                            }
                            else if (AspectWerkz.getSystem(uuid).getAdvice(adviceRef) instanceof PostAdvice) {
                                pointcut.addPostAdvice(adviceRef);
                            }
                        }
                    }

                    // add the get field pointcut
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.pointcut.FieldPointcut

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.