Source Code Cross Referenced for NGCCHandler.java in  » 6.0-JDK-Modules » jaxb-xjc » com » sun » tools » jxc » gen » config » 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 » 6.0 JDK Modules » jaxb xjc » com.sun.tools.jxc.gen.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.tools.jxc.gen.config;
002:
003:        import org.xml.sax.Attributes;
004:        import org.xml.sax.SAXException;
005:
006:        /**
007:         * 
008:         * 
009:         * @version $Id: NGCCHandler.java,v 1.9 2002/09/29 02:55:48 okajima Exp $
010:         * @author Kohsuke Kawaguchi (kk@kohsuke.org)
011:         */
012:        public abstract class NGCCHandler implements  NGCCEventReceiver {
013:            protected NGCCHandler(NGCCEventSource source, NGCCHandler parent,
014:                    int parentCookie) {
015:
016:                _parent = parent;
017:                _source = source;
018:                _cookie = parentCookie;
019:            }
020:
021:            /**
022:             * Parent NGCCHandler, if any.
023:             * If this is the root handler, this field will be null.
024:             */
025:            protected final NGCCHandler _parent;
026:
027:            /**
028:             * Event source.
029:             */
030:            protected final NGCCEventSource _source;
031:
032:            /**
033:             * This method will be implemented by the generated code
034:             * and returns a reference to the current runtime.
035:             */
036:            protected abstract NGCCRuntime getRuntime();
037:
038:            /**
039:             * Cookie assigned by the parent.
040:             * 
041:             * This value will be passed to the onChildCompleted handler
042:             * of the parent.
043:             */
044:            protected final int _cookie;
045:
046:            // used to copy parameters to (enter|leave)(Element|Attribute) events.
047:            //protected String localName,uri,qname;
048:
049:            /**
050:             * Notifies the completion of a child object.
051:             * 
052:             * @param result
053:             *      The parsing result of the child state.
054:             * @param cookie
055:             *      The cookie value passed to the child object
056:             *      when it is created.
057:             * @param needAttCheck
058:             *      This flag is true when the callee needs to call the
059:             *      processAttribute method to check attribute transitions.
060:             *      This flag is set to false when this method is triggered by
061:             *      attribute transition.
062:             */
063:            protected abstract void onChildCompleted(Object result, int cookie,
064:                    boolean needAttCheck) throws SAXException;
065:
066:            //
067:            //
068:            // spawns a new child object from event handlers.
069:            //
070:            //
071:            public void spawnChildFromEnterElement(NGCCEventReceiver child,
072:                    String uri, String localname, String qname, Attributes atts)
073:                    throws SAXException {
074:
075:                int id = _source.replace(this , child);
076:                _source.sendEnterElement(id, uri, localname, qname, atts);
077:            }
078:
079:            public void spawnChildFromEnterAttribute(NGCCEventReceiver child,
080:                    String uri, String localname, String qname)
081:                    throws SAXException {
082:
083:                int id = _source.replace(this , child);
084:                _source.sendEnterAttribute(id, uri, localname, qname);
085:            }
086:
087:            public void spawnChildFromLeaveElement(NGCCEventReceiver child,
088:                    String uri, String localname, String qname)
089:                    throws SAXException {
090:
091:                int id = _source.replace(this , child);
092:                _source.sendLeaveElement(id, uri, localname, qname);
093:            }
094:
095:            public void spawnChildFromLeaveAttribute(NGCCEventReceiver child,
096:                    String uri, String localname, String qname)
097:                    throws SAXException {
098:
099:                int id = _source.replace(this , child);
100:                _source.sendLeaveAttribute(id, uri, localname, qname);
101:            }
102:
103:            public void spawnChildFromText(NGCCEventReceiver child, String value)
104:                    throws SAXException {
105:
106:                int id = _source.replace(this , child);
107:                _source.sendText(id, value);
108:            }
109:
110:            //
111:            //
112:            // reverts to the parent object from the child handler
113:            //
114:            //
115:            public void revertToParentFromEnterElement(Object result,
116:                    int cookie, String uri, String local, String qname,
117:                    Attributes atts) throws SAXException {
118:
119:                int id = _source.replace(this , _parent);
120:                _parent.onChildCompleted(result, cookie, true);
121:                _source.sendEnterElement(id, uri, local, qname, atts);
122:            }
123:
124:            public void revertToParentFromLeaveElement(Object result,
125:                    int cookie, String uri, String local, String qname)
126:                    throws SAXException {
127:
128:                if (uri == NGCCRuntime.IMPOSSIBLE && uri == local
129:                        && uri == qname && _parent == null)
130:                    // all the handlers are properly finalized.
131:                    // quit now, because we don't have any more NGCCHandler.
132:                    // see the endDocument handler for detail
133:                    return;
134:
135:                int id = _source.replace(this , _parent);
136:                _parent.onChildCompleted(result, cookie, true);
137:                _source.sendLeaveElement(id, uri, local, qname);
138:            }
139:
140:            public void revertToParentFromEnterAttribute(Object result,
141:                    int cookie, String uri, String local, String qname)
142:                    throws SAXException {
143:
144:                int id = _source.replace(this , _parent);
145:                _parent.onChildCompleted(result, cookie, true);
146:                _source.sendEnterAttribute(id, uri, local, qname);
147:            }
148:
149:            public void revertToParentFromLeaveAttribute(Object result,
150:                    int cookie, String uri, String local, String qname)
151:                    throws SAXException {
152:
153:                int id = _source.replace(this , _parent);
154:                _parent.onChildCompleted(result, cookie, true);
155:                _source.sendLeaveAttribute(id, uri, local, qname);
156:            }
157:
158:            public void revertToParentFromText(Object result, int cookie,
159:                    String text) throws SAXException {
160:
161:                int id = _source.replace(this , _parent);
162:                _parent.onChildCompleted(result, cookie, true);
163:                _source.sendText(id, text);
164:            }
165:
166:            //
167:            //
168:            // error handler
169:            //
170:            //
171:            public void unexpectedEnterElement(String qname)
172:                    throws SAXException {
173:                getRuntime().unexpectedX('<' + qname + '>');
174:            }
175:
176:            public void unexpectedLeaveElement(String qname)
177:                    throws SAXException {
178:                getRuntime().unexpectedX("</" + qname + '>');
179:            }
180:
181:            public void unexpectedEnterAttribute(String qname)
182:                    throws SAXException {
183:                getRuntime().unexpectedX('@' + qname);
184:            }
185:
186:            public void unexpectedLeaveAttribute(String qname)
187:                    throws SAXException {
188:                getRuntime().unexpectedX("/@" + qname);
189:            }
190:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.