Source Code Cross Referenced for XSEmptyCM.java in  » XML » xerces-2_9_1 » org » apache » xerces » impl » xs » models » 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 » XML » xerces 2_9_1 » org.apache.xerces.impl.xs.models 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package org.apache.xerces.impl.xs.models;
019:
020:        import org.apache.xerces.xni.QName;
021:        import org.apache.xerces.impl.xs.SubstitutionGroupHandler;
022:        import org.apache.xerces.impl.xs.XMLSchemaException;
023:
024:        import java.util.Vector;
025:
026:        /**
027:         * XSEmptyCM is a derivative of the abstract content model base class that
028:         * handles a content model with no children (elements).
029:         *
030:         * This model validated on the way in.
031:         *
032:         * @xerces.internal 
033:         *
034:         * @author Elena Litani, IBM
035:         * @author Lisa Martin, IBM
036:         * @version $Id: XSEmptyCM.java 573322 2007-09-06 16:48:47Z peterjm $
037:         */
038:        public class XSEmptyCM implements  XSCMValidator {
039:
040:            //
041:            // Constants
042:            //
043:
044:            // start the content model: did not see any children
045:            private static final short STATE_START = 0;
046:
047:            private static final Vector EMPTY = new Vector(0);
048:
049:            //
050:            // Data
051:            //
052:
053:            //
054:            // XSCMValidator methods
055:            //
056:
057:            /**
058:             * This methods to be called on entering a first element whose type
059:             * has this content model. It will return the initial state of the content model
060:             *
061:             * @return Start state of the content model
062:             */
063:            public int[] startContentModel() {
064:                return (new int[] { STATE_START });
065:            }
066:
067:            /**
068:             * The method corresponds to one transaction in the content model.
069:             *
070:             * @param elementName the qualified name of the element
071:             * @param currentState Current state
072:             * @param subGroupHandler the substitution group handler
073:             * @return element index corresponding to the element from the Schema grammar
074:             */
075:            public Object oneTransition(QName elementName, int[] currentState,
076:                    SubstitutionGroupHandler subGroupHandler) {
077:
078:                // error state
079:                if (currentState[0] < 0) {
080:                    currentState[0] = XSCMValidator.SUBSEQUENT_ERROR;
081:                    return null;
082:                }
083:
084:                currentState[0] = XSCMValidator.FIRST_ERROR;
085:                return null;
086:            }
087:
088:            /**
089:             * The method indicates the end of list of children
090:             *
091:             * @param currentState Current state of the content model
092:             * @return true if the last state was a valid final state
093:             */
094:            public boolean endContentModel(int[] currentState) {
095:                boolean isFinal = false;
096:                int state = currentState[0];
097:
098:                // restore content model state:
099:
100:                // error
101:                if (state < 0) {
102:                    return false;
103:                }
104:
105:                return true;
106:            }
107:
108:            /**
109:             * check whether this content violates UPA constraint.
110:             *
111:             * @param subGroupHandler the substitution group handler
112:             * @return true if this content model contains other or list wildcard
113:             */
114:            public boolean checkUniqueParticleAttribution(
115:                    SubstitutionGroupHandler subGroupHandler)
116:                    throws XMLSchemaException {
117:                return false;
118:            }
119:
120:            /**
121:             * Check which elements are valid to appear at this point. This method also
122:             * works if the state is in error, in which case it returns what should
123:             * have been seen.
124:             * 
125:             * @param state  the current state
126:             * @return       a Vector whose entries are instances of
127:             *               either XSWildcardDecl or XSElementDecl.
128:             */
129:            public Vector whatCanGoHere(int[] state) {
130:                return EMPTY;
131:            }
132:
133:            public boolean isCompactedForUPA() {
134:                return false;
135:            }
136:        } // class XSEmptyCM
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.