Source Code Cross Referenced for ExpressionValidateVisitor.java in  » Net » Terracotta » com » tc » aspectwerkz » expression » 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.expression 
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.expression;
005:
006:        import java.util.List;
007:
008:        import com.tc.aspectwerkz.expression.ast.*;
009:        import com.tc.aspectwerkz.expression.regexp.TypePattern;
010:
011:        /**
012:         * The visitor that extract all possible arguments referenced by the expression.
013:         * <p/>
014:         * TODO handle pointcut reference and handle parameter transition
015:         * + checks as done in the ArgIndexVisitor for this / target compliance.
016:         *
017:         * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur </a>
018:         */
019:        public class ExpressionValidateVisitor implements 
020:                ExpressionParserVisitor {
021:
022:            protected Node m_root;
023:            protected String m_expression;
024:            protected String m_namespace;
025:
026:            /**
027:             * Creates a new expression.
028:             *
029:             * @param expression the expression as a string
030:             * @param namespace  the namespace
031:             * @param root       the AST root
032:             */
033:            public ExpressionValidateVisitor(final String expression,
034:                    final String namespace, final Node root) {
035:                m_expression = expression;
036:                m_namespace = namespace;
037:                m_root = root;
038:            }
039:
040:            /**
041:             * Populate data with the possible arguments
042:             *
043:             * @param data a list to feed with Strings
044:             */
045:            public void populate(List data) {
046:                visit(m_root, data);
047:            }
048:
049:            // ============ Boot strap =============
050:            public Object visit(Node node, Object data) {
051:                return node.jjtGetChild(0).jjtAccept(this , data);
052:            }
053:
054:            public Object visit(SimpleNode node, Object data) {
055:                return node.jjtGetChild(0).jjtAccept(this , data);
056:            }
057:
058:            public Object visit(ASTRoot node, Object data) {
059:                return node.jjtGetChild(0).jjtAccept(this , data);
060:            }
061:
062:            public Object visit(ASTExpression node, Object data) {
063:                return node.jjtGetChild(0).jjtAccept(this , data);
064:            }
065:
066:            // ============ Logical operators =============
067:            public Object visit(ASTOr node, Object data) {
068:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
069:                    List args = (List) node.jjtGetChild(i)
070:                            .jjtAccept(this , data);
071:                    //((List) data).addAll(args);
072:                }
073:                return data;
074:            }
075:
076:            public Object visit(ASTAnd node, Object data) {
077:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
078:                    node.jjtGetChild(i).jjtAccept(this , data);
079:                }
080:                return data;
081:            }
082:
083:            public Object visit(ASTNot node, Object data) {
084:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
085:                    node.jjtGetChild(i).jjtAccept(this , data);
086:                }
087:                return data;
088:            }
089:
090:            // ============ Pointcut types =============
091:            public Object visit(ASTPointcutReference node, Object data) {
092:                // visit the args - if any
093:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
094:                    node.jjtGetChild(i).jjtAccept(this , data);
095:                }
096:                return data;
097:            }
098:
099:            public Object visit(ASTExecution node, Object data) {
100:                return data;
101:            }
102:
103:            public Object visit(ASTCall node, Object data) {
104:                return data;
105:            }
106:
107:            public Object visit(ASTSet node, Object data) {
108:                return data;
109:            }
110:
111:            public Object visit(ASTGet node, Object data) {
112:                return data;
113:            }
114:
115:            public Object visit(ASTHandler node, Object data) {
116:                return data;
117:            }
118:
119:            public Object visit(ASTStaticInitialization node, Object data) {
120:                return data;
121:            }
122:
123:            public Object visit(ASTIf node, Object data) {
124:                return data;
125:            }
126:
127:            public Object visit(ASTWithin node, Object data) {
128:                return data;
129:            }
130:
131:            public Object visit(ASTWithinCode node, Object data) {
132:                return data;
133:            }
134:
135:            public Object visit(ASTHasMethod node, Object data) {
136:                return data;
137:            }
138:
139:            public Object visit(ASTHasField node, Object data) {
140:                return data;
141:            }
142:
143:            public Object visit(ASTCflow node, Object data) {
144:                // visit the sub expression
145:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
146:                    node.jjtGetChild(i).jjtAccept(this , data);
147:                }
148:                return data;
149:            }
150:
151:            public Object visit(ASTCflowBelow node, Object data) {
152:                // visit the sub expression
153:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
154:                    node.jjtGetChild(i).jjtAccept(this , data);
155:                }
156:                return data;
157:            }
158:
159:            public Object visit(ASTTarget node, Object data) {
160:                ((List) data).add(node.getIdentifier());
161:                return data;
162:            }
163:
164:            public Object visit(ASTThis node, Object data) {
165:                ((List) data).add(node.getIdentifier());
166:                return data;
167:            }
168:
169:            // ============ Patterns =============
170:            public Object visit(ASTClassPattern node, Object data) {
171:                return data;
172:            }
173:
174:            public Object visit(ASTMethodPattern node, Object data) {
175:                return data;
176:            }
177:
178:            public Object visit(ASTConstructorPattern node, Object data) {
179:                return data;
180:            }
181:
182:            public Object visit(ASTFieldPattern node, Object data) {
183:                return data;
184:            }
185:
186:            public Object visit(ASTParameter node, Object data) {
187:                return data;
188:            }
189:
190:            public Object visit(ASTArgs node, Object data) {
191:                for (int i = 0; i < node.jjtGetNumChildren(); i++) {
192:                    List args = (List) node.jjtGetChild(i)
193:                            .jjtAccept(this , data);
194:                    ((List) data).addAll(args);
195:                }
196:                return data;
197:            }
198:
199:            public Object visit(ASTArgParameter node, Object data) {
200:                TypePattern typePattern = node.getTypePattern();
201:                ((List) data).add(typePattern.getPattern());
202:                return data;
203:            }
204:
205:            public Object visit(ASTAttribute node, Object data) {
206:                return data;
207:            }
208:
209:            public Object visit(ASTModifier node, Object data) {
210:                return data;
211:            }
212:
213:            /**
214:             * Returns the string representation of the expression.
215:             *
216:             * @return
217:             */
218:            public String toString() {
219:                return m_expression;
220:            }
221:
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.