001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: /* this file is generated by RelaxNGCC */
027: package com.sun.xml.internal.xsom.impl.parser.state;
028:
029: import org.xml.sax.SAXException;
030: import org.xml.sax.XMLReader;
031: import org.xml.sax.Attributes;
032: import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
033:
034: import com.sun.xml.internal.xsom.*;
035: import com.sun.xml.internal.xsom.parser.*;
036: import com.sun.xml.internal.xsom.impl.*;
037: import com.sun.xml.internal.xsom.impl.parser.*;
038: import org.xml.sax.Locator;
039: import org.xml.sax.ContentHandler;
040: import org.xml.sax.helpers.*;
041: import java.util.*;
042:
043: class qualification extends NGCCHandler {
044: private String text;
045: protected final NGCCRuntimeEx $runtime;
046: private int $_ngcc_current_state;
047: protected String $uri;
048: protected String $localName;
049: protected String $qname;
050:
051: public final NGCCRuntime getRuntime() {
052: return ($runtime);
053: }
054:
055: public qualification(NGCCHandler parent, NGCCEventSource source,
056: NGCCRuntimeEx runtime, int cookie) {
057: super (source, parent, cookie);
058: $runtime = runtime;
059: $_ngcc_current_state = 1;
060: }
061:
062: public qualification(NGCCRuntimeEx runtime) {
063: this (null, runtime, runtime, -1);
064: }
065:
066: public void enterElement(String $__uri, String $__local,
067: String $__qname, Attributes $attrs) throws SAXException {
068: int $ai;
069: $uri = $__uri;
070: $localName = $__local;
071: $qname = $__qname;
072: switch ($_ngcc_current_state) {
073: case 0: {
074: revertToParentFromEnterElement(new Boolean(text.trim()
075: .equals("qualified")), super ._cookie, $__uri,
076: $__local, $__qname, $attrs);
077: }
078: break;
079: default: {
080: unexpectedEnterElement($__qname);
081: }
082: break;
083: }
084: }
085:
086: public void leaveElement(String $__uri, String $__local,
087: String $__qname) throws SAXException {
088: int $ai;
089: $uri = $__uri;
090: $localName = $__local;
091: $qname = $__qname;
092: switch ($_ngcc_current_state) {
093: case 0: {
094: revertToParentFromLeaveElement(new Boolean(text.trim()
095: .equals("qualified")), super ._cookie, $__uri,
096: $__local, $__qname);
097: }
098: break;
099: default: {
100: unexpectedLeaveElement($__qname);
101: }
102: break;
103: }
104: }
105:
106: public void enterAttribute(String $__uri, String $__local,
107: String $__qname) throws SAXException {
108: int $ai;
109: $uri = $__uri;
110: $localName = $__local;
111: $qname = $__qname;
112: switch ($_ngcc_current_state) {
113: case 0: {
114: revertToParentFromEnterAttribute(new Boolean(text.trim()
115: .equals("qualified")), super ._cookie, $__uri,
116: $__local, $__qname);
117: }
118: break;
119: default: {
120: unexpectedEnterAttribute($__qname);
121: }
122: break;
123: }
124: }
125:
126: public void leaveAttribute(String $__uri, String $__local,
127: String $__qname) throws SAXException {
128: int $ai;
129: $uri = $__uri;
130: $localName = $__local;
131: $qname = $__qname;
132: switch ($_ngcc_current_state) {
133: case 0: {
134: revertToParentFromLeaveAttribute(new Boolean(text.trim()
135: .equals("qualified")), super ._cookie, $__uri,
136: $__local, $__qname);
137: }
138: break;
139: default: {
140: unexpectedLeaveAttribute($__qname);
141: }
142: break;
143: }
144: }
145:
146: public void text(String $value) throws SAXException {
147: int $ai;
148: switch ($_ngcc_current_state) {
149: case 0: {
150: revertToParentFromText(new Boolean(text.trim().equals(
151: "qualified")), super ._cookie, $value);
152: }
153: break;
154: case 1: {
155: if ($value.equals("qualified")) {
156: text = $value;
157: $_ngcc_current_state = 0;
158: } else {
159: if ($value.equals("unqualified")) {
160: text = $value;
161: $_ngcc_current_state = 0;
162: }
163: }
164: }
165: break;
166: }
167: }
168:
169: public void onChildCompleted(Object $__result__, int $__cookie__,
170: boolean $__needAttCheck__) throws SAXException {
171: switch ($__cookie__) {
172: }
173: }
174:
175: public boolean accepted() {
176: return (($_ngcc_current_state == 0));
177: }
178:
179: }
|