Source Code Cross Referenced for SimpleNode.java in  » Workflow-Engines » obe-1.0 » org » obe » sql » 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 » Workflow Engines » obe 1.0 » org.obe.sql 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.obe.sql;
002:
003:        import java.io.IOException;
004:        import java.io.Writer;
005:
006:        public class SimpleNode implements  Node, SQLParserTreeConstants {
007:            protected Node parent;
008:            protected Node[] children;
009:            protected int id;
010:            protected SQLParser parser;
011:            protected String text;
012:
013:            public static SimpleNode jjtCreate(int id) {
014:                SimpleNode node;
015:                switch (id) {
016:                case JJTSQLANDEXPR:
017:                    node = new SQLAndExpr(id);
018:                    break;
019:                case JJTSQLBETWEENCLAUSE:
020:                    node = new SQLBetweenClause(id);
021:                    break;
022:                case JJTSQLCOLREF:
023:                    node = new SQLColRef(id);
024:                    break;
025:                case JJTSQLCOMPAREEXPR:
026:                    node = new SQLCompareExpr(id);
027:                    break;
028:                case JJTSQLCOMPAREEXPRRIGHT:
029:                    node = new SQLCompareExprRight(id);
030:                    break;
031:                case JJTSQLCOMPAREOP:
032:                    node = new SQLCompareOp(id);
033:                    break;
034:                //            case JJTSQLCURSORARGS:
035:                //            case JJTSQLCURSORCLOSE:
036:                //            case JJTSQLDATATYPE:
037:                //            case JJTSQLDELETE:
038:                //            case JJTSQLEXISTSCLAUSE:
039:                //            case JJTSQLFUNCTION:
040:                //                node = new SQLFunction(id);
041:                //                break;
042:                //            case JJTSQLFUNCTIONARGS:
043:                //                node = new SQLFunctionArgs(id);
044:                //                break;
045:                //            case JJTSQLGROUPBY:
046:                case JJTSQLINCLAUSE:
047:                    node = new SQLInClause(id);
048:                    break;
049:                //            case JJTSQLINSERT:
050:                case JJTSQLISCLAUSE:
051:                    node = new SQLIsClause(id);
052:                    break;
053:                //            case JJTSQLLEFTJOINCLAUSE:
054:                case JJTSQLLIKECLAUSE:
055:                    node = new SQLLikeClause(id);
056:                    break;
057:                case JJTSQLLITERAL:
058:                    node = new SQLLiteral(id);
059:                    break;
060:                case JJTSQLLVALUE:
061:                    node = new SQLLvalue(id);
062:                    break;
063:                case JJTSQLLVALUETERM:
064:                    node = new SQLLvalueTerm(id);
065:                    break;
066:                case JJTSQLNOTEXPR:
067:                    node = new SQLNotExpr(id);
068:                    break;
069:                //            case JJTSQLORDERBY:
070:                //            case JJTSQLORDERBYELEM:
071:                //            case JJTSQLORDERBYLIST:
072:                //            case JJTSQLORDERDIRECTION:
073:                case JJTSQLOREXPR:
074:                    node = new SQLOrExpr(id);
075:                    break;
076:                case JJTSQLPATTERN:
077:                    node = new SQLPattern(id);
078:                    break;
079:                case JJTSQLPRODUCTEXPR:
080:                    node = new SQLProductExpr(id);
081:                    break;
082:                //            case JJTSQLRIGHTJOINCLAUSE:
083:                //            case JJTSQLSELECT:
084:                //            case JJTSQLSELECTCOLS:
085:                //            case JJTSQLSELECTLIST:
086:                //            case JJTSQLSTATEMENT:
087:                case JJTSQLSUMEXPR:
088:                    node = new SQLSumExpr(id);
089:                    break;
090:                //            case JJTSQLTABLELIST:
091:                //            case JJTSQLTABLEREF:
092:                case JJTSQLTERM:
093:                    node = new SQLTerm(id);
094:                    break;
095:                case JJTSQLUNARYEXPR:
096:                    node = new SQLUnaryExpr(id);
097:                    break;
098:                //            case JJTSQLUPDATE:
099:                //            case JJTSQLUPDATEASSIGNMENT:
100:                case JJTSQLLVALUEELEMENT:
101:                    node = new SQLLValueElement(id);
102:                    break;
103:                case JJTSQLLVALUELIST:
104:                    node = new SQLLValueList(id);
105:                    break;
106:                //            case JJTSQLWHERE:
107:                default:
108:                    node = new SimpleNode(id);
109:                }
110:                return node;
111:            }
112:
113:            public SimpleNode(int i) {
114:                id = i;
115:                text = SQLParserTreeConstants.jjtNodeName[i];
116:            }
117:
118:            public SimpleNode(SQLParser p, int i) {
119:                this (i);
120:                parser = p;
121:            }
122:
123:            public int getId() {
124:                return id;
125:            }
126:
127:            public String getText() {
128:                return text;
129:            }
130:
131:            public void setText(String text) {
132:                this .text = text;
133:            }
134:
135:            public void jjtOpen() {
136:            }
137:
138:            public void jjtClose() {
139:            }
140:
141:            public void jjtSetParent(Node n) {
142:                parent = n;
143:            }
144:
145:            public Node jjtGetParent() {
146:                return parent;
147:            }
148:
149:            public void jjtAddChild(Node n, int i) {
150:                if (children == null) {
151:                    children = new Node[i + 1];
152:                } else if (i >= children.length) {
153:                    Node c[] = new Node[i + 1];
154:                    System.arraycopy(children, 0, c, 0, children.length);
155:                    children = c;
156:                }
157:                children[i] = n;
158:            }
159:
160:            public Node jjtGetChild(int i) {
161:                return children[i];
162:            }
163:
164:            public int jjtGetNumChildren() {
165:                return children == null ? 0 : children.length;
166:            }
167:
168:            /** Accept the visitor. **/
169:            public Object jjtAccept(SQLParserVisitor visitor, Object data) {
170:                return visitor.visit(this , data);
171:            }
172:
173:            /** Accept the visitor. **/
174:            public Object childrenAccept(SQLParserVisitor visitor, Object data) {
175:                if (children != null) {
176:                    for (int i = 0; i < children.length; ++i)
177:                        children[i].jjtAccept(visitor, data);
178:                }
179:                return data;
180:            }
181:
182:            /* You can override these two methods in subclasses of SimpleNode to
183:               customize the way the node appears when the tree is dumped.  If
184:               your output uses more than one line you should override
185:               toString(String), otherwise overriding toString() is probably all
186:               you need to do. */
187:
188:            public String toString() {
189:                return SQLParserTreeConstants.jjtNodeName[id];
190:            }
191:
192:            public String toString(String prefix) {
193:                return prefix + toString();
194:            }
195:
196:            /* Override this method if you want to customize how the node dumps
197:               out its children. */
198:
199:            public void dump(String prefix) {
200:                System.out.println(prefix + this );
201:                if (children != null) {
202:                    prefix += ' ';
203:                    for (int i = 0; i < children.length; ++i) {
204:                        SimpleNode n = (SimpleNode) children[i];
205:                        if (n != null)
206:                            n.dump(prefix);
207:                    }
208:                }
209:            }
210:
211:            public void invert() {
212:                throw new UnsupportedOperationException("invert");
213:            }
214:
215:            public void addOperator(String name) {
216:                throw new UnsupportedOperationException("addOperator");
217:            }
218:
219:            public void addPathElement(String name) {
220:                throw new UnsupportedOperationException("addPathElement");
221:            }
222:
223:            public void setName(String name) {
224:                throw new UnsupportedOperationException("setName");
225:            }
226:
227:            public void setString(String name) {
228:                throw new UnsupportedOperationException("setString");
229:            }
230:
231:            public void setInteger(String name) {
232:                throw new UnsupportedOperationException("setInteger");
233:            }
234:
235:            public void setDouble(String name) {
236:                throw new UnsupportedOperationException("setDouble");
237:            }
238:
239:            public void setParameter() {
240:                throw new UnsupportedOperationException("setParameter");
241:            }
242:
243:            public boolean isParameter() {
244:                throw new UnsupportedOperationException("isParameter");
245:            }
246:
247:            public void write(Writer out) throws IOException {
248:                if (children != null) {
249:                    for (int i = 0; i < children.length; ++i) {
250:                        SimpleNode n = (SimpleNode) children[i];
251:                        if (n != null)
252:                            n.write(out);
253:                    }
254:                }
255:            }
256:
257:            public Object execute(Object context) {
258:                throw new UnsupportedOperationException();
259:            }
260:
261:            public Object execute(Object context, Object lhs) {
262:                throw new UnsupportedOperationException(toString());
263:            }
264:
265:            public Object execute(Object context, Object lhs, Object rhs) {
266:                throw new UnsupportedOperationException(toString());
267:            }
268:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.