Source Code Cross Referenced for DefinitionParserHelper.java in  » Net » Terracotta » com » tc » aspectwerkz » definition » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Terracotta » com.tc.aspectwerkz.definition 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
003:         */
004:        package com.tc.aspectwerkz.definition;
005:
006:        import com.tc.aspectwerkz.DeploymentModel;
007:        import com.tc.aspectwerkz.reflect.ClassInfo;
008:        import com.tc.aspectwerkz.reflect.MethodInfo;
009:        import com.tc.aspectwerkz.reflect.ClassInfoHelper;
010:        import com.tc.aspectwerkz.aspect.AdviceType;
011:        import com.tc.aspectwerkz.exception.DefinitionException;
012:        import com.tc.aspectwerkz.expression.regexp.Pattern;
013:        import com.tc.aspectwerkz.expression.ExpressionInfo;
014:        import com.tc.aspectwerkz.expression.ExpressionNamespace;
015:        import com.tc.aspectwerkz.transform.TransformationConstants;
016:        import com.tc.aspectwerkz.util.Strings;
017:
018:        import java.util.Iterator;
019:        import java.util.Collection;
020:        import java.util.List;
021:
022:        /**
023:         * Helper class for the attribute and the XML definition parsers.
024:         *
025:         * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
026:         * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur </a>
027:         */
028:        public class DefinitionParserHelper {
029:            public static final String EXPRESSION_PREFIX = "AW_";
030:
031:            /**
032:             * Creates and adds pointcut definition to aspect definition.
033:             *
034:             * @param name
035:             * @param expression
036:             * @param aspectDef
037:             */
038:            public static void createAndAddPointcutDefToAspectDef(
039:                    final String name, final String expression,
040:                    final AspectDefinition aspectDef) {
041:                PointcutDefinition pointcutDef = new PointcutDefinition(
042:                        expression);
043:                aspectDef.addPointcutDefinition(pointcutDef);
044:
045:                // name can be the "pcName(paramType paramName)"
046:                // extract the parameter name to type map
047:                // and register the pointcut using its name
048:                //TODO: support for same pc name and different signature
049:                String pointcutName = name;
050:                String pointcutCallSignature = null;
051:                if (name.indexOf("(") > 0) {
052:                    pointcutName = name.substring(0, name.indexOf("("));
053:                    pointcutCallSignature = name.substring(
054:                            name.indexOf("(") + 1, name.lastIndexOf(")"));
055:                }
056:
057:                // do a lookup first to avoid infinite recursion when:
058:                // <pointcut name="pc" ...> [will be registered as pc]
059:                // <advice bind-to="pc" ...> [will be registered as pc and should not override previous one !]
060:                ExpressionNamespace namespace = ExpressionNamespace
061:                        .getNamespace(aspectDef.getQualifiedName());
062:                ExpressionInfo info = namespace
063:                        .getExpressionInfoOrNull(pointcutName);
064:                if (info == null) {
065:                    info = new ExpressionInfo(expression, aspectDef
066:                            .getQualifiedName());
067:                    // extract the pointcut signature map
068:                    if (pointcutCallSignature != null) {
069:                        String[] parameters = Strings.splitString(
070:                                pointcutCallSignature, ",");
071:                        for (int i = 0; i < parameters.length; i++) {
072:                            String[] parameterInfo = Strings.splitString(
073:                                    Strings.replaceSubString(parameters[i]
074:                                            .trim(), "  ", " "), " ");
075:                            info.addArgument(parameterInfo[1],
076:                                    parameterInfo[0], aspectDef.getClassInfo()
077:                                            .getClassLoader());
078:                        }
079:                    }
080:                }
081:                ExpressionNamespace.getNamespace(aspectDef.getQualifiedName())
082:                        .addExpressionInfo(pointcutName, info);
083:            }
084:
085:            /**
086:             * Creates and adds a prepared pointcut definition to virtual aspect definition.
087:             *
088:             * @param name
089:             * @param expression
090:             * @param systemDef
091:             */
092:            public static void createAndAddDeploymentScopeDef(
093:                    final String name,//TODO Depl scpope(prasen)field name not unique - need FQN
094:                    final String expression, final SystemDefinition systemDef) {
095:                AspectDefinition aspectDef = systemDef
096:                        .getAspectDefinition(Virtual.class.getName());
097:                aspectDef.addPointcutDefinition(new PointcutDefinition(
098:                        expression));
099:                systemDef.addDeploymentScope(new DeploymentScope(name,
100:                        expression));
101:            }
102:
103:            /**
104:             * Creates and adds an advisable definition to virtual aspect definition.
105:             *
106:             * @param expression
107:             * @param systemDef
108:             */
109:            public static void createAndAddAdvisableDef(
110:                    final String expression, final SystemDefinition systemDef) {
111:                AspectDefinition virtualAspectDef = systemDef
112:                        .getAspectDefinition(Virtual.class.getName());
113:                virtualAspectDef.addPointcutDefinition(new PointcutDefinition(
114:                        expression));
115:
116:                AdviceDefinition virtualAdviceDef = (AdviceDefinition) virtualAspectDef
117:                        .getBeforeAdviceDefinitions().get(0);
118:                ExpressionInfo oldExpressionInfo = virtualAdviceDef
119:                        .getExpressionInfo();
120:                String newExpression;
121:                if (oldExpressionInfo != null) {
122:                    String oldExpression = oldExpressionInfo.toString();
123:                    newExpression = oldExpression + " || " + expression;
124:                } else {
125:                    newExpression = expression;
126:                }
127:
128:                virtualAdviceDef.setExpressionInfo(new ExpressionInfo(
129:                        newExpression, virtualAspectDef.getQualifiedName()));
130:            }
131:
132:            /**
133:             * Attaches all deployment scopes in a system to the virtual advice.
134:             *
135:             * @param systemDef the system definition
136:             */
137:            public static void attachDeploymentScopeDefsToVirtualAdvice(
138:                    final SystemDefinition systemDef) {
139:                final AspectDefinition virtualAspectDef = systemDef
140:                        .getAspectDefinition(Virtual.class.getName());
141:                final AdviceDefinition virtualAdviceDef = (AdviceDefinition) virtualAspectDef
142:                        .getBeforeAdviceDefinitions().get(0);
143:
144:                final StringBuffer newExpression = new StringBuffer();
145:                final ExpressionInfo oldExpressionInfo = virtualAdviceDef
146:                        .getExpressionInfo();
147:                if (oldExpressionInfo != null) {
148:                    String oldExpression = oldExpressionInfo.toString();
149:                    newExpression.append(oldExpression);
150:                }
151:                final Collection deploymentScopes = systemDef
152:                        .getDeploymentScopes();
153:                if (deploymentScopes.size() != 0 && oldExpressionInfo != null) {
154:                    newExpression.append(" || ");
155:                }
156:                for (Iterator it = deploymentScopes.iterator(); it.hasNext();) {
157:                    DeploymentScope deploymentScope = (DeploymentScope) it
158:                            .next();
159:                    newExpression.append(deploymentScope.getExpression());
160:                    if (it.hasNext()) {
161:                        newExpression.append(" || ");
162:                    }
163:                }
164:                if (newExpression.length() != 0) {
165:                    virtualAdviceDef.setExpressionInfo(new ExpressionInfo(
166:                            newExpression.toString(), virtualAspectDef
167:                                    .getQualifiedName()));
168:                }
169:            }
170:
171:            /**
172:             * Creates and add mixin definition to system definition.
173:             *
174:             * @param mixinClassInfo
175:             * @param expression
176:             * @param deploymentModel
177:             * @param isTransient
178:             * @param systemDef
179:             * @return the mixin definition
180:             */
181:            public static MixinDefinition createAndAddMixinDefToSystemDef(
182:                    final ClassInfo mixinClassInfo, final String expression,
183:                    final DeploymentModel deploymentModel,
184:                    final boolean isTransient, final SystemDefinition systemDef) {
185:                final MixinDefinition mixinDef = createMixinDefinition(
186:                        mixinClassInfo, expression, deploymentModel,
187:                        isTransient, systemDef);
188:
189:                // check doublons - TODO change ArrayList to HashMap since NAME is a key
190:                MixinDefinition doublon = null;
191:                for (Iterator intros = systemDef.getMixinDefinitions()
192:                        .iterator(); intros.hasNext();) {
193:                    MixinDefinition intro = (MixinDefinition) intros.next();
194:                    if (intro.getMixinImpl().getName().equals(
195:                            mixinDef.getMixinImpl().getName())) {
196:                        doublon = intro;
197:                        intro.addExpressionInfos(mixinDef.getExpressionInfos());
198:                        break;
199:                    }
200:                }
201:                if (doublon == null) {
202:                    systemDef.addMixinDefinition(mixinDef);
203:                }
204:                return mixinDef;
205:            }
206:
207:            /**
208:             * Creates and add interface introduction definition to aspect definition.
209:             *
210:             * @param expression
211:             * @param introductionName
212:             * @param interfaceClassName
213:             * @param aspectDef
214:             */
215:            public static void createAndAddInterfaceIntroductionDefToAspectDef(
216:                    final String expression, final String introductionName,
217:                    final String interfaceClassName,
218:                    final AspectDefinition aspectDef) {
219:                // Introduction name is unique within an aspectDef only
220:                InterfaceIntroductionDefinition introDef = createInterfaceIntroductionDefinition(
221:                        introductionName, expression, interfaceClassName,
222:                        aspectDef);
223:                aspectDef.addInterfaceIntroductionDefinition(introDef);
224:            }
225:
226:            /**
227:             * Creates a new advice definition.
228:             *
229:             * @param adviceName          the advice name
230:             * @param adviceType          the advice type
231:             * @param expression          the advice expression
232:             * @param specialArgumentType the arg
233:             * @param aspectName          the aspect name
234:             * @param aspectClassName     the aspect class name
235:             * @param methodInfo          the advice methodInfo
236:             * @param aspectDef           the aspect definition
237:             * @return the new advice definition
238:             */
239:            public static AdviceDefinition createAdviceDefinition(
240:                    final String adviceName, final AdviceType adviceType,
241:                    final String expression, final String specialArgumentType,
242:                    final String aspectName, final String aspectClassName,
243:                    final MethodInfo methodInfo,
244:                    final AspectDefinition aspectDef) {
245:                ExpressionInfo expressionInfo = new ExpressionInfo(expression,
246:                        aspectDef.getQualifiedName());
247:
248:                // support for pointcut signature
249:                String adviceCallSignature = null;
250:                String resolvedSpecialArgumentType = specialArgumentType;
251:                if (adviceName.indexOf('(') > 0) {
252:                    adviceCallSignature = adviceName.substring(adviceName
253:                            .indexOf('(') + 1, adviceName.lastIndexOf(')'));
254:                    String[] parameters = Strings.splitString(
255:                            adviceCallSignature, ",");
256:                    for (int i = 0; i < parameters.length; i++) {
257:                        String[] parameterInfo = Strings.splitString(Strings
258:                                .replaceSubString(parameters[i].trim(), "  ",
259:                                        " "), " ");
260:                        // Note: for XML defined aspect, we support anonymous parameters like
261:                        // advice(JoinPoint, Rtti) as well as abbreviations, so we have to assign
262:                        // them a name here, as well as their real type
263:                        String paramName, paramType = null;
264:                        if (parameterInfo.length == 2) {
265:                            paramName = parameterInfo[1];
266:                            paramType = parameterInfo[0];
267:                        } else {
268:                            paramName = "anonymous_" + i;
269:                            paramType = (String) Pattern.ABBREVIATIONS
270:                                    .get(parameterInfo[0]);
271:                        }
272:                        // skip the parameter if this ones is a after returning / throwing binding
273:                        if (paramName.equals(specialArgumentType)) {
274:                            resolvedSpecialArgumentType = paramType;
275:                            expressionInfo.setSpecialArgumentName(paramName);
276:                        } else {
277:                            expressionInfo.addArgument(paramName, paramType,
278:                                    aspectDef.getClassInfo().getClassLoader());
279:                        }
280:                    }
281:                }
282:
283:                // check that around advice return Object else the compiler will fail
284:                if (adviceType.equals(AdviceType.AROUND)) {
285:                    if (!"java.lang.Object".equals(methodInfo.getReturnType()
286:                            .getName())) {
287:                        throw new DefinitionException(
288:                                "around advice must return java.lang.Object : "
289:                                        + aspectClassName + "."
290:                                        + methodInfo.getName());
291:                    }
292:                }
293:
294:                final AdviceDefinition adviceDef = new AdviceDefinition(
295:                        adviceName, adviceType, resolvedSpecialArgumentType,
296:                        aspectName, aspectClassName, expressionInfo,
297:                        methodInfo, aspectDef);
298:                return adviceDef;
299:            }
300:
301:            /**
302:             * Creates an introduction definition.
303:             *
304:             * @param mixinClassInfo
305:             * @param expression
306:             * @param deploymentModel
307:             * @param isTransient
308:             * @param systemDef
309:             * @return
310:             */
311:            public static MixinDefinition createMixinDefinition(
312:                    final ClassInfo mixinClassInfo, final String expression,
313:                    final DeploymentModel deploymentModel,
314:                    final boolean isTransient, final SystemDefinition systemDef) {
315:                final MixinDefinition mixinDef = new MixinDefinition(
316:                        mixinClassInfo, deploymentModel, isTransient, systemDef);
317:                if (expression != null) {
318:                    ExpressionInfo expressionInfo = new ExpressionInfo(
319:                            expression, systemDef.getUuid());
320:
321:                    // auto-name the pointcut which is anonymous for introduction
322:                    ExpressionNamespace.getNamespace(systemDef.getUuid())
323:                            .addExpressionInfo(
324:                                    EXPRESSION_PREFIX + expression.hashCode(),
325:                                    expressionInfo);
326:                    mixinDef.addExpressionInfo(expressionInfo);
327:                }
328:                return mixinDef;
329:            }
330:
331:            /**
332:             * Creates a new interface introduction definition.
333:             *
334:             * @param introductionName   the introduction name
335:             * @param expression         the pointcut expression
336:             * @param interfaceClassName the class name of the interface
337:             * @param aspectDef          the aspect definition
338:             * @return the new introduction definition
339:             */
340:            public static InterfaceIntroductionDefinition createInterfaceIntroductionDefinition(
341:                    final String introductionName, final String expression,
342:                    final String interfaceClassName,
343:                    final AspectDefinition aspectDef) {
344:                final InterfaceIntroductionDefinition introDef = new InterfaceIntroductionDefinition(
345:                        introductionName, interfaceClassName);
346:                if (expression != null) {
347:                    ExpressionInfo expressionInfo = new ExpressionInfo(
348:                            expression, aspectDef.getQualifiedName());
349:
350:                    // auto-name the pointcut which is anonymous for introduction
351:                    ExpressionNamespace.getNamespace(
352:                            aspectDef.getQualifiedName()).addExpressionInfo(
353:                            EXPRESSION_PREFIX + expression.hashCode(),
354:                            expressionInfo);
355:                    introDef.addExpressionInfo(expressionInfo);
356:                }
357:                return introDef;
358:            }
359:
360:            /**
361:             * Creates the advice definitions and adds them to the aspect definition.
362:             *
363:             * @param type      the type of advice
364:             * @param bindTo    the pointcut expresion
365:             * @param name      the name of the advice
366:             * @param method    the method implementing the advice
367:             * @param aspectDef the aspect definition
368:             */
369:            public static void createAndAddAdviceDefsToAspectDef(
370:                    final String type, final String bindTo, final String name,
371:                    final MethodInfo method, final AspectDefinition aspectDef) {
372:                try {
373:                    if (type.equalsIgnoreCase("around")) {
374:                        final String aspectName = aspectDef.getName();
375:                        AdviceDefinition adviceDef = createAdviceDefinition(
376:                                name, AdviceType.AROUND, bindTo, null,
377:                                aspectName, aspectDef.getClassName(), method,
378:                                aspectDef);
379:                        aspectDef.addAroundAdviceDefinition(adviceDef);
380:
381:                    } else if (type.equalsIgnoreCase("before")) {
382:                        final String aspectName = aspectDef.getName();
383:                        AdviceDefinition adviceDef = createAdviceDefinition(
384:                                name, AdviceType.BEFORE, bindTo, null,
385:                                aspectName, aspectDef.getClassName(), method,
386:                                aspectDef);
387:                        aspectDef.addBeforeAdviceDefinition(adviceDef);
388:
389:                    } else if (type.startsWith("after")) {
390:                        String specialArgumentType = null;
391:                        AdviceType adviceType = AdviceType.AFTER;
392:                        if (type.startsWith("after returning(")) {
393:                            adviceType = AdviceType.AFTER_RETURNING;
394:                            int start = type.indexOf('(');
395:                            int end = type.indexOf(')');
396:                            specialArgumentType = type
397:                                    .substring(start + 1, end).trim();
398:                        } else if (type.startsWith("after throwing(")) {
399:                            adviceType = AdviceType.AFTER_THROWING;
400:                            int start = type.indexOf('(');
401:                            int end = type.indexOf(')');
402:                            specialArgumentType = type
403:                                    .substring(start + 1, end).trim();
404:                        } else if (type.startsWith("after returning")) {
405:                            adviceType = AdviceType.AFTER_RETURNING;
406:                        } else if (type.startsWith("after throwing")) {
407:                            adviceType = AdviceType.AFTER_THROWING;
408:                        } else if (type.startsWith("after")) {
409:                            adviceType = AdviceType.AFTER_FINALLY;
410:                        } else if (type.startsWith("after finally")) {
411:                            adviceType = AdviceType.AFTER_FINALLY;
412:                        }
413:                        if (specialArgumentType != null
414:                                && specialArgumentType.indexOf(' ') > 0) {
415:                            throw new DefinitionException(
416:                                    "argument to after (returning/throwing) can only be a type (parameter name binding should be done using args(..))");
417:                        }
418:                        final String aspectName = aspectDef.getName();
419:                        AdviceDefinition adviceDef = createAdviceDefinition(
420:                                name, adviceType, bindTo, specialArgumentType,
421:                                aspectName, aspectDef.getClassName(), method,
422:                                aspectDef);
423:
424:                        aspectDef.addAfterAdviceDefinition(adviceDef);
425:                    } else {
426:                        throw new DefinitionException(
427:                                "Unkonw type for advice : " + type);
428:                    }
429:                } catch (DefinitionException e) {
430:                    System.err.println("WARNING: unable to register advice "
431:                            + aspectDef.getName() + "." + name
432:                            + " at pointcut [" + bindTo + "] due to: "
433:                            + e.getMessage());
434:                    // TODO ALEX - better handling of reg issue (f.e. skip the whole aspect, in DocumentParser, based on DefinitionE
435:                }
436:            }
437:
438:            public static MethodInfo createMethodInfoForAdviceFQN(
439:                    final String name, final AspectDefinition aspectDef,
440:                    final ClassInfo aspectClassInfo) {
441:                List adviceMethodList = ClassInfoHelper
442:                        .createMethodList(aspectClassInfo);
443:                MethodInfo method = null;
444:                for (Iterator it3 = adviceMethodList.iterator(); it3.hasNext();) {
445:                    MethodInfo methodCurrent = (MethodInfo) it3.next();
446:                    if (aspectDef.isAspectWerkzAspect()) {
447:                        if (matchMethodAsAdvice(methodCurrent, name)) {
448:                            method = methodCurrent;
449:                            break;
450:                        }
451:                    } else {
452:                        // TODO support matchMethodAsAdvice(..) for all aspect models? if so use stuff below
453:                        //                        AspectModel aspectModel = AspectModelManager.getModelFor(aspectDef.getAspectModel());
454:                        //                        if (aspectModel.matchMethodAsAdvice(methodCurrent, name)) {
455:                        //                            method = methodCurrent;
456:                        //                            break;
457:                        //                        }
458:                        if (methodCurrent.getName().equals(name)) {
459:                            method = methodCurrent;
460:                            break;
461:                        }
462:                    }
463:                }
464:                if (method == null) {
465:                    throw new DefinitionException(
466:                            "could not find advice method ["
467:                                    + name
468:                                    + "] in ["
469:                                    + aspectClassInfo.getName()
470:                                    + "] (are you using a compiler extension that you have not registered?)"
471:                                    + " (are you using XML defined advice, with StaticJoinPoint bindings without specifying the full"
472:                                    + "source like signature?)");
473:                }
474:                return method;
475:            }
476:
477:            /**
478:             * Check if a method from an aspect class match a given advice signature.
479:             * <br/>
480:             * If the signature is just a method name, then we have a match even if JoinPoint is sole method parameter.
481:             * Else we match both method name and parameters type, with abbreviation support (java.lang.* and JoinPoint)
482:             *
483:             * @param method
484:             * @param adviceSignature
485:             * @return boolean
486:             */
487:            private static boolean matchMethodAsAdvice(MethodInfo method,
488:                    String adviceSignature) {
489:                // grab components from adviceSignature
490:                //TODO catch AOOBE for better syntax error reporting
491:                String[] signatureElements = Strings
492:                        .extractMethodSignature(adviceSignature);
493:
494:                // check method name
495:                if (!method.getName().equals(signatureElements[0])) {
496:                    return false;
497:                }
498:                // check number of args
499:                if (method.getParameterTypes().length * 2 != signatureElements.length - 1) {
500:                    // we still match if method has "JoinPoint" has sole parameter
501:                    // and adviceSignature has none
502:                    if (signatureElements.length == 1
503:                            && method.getParameterTypes().length == 1
504:                            && (method.getParameterTypes()[0]
505:                                    .getName()
506:                                    .equals(
507:                                            TransformationConstants.JOIN_POINT_JAVA_CLASS_NAME) || method
508:                                    .getParameterTypes()[0]
509:                                    .getName()
510:                                    .equals(
511:                                            TransformationConstants.STATIC_JOIN_POINT_JAVA_CLASS_NAME))) {
512:                        return true;
513:                    } else {
514:                        return false;
515:                    }
516:                }
517:                int argIndex = 0;
518:                for (int i = 1; i < signatureElements.length; i++) {
519:                    String paramType = signatureElements[i++];
520:                    String methodParamType = method.getParameterTypes()[argIndex++]
521:                            .getName();
522:                    // handle shortcuts for java.lang.* and JoinPoint, StaticJoinPoint and Rtti
523:                    String paramTypeResolved = (String) Pattern.ABBREVIATIONS
524:                            .get(paramType);
525:                    if (methodParamType.equals(paramType)
526:                            || methodParamType.equals(paramTypeResolved)) {
527:                        continue;
528:                    } else {
529:                        return false;
530:                    }
531:                }
532:                return true;
533:            }
534:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.