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 foreignAttributes extends NGCCHandler {
044: private ForeignAttributesImpl current;
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 foreignAttributes(NGCCHandler parent,
056: NGCCEventSource source, NGCCRuntimeEx runtime, int cookie,
057: ForeignAttributesImpl _current) {
058: super (source, parent, cookie);
059: $runtime = runtime;
060: this .current = _current;
061: $_ngcc_current_state = 0;
062: }
063:
064: public foreignAttributes(NGCCRuntimeEx runtime,
065: ForeignAttributesImpl _current) {
066: this (null, runtime, runtime, -1, _current);
067: }
068:
069: public void enterElement(String $__uri, String $__local,
070: String $__qname, Attributes $attrs) throws SAXException {
071: int $ai;
072: $uri = $__uri;
073: $localName = $__local;
074: $qname = $__qname;
075: switch ($_ngcc_current_state) {
076: case 0: {
077: revertToParentFromEnterElement(makeResult(), super ._cookie,
078: $__uri, $__local, $__qname, $attrs);
079: }
080: break;
081: default: {
082: unexpectedEnterElement($__qname);
083: }
084: break;
085: }
086: }
087:
088: public void leaveElement(String $__uri, String $__local,
089: String $__qname) throws SAXException {
090: int $ai;
091: $uri = $__uri;
092: $localName = $__local;
093: $qname = $__qname;
094: switch ($_ngcc_current_state) {
095: case 0: {
096: revertToParentFromLeaveElement(makeResult(), super ._cookie,
097: $__uri, $__local, $__qname);
098: }
099: break;
100: default: {
101: unexpectedLeaveElement($__qname);
102: }
103: break;
104: }
105: }
106:
107: public void enterAttribute(String $__uri, String $__local,
108: String $__qname) throws SAXException {
109: int $ai;
110: $uri = $__uri;
111: $localName = $__local;
112: $qname = $__qname;
113: switch ($_ngcc_current_state) {
114: case 0: {
115: revertToParentFromEnterAttribute(makeResult(),
116: super ._cookie, $__uri, $__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(makeResult(),
135: super ._cookie, $__uri, $__local, $__qname);
136: }
137: break;
138: default: {
139: unexpectedLeaveAttribute($__qname);
140: }
141: break;
142: }
143: }
144:
145: public void text(String $value) throws SAXException {
146: int $ai;
147: switch ($_ngcc_current_state) {
148: case 0: {
149: revertToParentFromText(makeResult(), super ._cookie, $value);
150: }
151: break;
152: }
153: }
154:
155: public void onChildCompleted(Object $__result__, int $__cookie__,
156: boolean $__needAttCheck__) throws SAXException {
157: switch ($__cookie__) {
158: }
159: }
160:
161: public boolean accepted() {
162: return (($_ngcc_current_state == 0));
163: }
164:
165: ForeignAttributesImpl makeResult() {
166: return $runtime.parseForeignAttributes(current);
167: }
168:
169: }
|