001: /* this file is generated by RelaxNGCC */
002: package com.sun.xml.xsom.impl.parser.state;
003:
004: import org.xml.sax.SAXException;
005: import org.xml.sax.XMLReader;
006: import org.xml.sax.Attributes;
007: import com.sun.xml.xsom.impl.parser.NGCCRuntimeEx;
008:
009: import com.sun.xml.xsom.*;
010: import com.sun.xml.xsom.parser.*;
011: import com.sun.xml.xsom.impl.*;
012: import com.sun.xml.xsom.impl.parser.*;
013: import org.xml.sax.Locator;
014: import org.xml.sax.ContentHandler;
015: import org.xml.sax.helpers.*;
016: import java.util.*;
017:
018: class ersSet extends NGCCHandler {
019: private String v;
020: protected final NGCCRuntimeEx $runtime;
021: private int $_ngcc_current_state;
022: protected String $uri;
023: protected String $localName;
024: protected String $qname;
025:
026: public final NGCCRuntime getRuntime() {
027: return ($runtime);
028: }
029:
030: public ersSet(NGCCHandler parent, NGCCEventSource source,
031: NGCCRuntimeEx runtime, int cookie) {
032: super (source, parent, cookie);
033: $runtime = runtime;
034: $_ngcc_current_state = 1;
035: }
036:
037: public ersSet(NGCCRuntimeEx runtime) {
038: this (null, runtime, runtime, -1);
039: }
040:
041: public void enterElement(String $__uri, String $__local,
042: String $__qname, Attributes $attrs) throws SAXException {
043: int $ai;
044: $uri = $__uri;
045: $localName = $__local;
046: $qname = $__qname;
047: switch ($_ngcc_current_state) {
048: case 0: {
049: revertToParentFromEnterElement(makeResult(), super ._cookie,
050: $__uri, $__local, $__qname, $attrs);
051: }
052: break;
053: default: {
054: unexpectedEnterElement($__qname);
055: }
056: break;
057: }
058: }
059:
060: public void leaveElement(String $__uri, String $__local,
061: String $__qname) throws SAXException {
062: int $ai;
063: $uri = $__uri;
064: $localName = $__local;
065: $qname = $__qname;
066: switch ($_ngcc_current_state) {
067: case 0: {
068: revertToParentFromLeaveElement(makeResult(), super ._cookie,
069: $__uri, $__local, $__qname);
070: }
071: break;
072: default: {
073: unexpectedLeaveElement($__qname);
074: }
075: break;
076: }
077: }
078:
079: public void enterAttribute(String $__uri, String $__local,
080: String $__qname) throws SAXException {
081: int $ai;
082: $uri = $__uri;
083: $localName = $__local;
084: $qname = $__qname;
085: switch ($_ngcc_current_state) {
086: case 0: {
087: revertToParentFromEnterAttribute(makeResult(),
088: super ._cookie, $__uri, $__local, $__qname);
089: }
090: break;
091: default: {
092: unexpectedEnterAttribute($__qname);
093: }
094: break;
095: }
096: }
097:
098: public void leaveAttribute(String $__uri, String $__local,
099: String $__qname) throws SAXException {
100: int $ai;
101: $uri = $__uri;
102: $localName = $__local;
103: $qname = $__qname;
104: switch ($_ngcc_current_state) {
105: case 0: {
106: revertToParentFromLeaveAttribute(makeResult(),
107: super ._cookie, $__uri, $__local, $__qname);
108: }
109: break;
110: default: {
111: unexpectedLeaveAttribute($__qname);
112: }
113: break;
114: }
115: }
116:
117: public void text(String $value) throws SAXException {
118: int $ai;
119: switch ($_ngcc_current_state) {
120: case 1: {
121: v = $value;
122: $_ngcc_current_state = 0;
123: }
124: break;
125: case 0: {
126: revertToParentFromText(makeResult(), super ._cookie, $value);
127: }
128: break;
129: }
130: }
131:
132: public void onChildCompleted(Object $__result__, int $__cookie__,
133: boolean $__needAttCheck__) throws SAXException {
134: switch ($__cookie__) {
135: }
136: }
137:
138: public boolean accepted() {
139: return (($_ngcc_current_state == 0));
140: }
141:
142: private Integer makeResult() {
143: if (v == null)
144: return new Integer($runtime.blockDefault);
145:
146: if (v.indexOf("#all") != -1)
147: return new Integer(XSType.EXTENSION | XSType.RESTRICTION
148: | XSType.SUBSTITUTION);
149:
150: int r = 0;
151:
152: if (v.indexOf("extension") != -1)
153: r |= XSType.EXTENSION;
154: if (v.indexOf("restriction") != -1)
155: r |= XSType.RESTRICTION;
156: if (v.indexOf("substitution") != -1)
157: r |= XSType.SUBSTITUTION;
158:
159: return new Integer(r);
160: }
161:
162: }
|