feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.impl.Ref;
|
||||
import com.sun.xml.internal.xsom.XSContentType;
|
||||
import com.sun.xml.internal.xsom.XSType;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
public final class BaseContentRef implements Ref.ContentType, Patch {
|
||||
private final Ref.Type baseType;
|
||||
private final Locator loc;
|
||||
|
||||
public BaseContentRef(final NGCCRuntimeEx $runtime, Ref.Type _baseType) {
|
||||
this.baseType = _baseType;
|
||||
$runtime.addPatcher(this);
|
||||
$runtime.addErrorChecker(new Patch() {
|
||||
public void run() throws SAXException {
|
||||
XSType t = baseType.getType();
|
||||
if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
|
||||
$runtime.reportError(
|
||||
Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
|
||||
t.getTargetNamespace(), t.getName()), loc);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.loc = $runtime.copyLocator();
|
||||
}
|
||||
|
||||
public XSContentType getContentType() {
|
||||
XSType t = baseType.getType();
|
||||
if(t.asComplexType()!=null)
|
||||
return t.asComplexType().getContentType();
|
||||
else
|
||||
return t.asSimpleType();
|
||||
}
|
||||
|
||||
public void run() throws SAXException {
|
||||
if (baseType instanceof Patch)
|
||||
((Patch) baseType).run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.parser.AnnotationContext;
|
||||
import com.sun.xml.internal.xsom.parser.AnnotationParser;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.EntityResolver;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
/**
|
||||
* AnnotationParser that just ignores annotation.
|
||||
*
|
||||
* <p>
|
||||
* This class doesn't have any state. So it should be used as a singleton.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
|
||||
*/
|
||||
class DefaultAnnotationParser extends AnnotationParser {
|
||||
|
||||
private DefaultAnnotationParser() {}
|
||||
|
||||
public static final AnnotationParser theInstance = new DefaultAnnotationParser();
|
||||
|
||||
public ContentHandler getContentHandler(
|
||||
AnnotationContext contest, String elementName,
|
||||
ErrorHandler errorHandler, EntityResolver entityResolver ) {
|
||||
return new DefaultHandler();
|
||||
}
|
||||
|
||||
public Object getResult( Object existing ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.XSAttGroupDecl;
|
||||
import com.sun.xml.internal.xsom.XSAttributeDecl;
|
||||
import com.sun.xml.internal.xsom.XSComplexType;
|
||||
import com.sun.xml.internal.xsom.XSDeclaration;
|
||||
import com.sun.xml.internal.xsom.XSElementDecl;
|
||||
import com.sun.xml.internal.xsom.XSIdentityConstraint;
|
||||
import com.sun.xml.internal.xsom.XSModelGroupDecl;
|
||||
import com.sun.xml.internal.xsom.XSSchemaSet;
|
||||
import com.sun.xml.internal.xsom.XSSimpleType;
|
||||
import com.sun.xml.internal.xsom.XSTerm;
|
||||
import com.sun.xml.internal.xsom.XSType;
|
||||
import com.sun.xml.internal.xsom.impl.Ref;
|
||||
import com.sun.xml.internal.xsom.impl.SchemaImpl;
|
||||
import com.sun.xml.internal.xsom.impl.UName;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Reference by name.
|
||||
*
|
||||
* UName will be later resolved to a target object,
|
||||
* after all the schemas are parsed.
|
||||
*/
|
||||
public abstract class DelayedRef implements Patch {
|
||||
DelayedRef( PatcherManager _manager, Locator _source, SchemaImpl _schema, UName _name ) {
|
||||
|
||||
this.schema = _schema.getRoot();
|
||||
this.manager = _manager;
|
||||
this.name = _name;
|
||||
this.source = _source;
|
||||
|
||||
if(name==null) throw new InternalError();
|
||||
|
||||
manager.addPatcher(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch implementation. Makes sure that the name resolves
|
||||
* to a schema component.
|
||||
*/
|
||||
public void run() throws SAXException {
|
||||
if(ref==null) // redefinition can set ref without actually resolving the reference
|
||||
resolve();
|
||||
manager = null; // avoid keeping the reference too long
|
||||
name = null;
|
||||
source = null;
|
||||
}
|
||||
|
||||
|
||||
protected final XSSchemaSet schema;
|
||||
private PatcherManager manager;
|
||||
private UName name;
|
||||
/** location in the source file where this reference was made. */
|
||||
private Locator source;
|
||||
|
||||
protected abstract Object resolveReference( UName name );
|
||||
protected abstract String getErrorProperty();
|
||||
|
||||
private Object ref=null;
|
||||
protected final Object _get() {
|
||||
if(ref==null) throw new InternalError("unresolved reference");
|
||||
return ref;
|
||||
}
|
||||
|
||||
private void resolve() throws SAXException {
|
||||
ref = resolveReference(name);
|
||||
if(ref==null)
|
||||
manager.reportError(
|
||||
Messages.format(getErrorProperty(),name.getQualifiedName()),
|
||||
source );
|
||||
}
|
||||
|
||||
/**
|
||||
* If this reference refers to the given declaration,
|
||||
* resolve the reference now. This is used to implement redefinition.
|
||||
*/
|
||||
public void redefine(XSDeclaration d) {
|
||||
if( !d.getTargetNamespace().equals(name.getNamespaceURI())
|
||||
|| !d.getName().equals(name.getName()) )
|
||||
return;
|
||||
|
||||
ref = d;
|
||||
manager = null;
|
||||
name = null;
|
||||
source = null;
|
||||
}
|
||||
|
||||
|
||||
public static class Type extends DelayedRef implements Ref.Type {
|
||||
public Type( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
protected Object resolveReference( UName name ) {
|
||||
Object o = super.schema.getSimpleType(
|
||||
name.getNamespaceURI(), name.getName() );
|
||||
if(o!=null) return o;
|
||||
|
||||
return super.schema.getComplexType(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_TYPE;
|
||||
}
|
||||
|
||||
public XSType getType() { return (XSType)super._get(); }
|
||||
}
|
||||
|
||||
public static class SimpleType extends DelayedRef implements Ref.SimpleType {
|
||||
public SimpleType( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
public XSSimpleType getType() { return (XSSimpleType)_get(); }
|
||||
|
||||
protected Object resolveReference( UName name ) {
|
||||
return super.schema.getSimpleType(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_SIMPLETYPE;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComplexType extends DelayedRef implements Ref.ComplexType {
|
||||
public ComplexType( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
protected Object resolveReference( UName name ) {
|
||||
return super.schema.getComplexType(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_COMPLEXTYPE;
|
||||
}
|
||||
|
||||
public XSComplexType getType() { return (XSComplexType)super._get(); }
|
||||
}
|
||||
|
||||
public static class Element extends DelayedRef implements Ref.Element {
|
||||
public Element( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
protected Object resolveReference( UName name ) {
|
||||
return super.schema.getElementDecl(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_ELEMENT;
|
||||
}
|
||||
|
||||
public XSElementDecl get() { return (XSElementDecl)super._get(); }
|
||||
public XSTerm getTerm() { return get(); }
|
||||
}
|
||||
|
||||
public static class ModelGroup extends DelayedRef implements Ref.Term {
|
||||
public ModelGroup( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
protected Object resolveReference( UName name ) {
|
||||
return super.schema.getModelGroupDecl(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_MODELGROUP;
|
||||
}
|
||||
|
||||
public XSModelGroupDecl get() { return (XSModelGroupDecl)super._get(); }
|
||||
public XSTerm getTerm() { return get(); }
|
||||
}
|
||||
|
||||
public static class AttGroup extends DelayedRef implements Ref.AttGroup {
|
||||
public AttGroup( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
protected Object resolveReference( UName name ) {
|
||||
return super.schema.getAttGroupDecl(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_ATTRIBUTEGROUP;
|
||||
}
|
||||
|
||||
public XSAttGroupDecl get() { return (XSAttGroupDecl)super._get(); }
|
||||
}
|
||||
|
||||
public static class Attribute extends DelayedRef implements Ref.Attribute {
|
||||
public Attribute( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
protected Object resolveReference( UName name ) {
|
||||
return super.schema.getAttributeDecl(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_ATTRIBUTE;
|
||||
}
|
||||
|
||||
public XSAttributeDecl getAttribute() { return (XSAttributeDecl)super._get(); }
|
||||
}
|
||||
|
||||
public static class IdentityConstraint extends DelayedRef implements Ref.IdentityConstraint {
|
||||
public IdentityConstraint( PatcherManager manager, Locator loc, SchemaImpl schema, UName name ) {
|
||||
super(manager,loc,schema,name);
|
||||
}
|
||||
protected Object resolveReference( UName name ) {
|
||||
return super.schema.getIdentityConstraint(
|
||||
name.getNamespaceURI(),
|
||||
name.getName());
|
||||
}
|
||||
|
||||
protected String getErrorProperty() {
|
||||
return Messages.ERR_UNDEFINED_IDENTITY_CONSTRAINT;
|
||||
}
|
||||
|
||||
public XSIdentityConstraint get() { return (XSIdentityConstraint)super._get(); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* Formats error messages.
|
||||
*/
|
||||
public class Messages
|
||||
{
|
||||
/** Loads a string resource and formats it with specified arguments. */
|
||||
public static String format( String property, Object... args ) {
|
||||
String text = ResourceBundle.getBundle(
|
||||
Messages.class.getName()).getString(property);
|
||||
return MessageFormat.format(text,args);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// Message resources
|
||||
//
|
||||
//
|
||||
public static final String ERR_UNDEFINED_SIMPLETYPE =
|
||||
"UndefinedSimpleType"; // arg:1
|
||||
public static final String ERR_UNDEFINED_COMPLEXTYPE =
|
||||
"UndefinedCompplexType"; // arg:1
|
||||
public static final String ERR_UNDEFINED_TYPE =
|
||||
"UndefinedType"; // arg:1
|
||||
public static final String ERR_UNDEFINED_ELEMENT =
|
||||
"UndefinedElement"; // arg:1
|
||||
public static final String ERR_UNDEFINED_MODELGROUP =
|
||||
"UndefinedModelGroup"; // arg:1
|
||||
public static final String ERR_UNDEFINED_ATTRIBUTE =
|
||||
"UndefinedAttribute"; // arg:1
|
||||
public static final String ERR_UNDEFINED_ATTRIBUTEGROUP =
|
||||
"UndefinedAttributeGroup"; // arg:1
|
||||
public static final String ERR_UNDEFINED_IDENTITY_CONSTRAINT =
|
||||
"UndefinedIdentityConstraint"; // arg:1
|
||||
public static final String ERR_UNDEFINED_PREFIX =
|
||||
"UndefinedPrefix"; // arg:1
|
||||
|
||||
public static final String ERR_DOUBLE_DEFINITION =
|
||||
"DoubleDefinition"; // arg:1
|
||||
public static final String ERR_DOUBLE_DEFINITION_ORIGINAL =
|
||||
"DoubleDefinition.Original"; // arg:0
|
||||
|
||||
public static final String ERR_MISSING_SCHEMALOCATION =
|
||||
"MissingSchemaLocation"; // arg:0
|
||||
|
||||
public static final String ERR_ENTITY_RESOLUTION_FAILURE =
|
||||
"EntityResolutionFailure"; // arg:2
|
||||
|
||||
public static final String ERR_SIMPLE_CONTENT_EXPECTED =
|
||||
"SimpleContentExpected"; // arg:2
|
||||
|
||||
public static final String JAXP_UNSUPPORTED_PROPERTY =
|
||||
"JAXPUnsupportedProperty"; // arg:1
|
||||
|
||||
public static final String JAXP_SUPPORTED_PROPERTY =
|
||||
"JAXPSupportedProperty"; // arg:1
|
||||
}
|
||||
@@ -0,0 +1,516 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.XSDeclaration;
|
||||
import com.sun.xml.internal.xsom.XmlString;
|
||||
import com.sun.xml.internal.xsom.XSSimpleType;
|
||||
import com.sun.xml.internal.xsom.impl.ForeignAttributesImpl;
|
||||
import com.sun.xml.internal.xsom.impl.SchemaImpl;
|
||||
import com.sun.xml.internal.xsom.impl.UName;
|
||||
import com.sun.xml.internal.xsom.impl.Const;
|
||||
import com.sun.xml.internal.xsom.impl.parser.state.NGCCRuntime;
|
||||
import com.sun.xml.internal.xsom.impl.parser.state.Schema;
|
||||
import com.sun.xml.internal.xsom.impl.util.Uri;
|
||||
import com.sun.xml.internal.xsom.parser.AnnotationParser;
|
||||
import org.relaxng.datatype.ValidationContext;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.EntityResolver;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
import org.xml.sax.helpers.LocatorImpl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
* NGCCRuntime extended with various utility methods for
|
||||
* parsing XML Schema.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
|
||||
*/
|
||||
public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager {
|
||||
|
||||
/** coordinator. */
|
||||
public final ParserContext parser;
|
||||
|
||||
/** The schema currently being parsed. */
|
||||
public SchemaImpl currentSchema;
|
||||
|
||||
/** The @finalDefault value of the current schema. */
|
||||
public int finalDefault = 0;
|
||||
/** The @blockDefault value of the current schema. */
|
||||
public int blockDefault = 0;
|
||||
|
||||
/**
|
||||
* The @elementFormDefault value of the current schema.
|
||||
* True if local elements are qualified by default.
|
||||
*/
|
||||
public boolean elementFormDefault = false;
|
||||
|
||||
/**
|
||||
* The @attributeFormDefault value of the current schema.
|
||||
* True if local attributes are qualified by default.
|
||||
*/
|
||||
public boolean attributeFormDefault = false;
|
||||
|
||||
/**
|
||||
* True if the current schema is in a chameleon mode.
|
||||
* This changes the way QNames are interpreted.
|
||||
*
|
||||
* Life is very miserable with XML Schema, as you see.
|
||||
*/
|
||||
public boolean chameleonMode = false;
|
||||
|
||||
/**
|
||||
* URI that identifies the schema document.
|
||||
* Maybe null if the system ID is not available.
|
||||
*/
|
||||
private String documentSystemId;
|
||||
|
||||
/**
|
||||
* Keep the local name of elements encountered so far.
|
||||
* This information is passed to AnnotationParser as
|
||||
* context information
|
||||
*/
|
||||
private final Stack<String> elementNames = new Stack<String>();
|
||||
|
||||
/**
|
||||
* Points to the schema document (the parser of it) that included/imported
|
||||
* this schema.
|
||||
*/
|
||||
private final NGCCRuntimeEx referer;
|
||||
|
||||
/**
|
||||
* Points to the {@link SchemaDocumentImpl} that represents the
|
||||
* schema document being parsed.
|
||||
*/
|
||||
public SchemaDocumentImpl document;
|
||||
|
||||
NGCCRuntimeEx( ParserContext _parser ) {
|
||||
this(_parser,false,null);
|
||||
}
|
||||
|
||||
private NGCCRuntimeEx( ParserContext _parser, boolean chameleonMode, NGCCRuntimeEx referer ) {
|
||||
this.parser = _parser;
|
||||
this.chameleonMode = chameleonMode;
|
||||
this.referer = referer;
|
||||
|
||||
// set up the default namespace binding
|
||||
currentContext = new Context("","",null);
|
||||
currentContext = new Context("xml","http://www.w3.org/XML/1998/namespace",currentContext);
|
||||
}
|
||||
|
||||
public void checkDoubleDefError( XSDeclaration c ) throws SAXException {
|
||||
if(c==null || ignorableDuplicateComponent(c)) return;
|
||||
|
||||
reportError( Messages.format(Messages.ERR_DOUBLE_DEFINITION,c.getName()) );
|
||||
reportError( Messages.format(Messages.ERR_DOUBLE_DEFINITION_ORIGINAL), c.getLocator() );
|
||||
}
|
||||
|
||||
public static boolean ignorableDuplicateComponent(XSDeclaration c) {
|
||||
if(c.getTargetNamespace().equals(Const.schemaNamespace)) {
|
||||
if(c instanceof XSSimpleType)
|
||||
// hide artificial "double definitions" on simple types
|
||||
return true;
|
||||
if(c.isGlobal() && c.getName().equals("anyType"))
|
||||
return true; // ditto for anyType
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* registers a patcher that will run after all the parsing has finished. */
|
||||
public void addPatcher( Patch patcher ) {
|
||||
parser.patcherManager.addPatcher(patcher);
|
||||
}
|
||||
public void addErrorChecker( Patch patcher ) {
|
||||
parser.patcherManager.addErrorChecker(patcher);
|
||||
}
|
||||
public void reportError( String msg, Locator loc ) throws SAXException {
|
||||
parser.patcherManager.reportError(msg,loc);
|
||||
}
|
||||
public void reportError( String msg ) throws SAXException {
|
||||
reportError(msg,getLocator());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resolves relative URI found in the document.
|
||||
*
|
||||
* @param namespaceURI
|
||||
* passed to the entity resolver.
|
||||
* @param relativeUri
|
||||
* value of the schemaLocation attribute. Can be null.
|
||||
*
|
||||
* @return
|
||||
* non-null if {@link EntityResolver} returned an {@link InputSource},
|
||||
* or if the relativeUri parameter seems to be pointing to something.
|
||||
* Otherwise it returns null, in which case import/include should be abandoned.
|
||||
*/
|
||||
private InputSource resolveRelativeURL( String namespaceURI, String relativeUri ) throws SAXException {
|
||||
try {
|
||||
String baseUri = getLocator().getSystemId();
|
||||
if(baseUri==null)
|
||||
// if the base URI is not available, the document system ID is
|
||||
// better than nothing.
|
||||
baseUri=documentSystemId;
|
||||
|
||||
EntityResolver er = parser.getEntityResolver();
|
||||
String systemId = null;
|
||||
|
||||
if (relativeUri!=null)
|
||||
systemId = Uri.resolve(baseUri,relativeUri);
|
||||
|
||||
if (er!=null) {
|
||||
InputSource is = er.resolveEntity(namespaceURI,systemId);
|
||||
if (is == null) {
|
||||
try {
|
||||
String normalizedSystemId = URI.create(systemId).normalize().toASCIIString();
|
||||
is = er.resolveEntity(namespaceURI,normalizedSystemId);
|
||||
} catch (Exception e) {
|
||||
// just ignore, this is a second try, return the fallback if this breaks
|
||||
}
|
||||
}
|
||||
if (is != null) {
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
if (systemId!=null)
|
||||
return new InputSource(systemId);
|
||||
else
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
SAXParseException se = new SAXParseException(e.getMessage(),getLocator(),e);
|
||||
parser.errorHandler.error(se);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Includes the specified schema. */
|
||||
public void includeSchema( String schemaLocation ) throws SAXException {
|
||||
NGCCRuntimeEx runtime = new NGCCRuntimeEx(parser,chameleonMode,this);
|
||||
runtime.currentSchema = this.currentSchema;
|
||||
runtime.blockDefault = this.blockDefault;
|
||||
runtime.finalDefault = this.finalDefault;
|
||||
|
||||
if( schemaLocation==null ) {
|
||||
SAXParseException e = new SAXParseException(
|
||||
Messages.format( Messages.ERR_MISSING_SCHEMALOCATION ), getLocator() );
|
||||
parser.errorHandler.fatalError(e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
runtime.parseEntity( resolveRelativeURL(null,schemaLocation),
|
||||
true, currentSchema.getTargetNamespace(), getLocator() );
|
||||
}
|
||||
|
||||
/** Imports the specified schema. */
|
||||
public void importSchema( String ns, String schemaLocation ) throws SAXException {
|
||||
NGCCRuntimeEx newRuntime = new NGCCRuntimeEx(parser,false,this);
|
||||
InputSource source = resolveRelativeURL(ns,schemaLocation);
|
||||
if(source!=null)
|
||||
newRuntime.parseEntity( source, false, ns, getLocator() );
|
||||
// if source == null,
|
||||
// we can't locate this document. Let's just hope that
|
||||
// we already have the schema components for this schema
|
||||
// or we will receive them in the future.
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a new document is being parsed and checks
|
||||
* if the document has already been parsed before.
|
||||
*
|
||||
* <p>
|
||||
* Used to avoid recursive inclusion. Note that the same
|
||||
* document will be parsed multiple times if they are for different
|
||||
* target namespaces.
|
||||
*
|
||||
* <h2>Document Graph Model</h2>
|
||||
* <p>
|
||||
* The challenge we are facing here is that you have a graph of
|
||||
* documents that reference each other. Each document has an unique
|
||||
* URI to identify themselves, and references are done by using those.
|
||||
* The graph may contain cycles.
|
||||
*
|
||||
* <p>
|
||||
* Our goal here is to parse all the documents in the graph, without
|
||||
* parsing the same document twice. This method implements this check.
|
||||
*
|
||||
* <p>
|
||||
* One complication is the chameleon schema; a document can be parsed
|
||||
* multiple times if they are under different target namespaces.
|
||||
*
|
||||
* <p>
|
||||
* Also, note that when you resolve relative URIs in the @schemaLocation,
|
||||
* their base URI is *NOT* the URI of the document.
|
||||
*
|
||||
* @return true if the document has already been processed and thus
|
||||
* needs to be skipped.
|
||||
*/
|
||||
public boolean hasAlreadyBeenRead() {
|
||||
if( documentSystemId!=null ) {
|
||||
if( documentSystemId.startsWith("file:///") )
|
||||
// change file:///abc to file:/abc
|
||||
// JDK File.toURL method produces the latter, but according to RFC
|
||||
// I don't think that's a valid URL. Since two different ways of
|
||||
// producing URLs could produce those two different forms,
|
||||
// we need to canonicalize one to the other.
|
||||
documentSystemId = "file:/"+documentSystemId.substring(8);
|
||||
} else {
|
||||
// if the system Id is not provided, we can't test the identity,
|
||||
// so we have no choice but to read it.
|
||||
// the newly created SchemaDocumentImpl will be unique one
|
||||
}
|
||||
|
||||
assert document ==null;
|
||||
document = new SchemaDocumentImpl( currentSchema, documentSystemId );
|
||||
|
||||
SchemaDocumentImpl existing = parser.parsedDocuments.get(document);
|
||||
if(existing==null) {
|
||||
parser.parsedDocuments.put(document,document);
|
||||
} else {
|
||||
document = existing;
|
||||
}
|
||||
|
||||
assert document !=null;
|
||||
|
||||
if(referer!=null) {
|
||||
assert referer.document !=null : "referer "+referer.documentSystemId+" has docIdentity==null";
|
||||
referer.document.references.add(this.document);
|
||||
this.document.referers.add(referer.document);
|
||||
}
|
||||
|
||||
return existing!=null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the specified entity.
|
||||
*
|
||||
* @param importLocation
|
||||
* The source location of the import/include statement.
|
||||
* Used for reporting errors.
|
||||
*/
|
||||
public void parseEntity( InputSource source, boolean includeMode, String expectedNamespace, Locator importLocation )
|
||||
throws SAXException {
|
||||
|
||||
documentSystemId = source.getSystemId();
|
||||
try {
|
||||
Schema s = new Schema(this,includeMode,expectedNamespace);
|
||||
setRootHandler(s);
|
||||
try {
|
||||
parser.parser.parse(source,this, getErrorHandler(), parser.getEntityResolver());
|
||||
} catch( IOException fnfe ) {
|
||||
SAXParseException se = new SAXParseException(fnfe.toString(), importLocation, fnfe);
|
||||
parser.errorHandler.warning(se);
|
||||
}
|
||||
} catch( SAXException e ) {
|
||||
parser.setErrorFlag();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance of annotation parser.
|
||||
*/
|
||||
public AnnotationParser createAnnotationParser() {
|
||||
if(parser.getAnnotationParserFactory()==null)
|
||||
return DefaultAnnotationParser.theInstance;
|
||||
else
|
||||
return parser.getAnnotationParserFactory().create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the element name that contains the annotation element.
|
||||
* This method works correctly only when called by the annotation handler.
|
||||
*/
|
||||
public String getAnnotationContextElementName() {
|
||||
return elementNames.get( elementNames.size()-2 );
|
||||
}
|
||||
|
||||
/** Creates a copy of the current locator object. */
|
||||
public Locator copyLocator() {
|
||||
return new LocatorImpl(getLocator());
|
||||
}
|
||||
|
||||
public ErrorHandler getErrorHandler() {
|
||||
return parser.errorHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterElementConsumed(String uri, String localName, String qname, Attributes atts)
|
||||
throws SAXException {
|
||||
super.onEnterElementConsumed(uri, localName, qname, atts);
|
||||
elementNames.push(localName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeaveElementConsumed(String uri, String localName, String qname) throws SAXException {
|
||||
super.onLeaveElementConsumed(uri, localName, qname);
|
||||
elementNames.pop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// ValidationContext implementation
|
||||
//
|
||||
//
|
||||
// this object lives longer than the parser itself,
|
||||
// so it's important for this object not to have any reference
|
||||
// to the parser.
|
||||
private static class Context implements ValidationContext {
|
||||
Context( String _prefix, String _uri, Context _context ) {
|
||||
this.previous = _context;
|
||||
this.prefix = _prefix;
|
||||
this.uri = _uri;
|
||||
}
|
||||
|
||||
public String resolveNamespacePrefix(String p) {
|
||||
if(p.equals(prefix)) return uri;
|
||||
if(previous==null) return null;
|
||||
else return previous.resolveNamespacePrefix(p);
|
||||
}
|
||||
|
||||
private final String prefix;
|
||||
private final String uri;
|
||||
private final Context previous;
|
||||
|
||||
// XSDLib don't use those methods, so we cut a corner here.
|
||||
public String getBaseUri() { return null; }
|
||||
public boolean isNotation(String arg0) { return false; }
|
||||
public boolean isUnparsedEntity(String arg0) { return false; }
|
||||
}
|
||||
|
||||
private Context currentContext=null;
|
||||
|
||||
/** Returns an immutable snapshot of the current context. */
|
||||
public ValidationContext createValidationContext() {
|
||||
return currentContext;
|
||||
}
|
||||
|
||||
public XmlString createXmlString(String value) {
|
||||
if(value==null) return null;
|
||||
else return new XmlString(value,createValidationContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startPrefixMapping( String prefix, String uri ) throws SAXException {
|
||||
super.startPrefixMapping(prefix,uri);
|
||||
currentContext = new Context(prefix,uri,currentContext);
|
||||
}
|
||||
@Override
|
||||
public void endPrefixMapping( String prefix ) throws SAXException {
|
||||
super.endPrefixMapping(prefix);
|
||||
currentContext = currentContext.previous;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// Utility functions
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
/** Parses UName under the given context. */
|
||||
public UName parseUName( String qname ) throws SAXException {
|
||||
int idx = qname.indexOf(':');
|
||||
if(idx<0) {
|
||||
String uri = resolveNamespacePrefix("");
|
||||
|
||||
// chamelon behavior. ugly...
|
||||
if( uri.equals("") && chameleonMode )
|
||||
uri = currentSchema.getTargetNamespace();
|
||||
|
||||
// this is guaranteed to resolve
|
||||
return new UName(uri,qname,qname);
|
||||
} else {
|
||||
String prefix = qname.substring(0,idx);
|
||||
String uri = currentContext.resolveNamespacePrefix(prefix);
|
||||
if(uri==null) {
|
||||
// prefix failed to resolve.
|
||||
reportError(Messages.format(
|
||||
Messages.ERR_UNDEFINED_PREFIX,prefix));
|
||||
uri="undefined"; // replace with a dummy
|
||||
}
|
||||
return new UName( uri, qname.substring(idx+1), qname );
|
||||
}
|
||||
}
|
||||
|
||||
public boolean parseBoolean(String v) {
|
||||
if(v==null) return false;
|
||||
v=v.trim();
|
||||
return v.equals("true") || v.equals("1");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void unexpectedX(String token) throws SAXException {
|
||||
SAXParseException e = new SAXParseException(MessageFormat.format(
|
||||
"Unexpected {0} appears at line {1} column {2}",
|
||||
token,
|
||||
getLocator().getLineNumber(),
|
||||
getLocator().getColumnNumber()),
|
||||
getLocator());
|
||||
|
||||
parser.errorHandler.fatalError(e);
|
||||
throw e; // we will abort anyway
|
||||
}
|
||||
|
||||
public ForeignAttributesImpl parseForeignAttributes( ForeignAttributesImpl next ) {
|
||||
ForeignAttributesImpl impl = new ForeignAttributesImpl(createValidationContext(),copyLocator(),next);
|
||||
|
||||
Attributes atts = getCurrentAttributes();
|
||||
for( int i=0; i<atts.getLength(); i++ ) {
|
||||
if(atts.getURI(i).length()>0) {
|
||||
impl.addAttribute(
|
||||
atts.getURI(i),
|
||||
atts.getLocalName(i),
|
||||
atts.getQName(i),
|
||||
atts.getType(i),
|
||||
atts.getValue(i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return impl;
|
||||
}
|
||||
|
||||
|
||||
public static final String XMLSchemaNSURI = "http://www.w3.org/2001/XMLSchema";
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.XSSchemaSet;
|
||||
import com.sun.xml.internal.xsom.impl.ElementDecl;
|
||||
import com.sun.xml.internal.xsom.impl.SchemaImpl;
|
||||
import com.sun.xml.internal.xsom.impl.SchemaSetImpl;
|
||||
import com.sun.xml.internal.xsom.parser.AnnotationParserFactory;
|
||||
import com.sun.xml.internal.xsom.parser.XMLParser;
|
||||
import com.sun.xml.internal.xsom.parser.XSOMParser;
|
||||
import org.xml.sax.EntityResolver;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* Provides context information to be used by {@link NGCCRuntimeEx}s.
|
||||
*
|
||||
* <p>
|
||||
* This class does the actual processing for {@link XSOMParser},
|
||||
* but to hide the details from the public API, this class in
|
||||
* a different package.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
|
||||
*/
|
||||
public class ParserContext {
|
||||
|
||||
/** SchemaSet to which a newly parsed schema is put in. */
|
||||
public final SchemaSetImpl schemaSet = new SchemaSetImpl();
|
||||
|
||||
private final XSOMParser owner;
|
||||
|
||||
final XMLParser parser;
|
||||
|
||||
|
||||
private final Vector<Patch> patchers = new Vector<Patch>();
|
||||
private final Vector<Patch> errorCheckers = new Vector<Patch>();
|
||||
|
||||
/**
|
||||
* Documents that are parsed already. Used to avoid cyclic inclusion/double
|
||||
* inclusion of schemas. Set of {@link SchemaDocumentImpl}s.
|
||||
*
|
||||
* The actual data structure is map from {@link SchemaDocumentImpl} to itself,
|
||||
* so that we can access the {@link SchemaDocumentImpl} itself.
|
||||
*/
|
||||
public final Map<SchemaDocumentImpl, SchemaDocumentImpl> parsedDocuments = new HashMap<SchemaDocumentImpl, SchemaDocumentImpl>();
|
||||
|
||||
|
||||
public ParserContext( XSOMParser owner, XMLParser parser ) {
|
||||
this.owner = owner;
|
||||
this.parser = parser;
|
||||
|
||||
try {
|
||||
parse(new InputSource(ParserContext.class.getResource("datatypes.xsd").toExternalForm()));
|
||||
|
||||
SchemaImpl xs = (SchemaImpl)
|
||||
schemaSet.getSchema("http://www.w3.org/2001/XMLSchema");
|
||||
xs.addSimpleType(schemaSet.anySimpleType,true);
|
||||
xs.addComplexType(schemaSet.anyType,true);
|
||||
} catch( SAXException e ) {
|
||||
// this must be a bug of XSOM
|
||||
if(e.getException()!=null)
|
||||
e.getException().printStackTrace();
|
||||
else
|
||||
e.printStackTrace();
|
||||
throw new InternalError();
|
||||
}
|
||||
}
|
||||
|
||||
public EntityResolver getEntityResolver() {
|
||||
return owner.getEntityResolver();
|
||||
}
|
||||
|
||||
public AnnotationParserFactory getAnnotationParserFactory() {
|
||||
return owner.getAnnotationParserFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a new XML Schema document.
|
||||
*/
|
||||
public void parse( InputSource source ) throws SAXException {
|
||||
newNGCCRuntime().parseEntity(source,false,null,null);
|
||||
}
|
||||
|
||||
|
||||
public XSSchemaSet getResult() throws SAXException {
|
||||
// run all the patchers
|
||||
for (Patch patcher : patchers)
|
||||
patcher.run();
|
||||
patchers.clear();
|
||||
|
||||
// build the element substitutability map
|
||||
Iterator itr = schemaSet.iterateElementDecls();
|
||||
while(itr.hasNext())
|
||||
((ElementDecl)itr.next()).updateSubstitutabilityMap();
|
||||
|
||||
// run all the error checkers
|
||||
for (Patch patcher : errorCheckers)
|
||||
patcher.run();
|
||||
errorCheckers.clear();
|
||||
|
||||
|
||||
if(hadError) return null;
|
||||
else return schemaSet;
|
||||
}
|
||||
|
||||
public NGCCRuntimeEx newNGCCRuntime() {
|
||||
return new NGCCRuntimeEx(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Once an error is detected, this flag is set to true. */
|
||||
private boolean hadError = false;
|
||||
|
||||
/** Turns on the error flag. */
|
||||
void setErrorFlag() { hadError=true; }
|
||||
|
||||
/**
|
||||
* PatchManager implementation, which is accessible only from
|
||||
* NGCCRuntimEx.
|
||||
*/
|
||||
final PatcherManager patcherManager = new PatcherManager() {
|
||||
public void addPatcher( Patch patch ) {
|
||||
patchers.add(patch);
|
||||
}
|
||||
public void addErrorChecker( Patch patch ) {
|
||||
errorCheckers.add(patch);
|
||||
}
|
||||
public void reportError( String msg, Locator src ) throws SAXException {
|
||||
// set a flag to true to avoid returning a corrupted object.
|
||||
setErrorFlag();
|
||||
|
||||
SAXParseException e = new SAXParseException(msg,src);
|
||||
if(errorHandler==null)
|
||||
throw e;
|
||||
else
|
||||
errorHandler.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ErrorHandler proxy to turn on the hadError flag when an error
|
||||
* is found.
|
||||
*/
|
||||
final ErrorHandler errorHandler = new ErrorHandler() {
|
||||
private ErrorHandler getErrorHandler() {
|
||||
if( owner.getErrorHandler()==null )
|
||||
return noopHandler;
|
||||
else
|
||||
return owner.getErrorHandler();
|
||||
}
|
||||
|
||||
public void warning(SAXParseException e) throws SAXException {
|
||||
getErrorHandler().warning(e);
|
||||
}
|
||||
|
||||
public void error(SAXParseException e) throws SAXException {
|
||||
setErrorFlag();
|
||||
getErrorHandler().error(e);
|
||||
}
|
||||
|
||||
public void fatalError(SAXParseException e) throws SAXException {
|
||||
setErrorFlag();
|
||||
getErrorHandler().fatalError(e);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* {@link ErrorHandler} that does nothing.
|
||||
*/
|
||||
final ErrorHandler noopHandler = new ErrorHandler() {
|
||||
public void warning(SAXParseException e) {
|
||||
}
|
||||
public void error(SAXParseException e) {
|
||||
}
|
||||
public void fatalError(SAXParseException e) {
|
||||
setErrorFlag();
|
||||
}
|
||||
};
|
||||
}
|
||||
38
jdkSrc/jdk8/com/sun/xml/internal/xsom/impl/parser/Patch.java
Normal file
38
jdkSrc/jdk8/com/sun/xml/internal/xsom/impl/parser/Patch.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Patch program that runs later to "fix" references among components.
|
||||
*
|
||||
* The only difference from the Runnable interface is that this interface
|
||||
* allows the program to throw a SAXException.
|
||||
*/
|
||||
public interface Patch {
|
||||
void run() throws SAXException;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Manages patchers.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
|
||||
*/
|
||||
public interface PatcherManager {
|
||||
void addPatcher( Patch p );
|
||||
void addErrorChecker( Patch p );
|
||||
/**
|
||||
* Reports an error during the parsing.
|
||||
*
|
||||
* @param source
|
||||
* location of the error in the source file, or null if
|
||||
* it's unavailable.
|
||||
*/
|
||||
void reportError( String message, Locator source ) throws SAXException;
|
||||
|
||||
|
||||
public interface Patcher {
|
||||
void run() throws SAXException;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.parser.XMLParser;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.helpers.XMLFilterImpl;
|
||||
import org.xml.sax.helpers.XMLReaderAdapter;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* {@link SAXParserFactory} implementation that ultimately
|
||||
* uses {@link XMLParser} to parse documents.
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @author
|
||||
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
|
||||
*/
|
||||
public class SAXParserFactoryAdaptor extends SAXParserFactory {
|
||||
|
||||
private final XMLParser parser;
|
||||
|
||||
public SAXParserFactoryAdaptor( XMLParser _parser ) {
|
||||
this.parser = _parser;
|
||||
}
|
||||
|
||||
public SAXParser newSAXParser() throws ParserConfigurationException, SAXException {
|
||||
return new SAXParserImpl();
|
||||
}
|
||||
|
||||
public void setFeature(String name, boolean value) {
|
||||
throw new UnsupportedOperationException("XSOM parser does not support JAXP features.");
|
||||
}
|
||||
|
||||
public boolean getFeature(String name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private class SAXParserImpl extends SAXParser
|
||||
{
|
||||
private final XMLReaderImpl reader = new XMLReaderImpl();
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public org.xml.sax.Parser getParser() throws SAXException {
|
||||
return new XMLReaderAdapter(reader);
|
||||
}
|
||||
|
||||
public XMLReader getXMLReader() throws SAXException {
|
||||
return reader;
|
||||
}
|
||||
|
||||
public boolean isNamespaceAware() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isValidating() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setProperty(String name, Object value) {
|
||||
}
|
||||
|
||||
public Object getProperty(String name) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private class XMLReaderImpl extends XMLFilterImpl
|
||||
{
|
||||
public void parse(InputSource input) throws IOException, SAXException {
|
||||
parser.parse(input,this,this,this);
|
||||
}
|
||||
|
||||
public void parse(String systemId) throws IOException, SAXException {
|
||||
parser.parse(new InputSource(systemId),this,this,this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.impl.SchemaImpl;
|
||||
import com.sun.xml.internal.xsom.parser.SchemaDocument;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* {@link SchemaDocument} implementation.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
public final class SchemaDocumentImpl implements SchemaDocument
|
||||
{
|
||||
private final SchemaImpl schema;
|
||||
|
||||
/**
|
||||
* URI of the schema document to be parsed. Can be null.
|
||||
*/
|
||||
private final String schemaDocumentURI;
|
||||
|
||||
/**
|
||||
* {@link SchemaDocumentImpl}s that are referenced from this document.
|
||||
*/
|
||||
final Set<SchemaDocumentImpl> references = new HashSet<SchemaDocumentImpl>();
|
||||
|
||||
/**
|
||||
* {@link SchemaDocumentImpl}s that are referencing this document.
|
||||
*/
|
||||
final Set<SchemaDocumentImpl> referers = new HashSet<SchemaDocumentImpl>();
|
||||
|
||||
protected SchemaDocumentImpl(SchemaImpl schema, String _schemaDocumentURI) {
|
||||
this.schema = schema;
|
||||
this.schemaDocumentURI = _schemaDocumentURI;
|
||||
}
|
||||
|
||||
public String getSystemId() {
|
||||
return schemaDocumentURI;
|
||||
}
|
||||
|
||||
public String getTargetNamespace() {
|
||||
return schema.getTargetNamespace();
|
||||
}
|
||||
|
||||
public SchemaImpl getSchema() {
|
||||
return schema;
|
||||
}
|
||||
|
||||
public Set<SchemaDocument> getReferencedDocuments() {
|
||||
return Collections.<SchemaDocument>unmodifiableSet(references);
|
||||
}
|
||||
|
||||
public Set<SchemaDocument> getIncludedDocuments() {
|
||||
return getImportedDocuments(this.getTargetNamespace());
|
||||
}
|
||||
|
||||
public Set<SchemaDocument> getImportedDocuments(String targetNamespace) {
|
||||
if(targetNamespace==null)
|
||||
throw new IllegalArgumentException();
|
||||
Set<SchemaDocument> r = new HashSet<SchemaDocument>();
|
||||
for (SchemaDocumentImpl doc : references) {
|
||||
if(doc.getTargetNamespace().equals(targetNamespace))
|
||||
r.add(doc);
|
||||
}
|
||||
return Collections.unmodifiableSet(r);
|
||||
}
|
||||
|
||||
public boolean includes(SchemaDocument doc) {
|
||||
if(!references.contains(doc))
|
||||
return false;
|
||||
return doc.getSchema()==schema;
|
||||
}
|
||||
|
||||
public boolean imports(SchemaDocument doc) {
|
||||
if(!references.contains(doc))
|
||||
return false;
|
||||
return doc.getSchema()!=schema;
|
||||
}
|
||||
|
||||
public Set<SchemaDocument> getReferers() {
|
||||
return Collections.<SchemaDocument>unmodifiableSet(referers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
SchemaDocumentImpl rhs = (SchemaDocumentImpl) o;
|
||||
|
||||
if( this.schemaDocumentURI==null || rhs.schemaDocumentURI==null)
|
||||
return this==rhs;
|
||||
if(!schemaDocumentURI.equals(rhs.schemaDocumentURI) )
|
||||
return false;
|
||||
return this.schema==rhs.schema;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if (schemaDocumentURI==null)
|
||||
return super.hashCode();
|
||||
if (schema == null) {
|
||||
return schemaDocumentURI.hashCode();
|
||||
}
|
||||
return schemaDocumentURI.hashCode()^this.schema.hashCode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser;
|
||||
|
||||
import com.sun.xml.internal.xsom.XSType;
|
||||
import com.sun.xml.internal.xsom.impl.Ref;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author
|
||||
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
|
||||
*/
|
||||
public class SubstGroupBaseTypeRef implements Ref.Type {
|
||||
private final Ref.Element e;
|
||||
|
||||
public SubstGroupBaseTypeRef( Ref.Element _e ) {
|
||||
this.e = _e;
|
||||
}
|
||||
|
||||
public XSType getType() {
|
||||
return e.get().getType();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,626 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
// AttributesImpl.java - default implementation of Attributes.
|
||||
// Written by David Megginson, sax@megginson.com
|
||||
// NO WARRANTY! This class is in the public domain.
|
||||
|
||||
// $Id: AttributesImpl.java,v 1.4 2002/09/29 02:55:48 okajima Exp $
|
||||
|
||||
//fixed bug at removeAttribute!! by Daisuke OKAJIMA 2002.4.21
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
|
||||
|
||||
/**
|
||||
* Default implementation of the Attributes interface.
|
||||
*
|
||||
* <blockquote>
|
||||
* <em>This module, both source code and documentation, is in the
|
||||
* Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
|
||||
* </blockquote>
|
||||
*
|
||||
* <p>This class provides a default implementation of the SAX2
|
||||
* {@link org.xml.sax.Attributes Attributes} interface, with the
|
||||
* addition of manipulators so that the list can be modified or
|
||||
* reused.</p>
|
||||
*
|
||||
* <p>There are two typical uses of this class:</p>
|
||||
*
|
||||
* <ol>
|
||||
* <li>to take a persistent snapshot of an Attributes object
|
||||
* in a {@link org.xml.sax.ContentHandler#startElement startElement} event; or</li>
|
||||
* <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li>
|
||||
* </ol>
|
||||
*
|
||||
* <p>This class replaces the now-deprecated SAX1 {@link
|
||||
* org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
|
||||
* class; in addition to supporting the updated Attributes
|
||||
* interface rather than the deprecated {@link org.xml.sax.AttributeList
|
||||
* AttributeList} interface, it also includes a much more efficient
|
||||
* implementation using a single array rather than a set of Vectors.</p>
|
||||
*
|
||||
* @since SAX 2.0
|
||||
* @author David Megginson,
|
||||
* <a href="mailto:sax@megginson.com">sax@megginson.com</a>
|
||||
* @version 2.0
|
||||
*/
|
||||
public class AttributesImpl implements Attributes
|
||||
{
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Constructors.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new, empty AttributesImpl object.
|
||||
*/
|
||||
public AttributesImpl ()
|
||||
{
|
||||
length = 0;
|
||||
data = null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy an existing Attributes object.
|
||||
*
|
||||
* <p>This constructor is especially useful inside a
|
||||
* {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
|
||||
*
|
||||
* @param atts The existing Attributes object.
|
||||
*/
|
||||
public AttributesImpl (Attributes atts)
|
||||
{
|
||||
setAttributes(atts);
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Implementation of org.xml.sax.Attributes.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* Return the number of attributes in the list.
|
||||
*
|
||||
* @return The number of attributes in the list.
|
||||
* @see org.xml.sax.Attributes#getLength
|
||||
*/
|
||||
public int getLength ()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an attribute's Namespace URI.
|
||||
*
|
||||
* @param index The attribute's index (zero-based).
|
||||
* @return The Namespace URI, the empty string if none is
|
||||
* available, or null if the index is out of range.
|
||||
* @see org.xml.sax.Attributes#getURI
|
||||
*/
|
||||
public String getURI (int index)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
return data[index*5];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an attribute's local name.
|
||||
*
|
||||
* @param index The attribute's index (zero-based).
|
||||
* @return The attribute's local name, the empty string if
|
||||
* none is available, or null if the index if out of range.
|
||||
* @see org.xml.sax.Attributes#getLocalName
|
||||
*/
|
||||
public String getLocalName (int index)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
return data[index*5+1];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an attribute's qualified (prefixed) name.
|
||||
*
|
||||
* @param index The attribute's index (zero-based).
|
||||
* @return The attribute's qualified name, the empty string if
|
||||
* none is available, or null if the index is out of bounds.
|
||||
* @see org.xml.sax.Attributes#getQName
|
||||
*/
|
||||
public String getQName (int index)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
return data[index*5+2];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an attribute's type by index.
|
||||
*
|
||||
* @param index The attribute's index (zero-based).
|
||||
* @return The attribute's type, "CDATA" if the type is unknown, or null
|
||||
* if the index is out of bounds.
|
||||
* @see org.xml.sax.Attributes#getType(int)
|
||||
*/
|
||||
public String getType (int index)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
return data[index*5+3];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an attribute's value by index.
|
||||
*
|
||||
* @param index The attribute's index (zero-based).
|
||||
* @return The attribute's value or null if the index is out of bounds.
|
||||
* @see org.xml.sax.Attributes#getValue(int)
|
||||
*/
|
||||
public String getValue (int index)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
return data[index*5+4];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Look up an attribute's index by Namespace name.
|
||||
*
|
||||
* <p>In many cases, it will be more efficient to look up the name once and
|
||||
* use the index query methods rather than using the name query methods
|
||||
* repeatedly.</p>
|
||||
*
|
||||
* @param uri The attribute's Namespace URI, or the empty
|
||||
* string if none is available.
|
||||
* @param localName The attribute's local name.
|
||||
* @return The attribute's index, or -1 if none matches.
|
||||
* @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)
|
||||
*/
|
||||
public int getIndex (String uri, String localName)
|
||||
{
|
||||
int max = length * 5;
|
||||
for (int i = 0; i < max; i += 5) {
|
||||
if (data[i].equals(uri) && data[i+1].equals(localName)) {
|
||||
return i / 5;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Look up an attribute's index by qualified (prefixed) name.
|
||||
*
|
||||
* @param qName The qualified name.
|
||||
* @return The attribute's index, or -1 if none matches.
|
||||
* @see org.xml.sax.Attributes#getIndex(java.lang.String)
|
||||
*/
|
||||
public int getIndex (String qName)
|
||||
{
|
||||
int max = length * 5;
|
||||
for (int i = 0; i < max; i += 5) {
|
||||
if (data[i+2].equals(qName)) {
|
||||
return i / 5;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Look up an attribute's type by Namespace-qualified name.
|
||||
*
|
||||
* @param uri The Namespace URI, or the empty string for a name
|
||||
* with no explicit Namespace URI.
|
||||
* @param localName The local name.
|
||||
* @return The attribute's type, or null if there is no
|
||||
* matching attribute.
|
||||
* @see org.xml.sax.Attributes#getType(java.lang.String,java.lang.String)
|
||||
*/
|
||||
public String getType (String uri, String localName)
|
||||
{
|
||||
int max = length * 5;
|
||||
for (int i = 0; i < max; i += 5) {
|
||||
if (data[i].equals(uri) && data[i+1].equals(localName)) {
|
||||
return data[i+3];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Look up an attribute's type by qualified (prefixed) name.
|
||||
*
|
||||
* @param qName The qualified name.
|
||||
* @return The attribute's type, or null if there is no
|
||||
* matching attribute.
|
||||
* @see org.xml.sax.Attributes#getType(java.lang.String)
|
||||
*/
|
||||
public String getType (String qName)
|
||||
{
|
||||
int max = length * 5;
|
||||
for (int i = 0; i < max; i += 5) {
|
||||
if (data[i+2].equals(qName)) {
|
||||
return data[i+3];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Look up an attribute's value by Namespace-qualified name.
|
||||
*
|
||||
* @param uri The Namespace URI, or the empty string for a name
|
||||
* with no explicit Namespace URI.
|
||||
* @param localName The local name.
|
||||
* @return The attribute's value, or null if there is no
|
||||
* matching attribute.
|
||||
* @see org.xml.sax.Attributes#getValue(java.lang.String,java.lang.String)
|
||||
*/
|
||||
public String getValue (String uri, String localName)
|
||||
{
|
||||
int max = length * 5;
|
||||
for (int i = 0; i < max; i += 5) {
|
||||
if (data[i].equals(uri) && data[i+1].equals(localName)) {
|
||||
return data[i+4];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Look up an attribute's value by qualified (prefixed) name.
|
||||
*
|
||||
* @param qName The qualified name.
|
||||
* @return The attribute's value, or null if there is no
|
||||
* matching attribute.
|
||||
* @see org.xml.sax.Attributes#getValue(java.lang.String)
|
||||
*/
|
||||
public String getValue (String qName)
|
||||
{
|
||||
int max = length * 5;
|
||||
for (int i = 0; i < max; i += 5) {
|
||||
if (data[i+2].equals(qName)) {
|
||||
return data[i+4];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Manipulators.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* Clear the attribute list for reuse.
|
||||
*
|
||||
* <p>Note that no memory is actually freed by this call:
|
||||
* the current arrays are kept so that they can be
|
||||
* reused.</p>
|
||||
*/
|
||||
public void clear ()
|
||||
{
|
||||
length = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy an entire Attributes object.
|
||||
*
|
||||
* <p>It may be more efficient to reuse an existing object
|
||||
* rather than constantly allocating new ones.</p>
|
||||
*
|
||||
* @param atts The attributes to copy.
|
||||
*/
|
||||
public void setAttributes (Attributes atts)
|
||||
{
|
||||
clear();
|
||||
length = atts.getLength();
|
||||
data = new String[length*5];
|
||||
for (int i = 0; i < length; i++) {
|
||||
data[i*5] = atts.getURI(i);
|
||||
data[i*5+1] = atts.getLocalName(i);
|
||||
data[i*5+2] = atts.getQName(i);
|
||||
data[i*5+3] = atts.getType(i);
|
||||
data[i*5+4] = atts.getValue(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add an attribute to the end of the list.
|
||||
*
|
||||
* <p>For the sake of speed, this method does no checking
|
||||
* to see if the attribute is already in the list: that is
|
||||
* the responsibility of the application.</p>
|
||||
*
|
||||
* @param uri The Namespace URI, or the empty string if
|
||||
* none is available or Namespace processing is not
|
||||
* being performed.
|
||||
* @param localName The local name, or the empty string if
|
||||
* Namespace processing is not being performed.
|
||||
* @param qName The qualified (prefixed) name, or the empty string
|
||||
* if qualified names are not available.
|
||||
* @param type The attribute type as a string.
|
||||
* @param value The attribute value.
|
||||
*/
|
||||
public void addAttribute (String uri, String localName, String qName,
|
||||
String type, String value)
|
||||
{
|
||||
ensureCapacity(length+1);
|
||||
data[length*5] = uri;
|
||||
data[length*5+1] = localName;
|
||||
data[length*5+2] = qName;
|
||||
data[length*5+3] = type;
|
||||
data[length*5+4] = value;
|
||||
length++;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set an attribute in the list.
|
||||
*
|
||||
* <p>For the sake of speed, this method does no checking
|
||||
* for name conflicts or well-formedness: such checks are the
|
||||
* responsibility of the application.</p>
|
||||
*
|
||||
* @param index The index of the attribute (zero-based).
|
||||
* @param uri The Namespace URI, or the empty string if
|
||||
* none is available or Namespace processing is not
|
||||
* being performed.
|
||||
* @param localName The local name, or the empty string if
|
||||
* Namespace processing is not being performed.
|
||||
* @param qName The qualified name, or the empty string
|
||||
* if qualified names are not available.
|
||||
* @param type The attribute type as a string.
|
||||
* @param value The attribute value.
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException When the
|
||||
* supplied index does not point to an attribute
|
||||
* in the list.
|
||||
*/
|
||||
public void setAttribute (int index, String uri, String localName,
|
||||
String qName, String type, String value)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
data[index*5] = uri;
|
||||
data[index*5+1] = localName;
|
||||
data[index*5+2] = qName;
|
||||
data[index*5+3] = type;
|
||||
data[index*5+4] = value;
|
||||
} else {
|
||||
badIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove an attribute from the list.
|
||||
*
|
||||
* @param index The index of the attribute (zero-based).
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException When the
|
||||
* supplied index does not point to an attribute
|
||||
* in the list.
|
||||
*/
|
||||
public void removeAttribute (int index)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
if (index < length - 1) {
|
||||
System.arraycopy(data, (index+1)*5, data, index*5,
|
||||
(length-index-1)*5);
|
||||
}
|
||||
length--;
|
||||
} else {
|
||||
badIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the Namespace URI of a specific attribute.
|
||||
*
|
||||
* @param index The index of the attribute (zero-based).
|
||||
* @param uri The attribute's Namespace URI, or the empty
|
||||
* string for none.
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException When the
|
||||
* supplied index does not point to an attribute
|
||||
* in the list.
|
||||
*/
|
||||
public void setURI (int index, String uri)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
data[index*5] = uri;
|
||||
} else {
|
||||
badIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the local name of a specific attribute.
|
||||
*
|
||||
* @param index The index of the attribute (zero-based).
|
||||
* @param localName The attribute's local name, or the empty
|
||||
* string for none.
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException When the
|
||||
* supplied index does not point to an attribute
|
||||
* in the list.
|
||||
*/
|
||||
public void setLocalName (int index, String localName)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
data[index*5+1] = localName;
|
||||
} else {
|
||||
badIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the qualified name of a specific attribute.
|
||||
*
|
||||
* @param index The index of the attribute (zero-based).
|
||||
* @param qName The attribute's qualified name, or the empty
|
||||
* string for none.
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException When the
|
||||
* supplied index does not point to an attribute
|
||||
* in the list.
|
||||
*/
|
||||
public void setQName (int index, String qName)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
data[index*5+2] = qName;
|
||||
} else {
|
||||
badIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the type of a specific attribute.
|
||||
*
|
||||
* @param index The index of the attribute (zero-based).
|
||||
* @param type The attribute's type.
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException When the
|
||||
* supplied index does not point to an attribute
|
||||
* in the list.
|
||||
*/
|
||||
public void setType (int index, String type)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
data[index*5+3] = type;
|
||||
} else {
|
||||
badIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of a specific attribute.
|
||||
*
|
||||
* @param index The index of the attribute (zero-based).
|
||||
* @param value The attribute's value.
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException When the
|
||||
* supplied index does not point to an attribute
|
||||
* in the list.
|
||||
*/
|
||||
public void setValue (int index, String value)
|
||||
{
|
||||
if (index >= 0 && index < length) {
|
||||
data[index*5+4] = value;
|
||||
} else {
|
||||
badIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Internal methods.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/**
|
||||
* Ensure the internal array's capacity.
|
||||
*
|
||||
* @param n The minimum number of attributes that the array must
|
||||
* be able to hold.
|
||||
*/
|
||||
private void ensureCapacity (int n)
|
||||
{
|
||||
if (n > 0 && (data == null || data.length==0)) {
|
||||
data = new String[25];
|
||||
}
|
||||
|
||||
int max = data.length;
|
||||
if (max >= n * 5) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
while (max < n * 5) {
|
||||
max *= 2;
|
||||
}
|
||||
String newData[] = new String[max];
|
||||
System.arraycopy(data, 0, newData, 0, length*5);
|
||||
data = newData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Report a bad array index in a manipulator.
|
||||
*
|
||||
* @param index The index to report.
|
||||
* @exception java.lang.ArrayIndexOutOfBoundsException Always.
|
||||
*/
|
||||
private void badIndex (int index)
|
||||
throws ArrayIndexOutOfBoundsException
|
||||
{
|
||||
String msg =
|
||||
"Attempt to modify attribute at illegal index: " + index;
|
||||
throw new ArrayIndexOutOfBoundsException(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Internal state.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
int length;
|
||||
String data [];
|
||||
|
||||
}
|
||||
|
||||
// end of AttributesImpl.java
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
|
||||
*/
|
||||
public interface NGCCEventReceiver {
|
||||
void enterElement(String uri, String localName, String qname,Attributes atts) throws SAXException;
|
||||
void leaveElement(String uri, String localName, String qname) throws SAXException;
|
||||
void text(String value) throws SAXException;
|
||||
void enterAttribute(String uri, String localName, String qname) throws SAXException;
|
||||
void leaveAttribute(String uri, String localName, String qname) throws SAXException;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
|
||||
*/
|
||||
public interface NGCCEventSource {
|
||||
/**
|
||||
* Replaces an old handler with a new handler, and returns
|
||||
* ID of the EventReceiver thread.
|
||||
*/
|
||||
int replace( NGCCEventReceiver _old, NGCCEventReceiver _new );
|
||||
|
||||
/** Sends an enter element event to the specified EventReceiver thread. */
|
||||
void sendEnterElement( int receiverThreadId, String uri, String local, String qname, Attributes atts ) throws SAXException;
|
||||
|
||||
void sendLeaveElement( int receiverThreadId, String uri, String local, String qname ) throws SAXException;
|
||||
void sendEnterAttribute( int receiverThreadId, String uri, String local, String qname ) throws SAXException;
|
||||
void sendLeaveAttribute( int receiverThreadId, String uri, String local, String qname ) throws SAXException;
|
||||
void sendText( int receiverThreadId, String value ) throws SAXException;
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @version $Id: NGCCHandler.java,v 1.9 2002/09/29 02:55:48 okajima Exp $
|
||||
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
|
||||
*/
|
||||
public abstract class NGCCHandler implements NGCCEventReceiver {
|
||||
protected NGCCHandler( NGCCEventSource source, NGCCHandler parent, int parentCookie ) {
|
||||
|
||||
_parent = parent;
|
||||
_source = source;
|
||||
_cookie = parentCookie;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parent NGCCHandler, if any.
|
||||
* If this is the root handler, this field will be null.
|
||||
*/
|
||||
protected final NGCCHandler _parent;
|
||||
|
||||
/**
|
||||
* Event source.
|
||||
*/
|
||||
protected final NGCCEventSource _source;
|
||||
|
||||
/**
|
||||
* This method will be implemented by the generated code
|
||||
* and returns a reference to the current runtime.
|
||||
*/
|
||||
protected abstract NGCCRuntime getRuntime();
|
||||
|
||||
/**
|
||||
* Cookie assigned by the parent.
|
||||
*
|
||||
* This value will be passed to the onChildCompleted handler
|
||||
* of the parent.
|
||||
*/
|
||||
protected final int _cookie;
|
||||
|
||||
// used to copy parameters to (enter|leave)(Element|Attribute) events.
|
||||
//protected String localName,uri,qname;
|
||||
|
||||
|
||||
/**
|
||||
* Notifies the completion of a child object.
|
||||
*
|
||||
* @param result
|
||||
* The parsing result of the child state.
|
||||
* @param cookie
|
||||
* The cookie value passed to the child object
|
||||
* when it is created.
|
||||
* @param needAttCheck
|
||||
* This flag is true when the callee needs to call the
|
||||
* processAttribute method to check attribute transitions.
|
||||
* This flag is set to false when this method is triggered by
|
||||
* attribute transition.
|
||||
*/
|
||||
protected abstract void onChildCompleted( Object result, int cookie, boolean needAttCheck ) throws SAXException;
|
||||
|
||||
//
|
||||
//
|
||||
// spawns a new child object from event handlers.
|
||||
//
|
||||
//
|
||||
public void spawnChildFromEnterElement( NGCCEventReceiver child,
|
||||
String uri, String localname, String qname, Attributes atts) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,child);
|
||||
_source.sendEnterElement(id,uri,localname,qname,atts);
|
||||
}
|
||||
public void spawnChildFromEnterAttribute( NGCCEventReceiver child,
|
||||
String uri, String localname, String qname) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,child);
|
||||
_source.sendEnterAttribute(id,uri,localname,qname);
|
||||
}
|
||||
public void spawnChildFromLeaveElement( NGCCEventReceiver child,
|
||||
String uri, String localname, String qname) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,child);
|
||||
_source.sendLeaveElement(id,uri,localname,qname);
|
||||
}
|
||||
public void spawnChildFromLeaveAttribute( NGCCEventReceiver child,
|
||||
String uri, String localname, String qname) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,child);
|
||||
_source.sendLeaveAttribute(id,uri,localname,qname);
|
||||
}
|
||||
public void spawnChildFromText( NGCCEventReceiver child,
|
||||
String value) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,child);
|
||||
_source.sendText(id,value);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// reverts to the parent object from the child handler
|
||||
//
|
||||
//
|
||||
public void revertToParentFromEnterElement( Object result, int cookie,
|
||||
String uri,String local,String qname, Attributes atts ) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,_parent);
|
||||
_parent.onChildCompleted(result,cookie,true);
|
||||
_source.sendEnterElement(id,uri,local,qname,atts);
|
||||
}
|
||||
public void revertToParentFromLeaveElement( Object result, int cookie,
|
||||
String uri,String local,String qname ) throws SAXException {
|
||||
|
||||
if(uri==NGCCRuntime.IMPOSSIBLE && uri==local && uri==qname && _parent==null )
|
||||
// all the handlers are properly finalized.
|
||||
// quit now, because we don't have any more NGCCHandler.
|
||||
// see the endDocument handler for detail
|
||||
return;
|
||||
|
||||
int id = _source.replace(this,_parent);
|
||||
_parent.onChildCompleted(result,cookie,true);
|
||||
_source.sendLeaveElement(id,uri,local,qname);
|
||||
}
|
||||
public void revertToParentFromEnterAttribute( Object result, int cookie,
|
||||
String uri,String local,String qname ) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,_parent);
|
||||
_parent.onChildCompleted(result,cookie,true);
|
||||
_source.sendEnterAttribute(id,uri,local,qname);
|
||||
}
|
||||
public void revertToParentFromLeaveAttribute( Object result, int cookie,
|
||||
String uri,String local,String qname ) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,_parent);
|
||||
_parent.onChildCompleted(result,cookie,true);
|
||||
_source.sendLeaveAttribute(id,uri,local,qname);
|
||||
}
|
||||
public void revertToParentFromText( Object result, int cookie,
|
||||
String text ) throws SAXException {
|
||||
|
||||
int id = _source.replace(this,_parent);
|
||||
_parent.onChildCompleted(result,cookie,true);
|
||||
_source.sendText(id,text);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// error handler
|
||||
//
|
||||
//
|
||||
public void unexpectedEnterElement(String qname) throws SAXException {
|
||||
getRuntime().unexpectedX('<'+qname+'>');
|
||||
}
|
||||
public void unexpectedLeaveElement(String qname) throws SAXException {
|
||||
getRuntime().unexpectedX("</"+qname+'>');
|
||||
}
|
||||
public void unexpectedEnterAttribute(String qname) throws SAXException {
|
||||
getRuntime().unexpectedX('@'+qname);
|
||||
}
|
||||
public void unexpectedLeaveAttribute(String qname) throws SAXException {
|
||||
getRuntime().unexpectedX("/@"+qname);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Dispatches incoming events into sub handlers appropriately
|
||||
* so that the interleaving semantics will be correctly realized.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
|
||||
*/
|
||||
public abstract class NGCCInterleaveFilter implements NGCCEventSource, NGCCEventReceiver {
|
||||
protected NGCCInterleaveFilter( NGCCHandler parent, int cookie ) {
|
||||
this._parent = parent;
|
||||
this._cookie = cookie;
|
||||
}
|
||||
|
||||
protected void setHandlers( NGCCEventReceiver[] receivers ) {
|
||||
this._receivers = receivers;
|
||||
}
|
||||
|
||||
/** event receiverse. */
|
||||
protected NGCCEventReceiver[] _receivers;
|
||||
|
||||
public int replace(NGCCEventReceiver oldHandler, NGCCEventReceiver newHandler) {
|
||||
for( int i=0; i<_receivers.length; i++ )
|
||||
if( _receivers[i]==oldHandler ) {
|
||||
_receivers[i]=newHandler;
|
||||
return i;
|
||||
}
|
||||
throw new InternalError(); // a bug in RelaxNGCC.
|
||||
}
|
||||
|
||||
|
||||
/** Parent handler. */
|
||||
private final NGCCHandler _parent;
|
||||
/** Cookie given by the parent. */
|
||||
private final int _cookie;
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// event handler
|
||||
//
|
||||
//
|
||||
/**
|
||||
* Receiver that is being locked and therefore receives all the events.
|
||||
* <pre><xmp>
|
||||
* <interleave>
|
||||
* <element name="foo"/>
|
||||
* <element name="bar">
|
||||
* <element name="foo"/>
|
||||
* </element>
|
||||
* </interlaeve>
|
||||
* </xmp></pre>
|
||||
* When processing inside the bar element, this receiver is
|
||||
* "locked" so that it can correctly receive its child foo element.
|
||||
*/
|
||||
private int lockedReceiver;
|
||||
/**
|
||||
* Nest level. Lock will be release when the lockCount becomes 0.
|
||||
*/
|
||||
private int lockCount=0;
|
||||
|
||||
public void enterElement(
|
||||
String uri, String localName, String qname,Attributes atts) throws SAXException {
|
||||
|
||||
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
|
||||
|
||||
if(lockCount++==0) {
|
||||
lockedReceiver = findReceiverOfElement(uri,localName);
|
||||
if(lockedReceiver==-1) {
|
||||
// we can't process this token. join.
|
||||
joinByEnterElement(null,uri,localName,qname,atts);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_receivers[lockedReceiver].enterElement(uri,localName,qname,atts);
|
||||
}
|
||||
public void leaveElement(String uri, String localName, String qname) throws SAXException {
|
||||
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
|
||||
|
||||
if( lockCount-- == 0 )
|
||||
joinByLeaveElement(null,uri,localName,qname);
|
||||
else
|
||||
_receivers[lockedReceiver].leaveElement(uri,localName,qname);
|
||||
}
|
||||
public void enterAttribute(String uri, String localName, String qname) throws SAXException {
|
||||
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
|
||||
|
||||
if(lockCount++==0) {
|
||||
lockedReceiver = findReceiverOfAttribute(uri,localName);
|
||||
if(lockedReceiver==-1) {
|
||||
// we can't process this token. join.
|
||||
joinByEnterAttribute(null,uri,localName,qname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_receivers[lockedReceiver].enterAttribute(uri,localName,qname);
|
||||
}
|
||||
public void leaveAttribute(String uri, String localName, String qname) throws SAXException {
|
||||
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
|
||||
|
||||
if( lockCount-- == 0 )
|
||||
joinByLeaveAttribute(null,uri,localName,qname);
|
||||
else
|
||||
_receivers[lockedReceiver].leaveAttribute(uri,localName,qname);
|
||||
}
|
||||
public void text(String value) throws SAXException {
|
||||
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
|
||||
|
||||
if(lockCount!=0)
|
||||
_receivers[lockedReceiver].text(value);
|
||||
else {
|
||||
int receiver = findReceiverOfText();
|
||||
if(receiver!=-1) _receivers[receiver].text(value);
|
||||
else joinByText(null,value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Implemented by the generated code to determine the handler
|
||||
* that can receive the given element.
|
||||
*
|
||||
* @return
|
||||
* Thread ID of the receiver that can handle this event,
|
||||
* or -1 if none.
|
||||
*/
|
||||
protected abstract int findReceiverOfElement( String uri, String local );
|
||||
|
||||
/**
|
||||
* Returns the handler that can receive the given attribute, or null.
|
||||
*/
|
||||
protected abstract int findReceiverOfAttribute( String uri, String local );
|
||||
|
||||
/**
|
||||
* Returns the handler that can receive text events, or null.
|
||||
*/
|
||||
protected abstract int findReceiverOfText();
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// join method
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
/**
|
||||
* Set to true when this handler is in the process of
|
||||
* joining all branches.
|
||||
*/
|
||||
private boolean isJoining = false;
|
||||
|
||||
/**
|
||||
* Joins all the child receivers.
|
||||
*
|
||||
* <p>
|
||||
* This method is called by a child receiver when it sees
|
||||
* something that it cannot handle, or by this object itself
|
||||
* when it sees an event that it can't process.
|
||||
*
|
||||
* <p>
|
||||
* This method forces children to move to its final state,
|
||||
* then revert to the parent.
|
||||
*
|
||||
* @param source
|
||||
* If this method is called by one of the child receivers,
|
||||
* the receiver object. If this method is called by itself,
|
||||
* null.
|
||||
*/
|
||||
public void joinByEnterElement( NGCCEventReceiver source,
|
||||
String uri, String local, String qname, Attributes atts ) throws SAXException {
|
||||
|
||||
if(isJoining) return; // we are already in the process of joining. ignore.
|
||||
isJoining = true;
|
||||
|
||||
// send special token to the rest of the branches.
|
||||
// these branches don't understand this token, so they will
|
||||
// try to move to a final state and send the token back to us,
|
||||
// which this object will ignore (because isJoining==true)
|
||||
// Otherwise branches will find an error.
|
||||
for( int i=0; i<_receivers.length; i++ )
|
||||
if( _receivers[i]!=source )
|
||||
_receivers[i].enterElement(uri,local,qname,atts);
|
||||
|
||||
// revert to the parent
|
||||
_parent._source.replace(this,_parent);
|
||||
_parent.onChildCompleted(null,_cookie,true);
|
||||
// send this event to the parent
|
||||
_parent.enterElement(uri,local,qname,atts);
|
||||
}
|
||||
|
||||
public void joinByLeaveElement( NGCCEventReceiver source,
|
||||
String uri, String local, String qname ) throws SAXException {
|
||||
|
||||
if(isJoining) return; // we are already in the process of joining. ignore.
|
||||
isJoining = true;
|
||||
|
||||
// send special token to the rest of the branches.
|
||||
// these branches don't understand this token, so they will
|
||||
// try to move to a final state and send the token back to us,
|
||||
// which this object will ignore (because isJoining==true)
|
||||
// Otherwise branches will find an error.
|
||||
for( int i=0; i<_receivers.length; i++ )
|
||||
if( _receivers[i]!=source )
|
||||
_receivers[i].leaveElement(uri,local,qname);
|
||||
|
||||
// revert to the parent
|
||||
_parent._source.replace(this,_parent);
|
||||
_parent.onChildCompleted(null,_cookie,true);
|
||||
// send this event to the parent
|
||||
_parent.leaveElement(uri,local,qname);
|
||||
}
|
||||
|
||||
public void joinByEnterAttribute( NGCCEventReceiver source,
|
||||
String uri, String local, String qname ) throws SAXException {
|
||||
|
||||
if(isJoining) return; // we are already in the process of joining. ignore.
|
||||
isJoining = true;
|
||||
|
||||
// send special token to the rest of the branches.
|
||||
// these branches don't understand this token, so they will
|
||||
// try to move to a final state and send the token back to us,
|
||||
// which this object will ignore (because isJoining==true)
|
||||
// Otherwise branches will find an error.
|
||||
for( int i=0; i<_receivers.length; i++ )
|
||||
if( _receivers[i]!=source )
|
||||
_receivers[i].enterAttribute(uri,local,qname);
|
||||
|
||||
// revert to the parent
|
||||
_parent._source.replace(this,_parent);
|
||||
_parent.onChildCompleted(null,_cookie,true);
|
||||
// send this event to the parent
|
||||
_parent.enterAttribute(uri,local,qname);
|
||||
}
|
||||
|
||||
public void joinByLeaveAttribute( NGCCEventReceiver source,
|
||||
String uri, String local, String qname ) throws SAXException {
|
||||
|
||||
if(isJoining) return; // we are already in the process of joining. ignore.
|
||||
isJoining = true;
|
||||
|
||||
// send special token to the rest of the branches.
|
||||
// these branches don't understand this token, so they will
|
||||
// try to move to a final state and send the token back to us,
|
||||
// which this object will ignore (because isJoining==true)
|
||||
// Otherwise branches will find an error.
|
||||
for( int i=0; i<_receivers.length; i++ )
|
||||
if( _receivers[i]!=source )
|
||||
_receivers[i].leaveAttribute(uri,local,qname);
|
||||
|
||||
// revert to the parent
|
||||
_parent._source.replace(this,_parent);
|
||||
_parent.onChildCompleted(null,_cookie,true);
|
||||
// send this event to the parent
|
||||
_parent.leaveAttribute(uri,local,qname);
|
||||
}
|
||||
|
||||
public void joinByText( NGCCEventReceiver source,
|
||||
String value ) throws SAXException {
|
||||
|
||||
if(isJoining) return; // we are already in the process of joining. ignore.
|
||||
isJoining = true;
|
||||
|
||||
// send special token to the rest of the branches.
|
||||
// these branches don't understand this token, so they will
|
||||
// try to move to a final state and send the token back to us,
|
||||
// which this object will ignore (because isJoining==true)
|
||||
// Otherwise branches will find an error.
|
||||
for( int i=0; i<_receivers.length; i++ )
|
||||
if( _receivers[i]!=source )
|
||||
_receivers[i].text(value);
|
||||
|
||||
// revert to the parent
|
||||
_parent._source.replace(this,_parent);
|
||||
_parent.onChildCompleted(null,_cookie,true);
|
||||
// send this event to the parent
|
||||
_parent.text(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// event dispatching methods
|
||||
//
|
||||
//
|
||||
|
||||
public void sendEnterAttribute( int threadId,
|
||||
String uri, String local, String qname) throws SAXException {
|
||||
|
||||
_receivers[threadId].enterAttribute(uri,local,qname);
|
||||
}
|
||||
|
||||
public void sendEnterElement( int threadId,
|
||||
String uri, String local, String qname, Attributes atts) throws SAXException {
|
||||
|
||||
_receivers[threadId].enterElement(uri,local,qname,atts);
|
||||
}
|
||||
|
||||
public void sendLeaveAttribute( int threadId,
|
||||
String uri, String local, String qname) throws SAXException {
|
||||
|
||||
_receivers[threadId].leaveAttribute(uri,local,qname);
|
||||
}
|
||||
|
||||
public void sendLeaveElement( int threadId,
|
||||
String uri, String local, String qname) throws SAXException {
|
||||
|
||||
_receivers[threadId].leaveElement(uri,local,qname);
|
||||
}
|
||||
|
||||
public void sendText(int threadId, String value) throws SAXException {
|
||||
_receivers[threadId].text(value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,555 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Stack;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
|
||||
/**
|
||||
* Runtime Engine for RELAXNGCC execution.
|
||||
*
|
||||
* This class has the following functionalities:
|
||||
*
|
||||
* <ol>
|
||||
* <li>Managing a stack of NGCCHandler objects and
|
||||
* switching between them appropriately.
|
||||
*
|
||||
* <li>Keep track of all Attributes.
|
||||
*
|
||||
* <li>manage mapping between namespace URIs and prefixes.
|
||||
*
|
||||
* <li>TODO: provide support for interleaving.
|
||||
*
|
||||
* @version $Id: NGCCRuntime.java,v 1.15 2002/09/29 02:55:48 okajima Exp $
|
||||
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
|
||||
*/
|
||||
public class NGCCRuntime implements ContentHandler, NGCCEventSource {
|
||||
|
||||
public NGCCRuntime() {
|
||||
reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the root handler, which will be used to parse the
|
||||
* root element.
|
||||
* <p>
|
||||
* This method can be called right after the object is created
|
||||
* or the reset method is called. You can't replace the root
|
||||
* handler while parsing is in progress.
|
||||
* <p>
|
||||
* Usually a generated class that corresponds to the <start>
|
||||
* pattern will be used as the root handler, but any NGCCHandler
|
||||
* can be a root handler.
|
||||
*
|
||||
* @exception IllegalStateException
|
||||
* If this method is called but it doesn't satisfy the
|
||||
* pre-condition stated above.
|
||||
*/
|
||||
public void setRootHandler( NGCCHandler rootHandler ) {
|
||||
if(currentHandler!=null)
|
||||
throw new IllegalStateException();
|
||||
currentHandler = rootHandler;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cleans up all the data structure so that the object can be reused later.
|
||||
* Normally, applications do not need to call this method directly,
|
||||
*
|
||||
* as the runtime resets itself after the endDocument method.
|
||||
*/
|
||||
public void reset() {
|
||||
attStack.clear();
|
||||
currentAtts = null;
|
||||
currentHandler = null;
|
||||
indent=0;
|
||||
locator = null;
|
||||
namespaces.clear();
|
||||
needIndent = true;
|
||||
redirect = null;
|
||||
redirectionDepth = 0;
|
||||
text = new StringBuffer();
|
||||
|
||||
// add a dummy attributes at the bottom as a "centinel."
|
||||
attStack.push(new AttributesImpl());
|
||||
}
|
||||
|
||||
// current content handler can be acccessed via set/getContentHandler.
|
||||
|
||||
private Locator locator;
|
||||
public void setDocumentLocator( Locator _loc ) { this.locator=_loc; }
|
||||
/**
|
||||
* Gets the source location of the current event.
|
||||
*
|
||||
* <p>
|
||||
* One can call this method from RelaxNGCC handlers to access
|
||||
* the line number information. Note that to
|
||||
*/
|
||||
public Locator getLocator() { return locator; }
|
||||
|
||||
|
||||
/** stack of {@link Attributes}. */
|
||||
private final Stack attStack = new Stack();
|
||||
/** current attributes set. always equal to attStack.peek() */
|
||||
private AttributesImpl currentAtts;
|
||||
|
||||
/**
|
||||
* Attributes that belong to the current element.
|
||||
* <p>
|
||||
* It's generally not recommended for applications to use
|
||||
* this method. RelaxNGCC internally removes processed attributes,
|
||||
* so this doesn't correctly reflect all the attributes an element
|
||||
* carries.
|
||||
*/
|
||||
public Attributes getCurrentAttributes() {
|
||||
return currentAtts;
|
||||
}
|
||||
|
||||
/** accumulated text. */
|
||||
private StringBuffer text = new StringBuffer();
|
||||
|
||||
|
||||
|
||||
|
||||
/** The current NGCCHandler. Always equals to handlerStack.peek() */
|
||||
private NGCCEventReceiver currentHandler;
|
||||
|
||||
public int replace( NGCCEventReceiver o, NGCCEventReceiver n ) {
|
||||
if(o!=currentHandler)
|
||||
throw new IllegalStateException(); // bug of RelaxNGCC
|
||||
currentHandler = n;
|
||||
|
||||
return 0; // we only have one thread.
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes buffered text.
|
||||
*
|
||||
* This method will be called by the start/endElement event to process
|
||||
* buffered text as a text event.
|
||||
*
|
||||
* <p>
|
||||
* Whitespace handling is a tricky business. Consider the following
|
||||
* schema fragment:
|
||||
*
|
||||
* <xmp>
|
||||
* <element name="foo">
|
||||
* <choice>
|
||||
* <element name="bar"><empty/></element>
|
||||
* <text/>
|
||||
* </choice>
|
||||
* </element>
|
||||
* </xmp>
|
||||
*
|
||||
* Assume we hit the following instance:
|
||||
* <xmp>
|
||||
* <foo> <bar/></foo>
|
||||
* </xmp>
|
||||
*
|
||||
* Then this first space needs to be ignored (for otherwise, we will
|
||||
* end up treating this space as the match to <text/> and won't
|
||||
* be able to process <bar>.)
|
||||
*
|
||||
* Now assume the following instance:
|
||||
* <xmp>
|
||||
* <foo/>
|
||||
* </xmp>
|
||||
*
|
||||
* This time, we need to treat this empty string as a text, for
|
||||
* otherwise we won't be able to accept this instance.
|
||||
*
|
||||
* <p>
|
||||
* This is very difficult to solve in general, but one seemingly
|
||||
* easy solution is to use the type of next event. If a text is
|
||||
* followed by a start tag, it follows from the constraint on
|
||||
* RELAX NG that that text must be either whitespaces or a match
|
||||
* to <text/>.
|
||||
*
|
||||
* <p>
|
||||
* On the contrary, if a text is followed by a end tag, then it
|
||||
* cannot be whitespace unless the content model can accept empty,
|
||||
* in which case sending a text event will be harmlessly ignored
|
||||
* by the NGCCHandler.
|
||||
*
|
||||
* <p>
|
||||
* Thus this method take one parameter, which controls the
|
||||
* behavior of this method.
|
||||
*
|
||||
* <p>
|
||||
* TODO: according to the constraint of RELAX NG, if characters
|
||||
* follow an end tag, then they must be either whitespaces or
|
||||
* must match to <text/>.
|
||||
*
|
||||
* @param possiblyWhitespace
|
||||
* True if the buffered character can be ignorabale. False if
|
||||
* it needs to be consumed.
|
||||
*/
|
||||
private void processPendingText(boolean ignorable) throws SAXException {
|
||||
if(ignorable && text.toString().trim().length()==0)
|
||||
; // ignore. See the above javadoc comment for the description
|
||||
else
|
||||
currentHandler.text(text.toString()); // otherwise consume this token
|
||||
|
||||
// truncate StringBuffer, but avoid excessive allocation.
|
||||
if(text.length()>1024) text = new StringBuffer();
|
||||
else text.setLength(0);
|
||||
}
|
||||
|
||||
public void processList( String str ) throws SAXException {
|
||||
StringTokenizer t = new StringTokenizer(str, " \t\r\n");
|
||||
while(t.hasMoreTokens())
|
||||
currentHandler.text(t.nextToken());
|
||||
}
|
||||
|
||||
public void startElement(String uri, String localname, String qname, Attributes atts)
|
||||
throws SAXException {
|
||||
|
||||
if(redirect!=null) {
|
||||
redirect.startElement(uri,localname,qname,atts);
|
||||
redirectionDepth++;
|
||||
} else {
|
||||
processPendingText(true);
|
||||
// System.out.println("startElement:"+localname+"->"+_attrStack.size());
|
||||
currentHandler.enterElement(uri, localname, qname, atts);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the generated handler code when an enter element
|
||||
* event is consumed.
|
||||
*
|
||||
* <p>
|
||||
* Pushes a new attribute set.
|
||||
*
|
||||
* <p>
|
||||
* Note that attributes are NOT pushed at the startElement method,
|
||||
* because the processing of the enterElement event can trigger
|
||||
* other attribute events and etc.
|
||||
* <p>
|
||||
* This method will be called from one of handlers when it truely
|
||||
* consumes the enterElement event.
|
||||
*/
|
||||
public void onEnterElementConsumed(
|
||||
String uri, String localName, String qname,Attributes atts) throws SAXException {
|
||||
attStack.push(currentAtts=new AttributesImpl(atts));
|
||||
nsEffectiveStack.push( new Integer(nsEffectivePtr) );
|
||||
nsEffectivePtr = namespaces.size();
|
||||
}
|
||||
|
||||
public void onLeaveElementConsumed(String uri, String localName, String qname) throws SAXException {
|
||||
attStack.pop();
|
||||
if(attStack.isEmpty())
|
||||
currentAtts = null;
|
||||
else
|
||||
currentAtts = (AttributesImpl)attStack.peek();
|
||||
nsEffectivePtr = ((Integer)nsEffectiveStack.pop()).intValue();
|
||||
}
|
||||
|
||||
public void endElement(String uri, String localname, String qname)
|
||||
throws SAXException {
|
||||
|
||||
if(redirect!=null) {
|
||||
redirect.endElement(uri,localname,qname);
|
||||
redirectionDepth--;
|
||||
|
||||
if(redirectionDepth!=0)
|
||||
return;
|
||||
|
||||
// finished redirection.
|
||||
for( int i=0; i<namespaces.size(); i+=2 )
|
||||
redirect.endPrefixMapping((String)namespaces.get(i));
|
||||
redirect.endDocument();
|
||||
|
||||
redirect = null;
|
||||
// then process this element normally
|
||||
}
|
||||
|
||||
processPendingText(false);
|
||||
|
||||
currentHandler.leaveElement(uri, localname, qname);
|
||||
// System.out.println("endElement:"+localname);
|
||||
}
|
||||
|
||||
public void characters(char[] ch, int start, int length) throws SAXException {
|
||||
if(redirect!=null)
|
||||
redirect.characters(ch,start,length);
|
||||
else
|
||||
text.append(ch,start,length);
|
||||
}
|
||||
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
|
||||
if(redirect!=null)
|
||||
redirect.ignorableWhitespace(ch,start,length);
|
||||
else
|
||||
text.append(ch,start,length);
|
||||
}
|
||||
|
||||
public int getAttributeIndex(String uri, String localname) {
|
||||
return currentAtts.getIndex(uri, localname);
|
||||
}
|
||||
public void consumeAttribute(int index) throws SAXException {
|
||||
final String uri = currentAtts.getURI(index);
|
||||
final String local = currentAtts.getLocalName(index);
|
||||
final String qname = currentAtts.getQName(index);
|
||||
final String value = currentAtts.getValue(index);
|
||||
currentAtts.removeAttribute(index);
|
||||
|
||||
currentHandler.enterAttribute(uri,local,qname);
|
||||
currentHandler.text(value);
|
||||
currentHandler.leaveAttribute(uri,local,qname);
|
||||
}
|
||||
|
||||
|
||||
public void startPrefixMapping( String prefix, String uri ) throws SAXException {
|
||||
if(redirect!=null)
|
||||
redirect.startPrefixMapping(prefix,uri);
|
||||
else {
|
||||
namespaces.add(prefix);
|
||||
namespaces.add(uri);
|
||||
}
|
||||
}
|
||||
|
||||
public void endPrefixMapping( String prefix ) throws SAXException {
|
||||
if(redirect!=null)
|
||||
redirect.endPrefixMapping(prefix);
|
||||
else {
|
||||
namespaces.remove(namespaces.size()-1);
|
||||
namespaces.remove(namespaces.size()-1);
|
||||
}
|
||||
}
|
||||
|
||||
public void skippedEntity( String name ) throws SAXException {
|
||||
if(redirect!=null)
|
||||
redirect.skippedEntity(name);
|
||||
}
|
||||
|
||||
public void processingInstruction( String target, String data ) throws SAXException {
|
||||
if(redirect!=null)
|
||||
redirect.processingInstruction(target,data);
|
||||
}
|
||||
|
||||
/** Impossible token. This value can never be a valid XML name. */
|
||||
static final String IMPOSSIBLE = "\u0000";
|
||||
|
||||
public void endDocument() throws SAXException {
|
||||
// consume the special "end document" token so that all the handlers
|
||||
// currently at the stack will revert to their respective parents.
|
||||
//
|
||||
// this is necessary to handle a grammar like
|
||||
// <start><ref name="X"/></start>
|
||||
// <define name="X">
|
||||
// <element name="root"><empty/></element>
|
||||
// </define>
|
||||
//
|
||||
// With this grammar, when the endElement event is consumed, two handlers
|
||||
// are on the stack (because a child object won't revert to its parent
|
||||
// unless it sees a next event.)
|
||||
|
||||
// pass around an "impossible" token.
|
||||
currentHandler.leaveElement(IMPOSSIBLE,IMPOSSIBLE,IMPOSSIBLE);
|
||||
|
||||
reset();
|
||||
}
|
||||
public void startDocument() {}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// event dispatching methods
|
||||
//
|
||||
//
|
||||
|
||||
public void sendEnterAttribute( int threadId,
|
||||
String uri, String local, String qname) throws SAXException {
|
||||
|
||||
currentHandler.enterAttribute(uri,local,qname);
|
||||
}
|
||||
|
||||
public void sendEnterElement( int threadId,
|
||||
String uri, String local, String qname, Attributes atts) throws SAXException {
|
||||
|
||||
currentHandler.enterElement(uri,local,qname,atts);
|
||||
}
|
||||
|
||||
public void sendLeaveAttribute( int threadId,
|
||||
String uri, String local, String qname) throws SAXException {
|
||||
|
||||
currentHandler.leaveAttribute(uri,local,qname);
|
||||
}
|
||||
|
||||
public void sendLeaveElement( int threadId,
|
||||
String uri, String local, String qname) throws SAXException {
|
||||
|
||||
currentHandler.leaveElement(uri,local,qname);
|
||||
}
|
||||
|
||||
public void sendText(int threadId, String value) throws SAXException {
|
||||
currentHandler.text(value);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// redirection of SAX2 events.
|
||||
//
|
||||
//
|
||||
/** When redirecting a sub-tree, this value will be non-null. */
|
||||
private ContentHandler redirect = null;
|
||||
|
||||
/**
|
||||
* Counts the depth of the elements when we are re-directing
|
||||
* a sub-tree to another ContentHandler.
|
||||
*/
|
||||
private int redirectionDepth = 0;
|
||||
|
||||
/**
|
||||
* This method can be called only from the enterElement handler.
|
||||
* The sub-tree rooted at the new element will be redirected
|
||||
* to the specified ContentHandler.
|
||||
*
|
||||
* <p>
|
||||
* Currently active NGCCHandler will only receive the leaveElement
|
||||
* event of the newly started element.
|
||||
*
|
||||
* @param uri,local,qname
|
||||
* Parameters passed to the enter element event. Used to
|
||||
* simulate the startElement event for the new ContentHandler.
|
||||
*/
|
||||
public void redirectSubtree( ContentHandler child,
|
||||
String uri, String local, String qname ) throws SAXException {
|
||||
|
||||
redirect = child;
|
||||
redirect.setDocumentLocator(locator);
|
||||
redirect.startDocument();
|
||||
|
||||
// TODO: when a prefix is re-bound to something else,
|
||||
// the following code is potentially dangerous. It should be
|
||||
// modified to report active bindings only.
|
||||
for( int i=0; i<namespaces.size(); i+=2 )
|
||||
redirect.startPrefixMapping(
|
||||
(String)namespaces.get(i),
|
||||
(String)namespaces.get(i+1)
|
||||
);
|
||||
|
||||
redirect.startElement(uri,local,qname,currentAtts);
|
||||
redirectionDepth=1;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// validation context implementation
|
||||
//
|
||||
//
|
||||
/** in-scope namespace mapping.
|
||||
* namespaces[2n ] := prefix
|
||||
* namespaces[2n+1] := namespace URI */
|
||||
private final ArrayList namespaces = new ArrayList();
|
||||
/**
|
||||
* Index on the namespaces array, which points to
|
||||
* the top of the effective bindings. Because of the
|
||||
* timing difference between the startPrefixMapping method
|
||||
* and the execution of the corresponding actions,
|
||||
* this value can be different from <code>namespaces.size()</code>.
|
||||
* <p>
|
||||
* For example, consider the following schema:
|
||||
* <pre><xmp>
|
||||
* <oneOrMore>
|
||||
* <element name="foo"><empty/></element>
|
||||
* </oneOrMore>
|
||||
* code fragment X
|
||||
* <element name="bob"/>
|
||||
* </xmp></pre>
|
||||
* Code fragment X is executed after we see a startElement event,
|
||||
* but at this time the namespaces variable already include new
|
||||
* namespace bindings declared on "bob".
|
||||
*/
|
||||
private int nsEffectivePtr=0;
|
||||
|
||||
/**
|
||||
* Stack to preserve old nsEffectivePtr values.
|
||||
*/
|
||||
private final Stack nsEffectiveStack = new Stack();
|
||||
|
||||
public String resolveNamespacePrefix( String prefix ) {
|
||||
for( int i = nsEffectivePtr-2; i>=0; i-=2 )
|
||||
if( namespaces.get(i).equals(prefix) )
|
||||
return (String)namespaces.get(i+1);
|
||||
|
||||
// no binding was found.
|
||||
if(prefix.equals("")) return ""; // return the default no-namespace
|
||||
if(prefix.equals("xml")) // pre-defined xml prefix
|
||||
return "http://www.w3.org/XML/1998/namespace";
|
||||
else return null; // prefix undefined
|
||||
}
|
||||
|
||||
|
||||
// error reporting
|
||||
protected void unexpectedX(String token) throws SAXException {
|
||||
throw new SAXParseException(MessageFormat.format(
|
||||
"Unexpected {0} appears at line {1} column {2}",
|
||||
new Object[]{
|
||||
token,
|
||||
new Integer(getLocator().getLineNumber()),
|
||||
new Integer(getLocator().getColumnNumber()) }),
|
||||
getLocator());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// trace functions
|
||||
//
|
||||
//
|
||||
private int indent=0;
|
||||
private boolean needIndent=true;
|
||||
private void printIndent() {
|
||||
for( int i=0; i<indent; i++ )
|
||||
System.out.print(" ");
|
||||
}
|
||||
public void trace( String s ) {
|
||||
if(needIndent) {
|
||||
needIndent=false;
|
||||
printIndent();
|
||||
}
|
||||
System.out.print(s);
|
||||
}
|
||||
public void traceln( String s ) {
|
||||
trace(s);
|
||||
trace("\n");
|
||||
needIndent=true;
|
||||
}
|
||||
}
|
||||
1315
jdkSrc/jdk8/com/sun/xml/internal/xsom/impl/parser/state/Schema.java
Normal file
1315
jdkSrc/jdk8/com/sun/xml/internal/xsom/impl/parser/state/Schema.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,390 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class SimpleType_List extends NGCCHandler {
|
||||
private Locator locator;
|
||||
private AnnotationImpl annotation;
|
||||
private String name;
|
||||
private UName itemTypeName;
|
||||
private Set finalSet;
|
||||
private ForeignAttributesImpl fa;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public SimpleType_List(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.annotation = _annotation;
|
||||
this.locator = _locator;
|
||||
this.fa = _fa;
|
||||
this.name = _name;
|
||||
this.finalSet = _finalSet;
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
|
||||
public SimpleType_List(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) {
|
||||
this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
result = new ListSimpleTypeImpl(
|
||||
$runtime.document, annotation, locator, fa,
|
||||
name, name==null, finalSet, itemType );
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
|
||||
itemType = new DelayedRef.SimpleType(
|
||||
$runtime, lloc, $runtime.currentSchema, itemTypeName);
|
||||
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
lloc=$runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 9:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 266, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 264, annotation,AnnotationContext.SIMPLETYPE_DECL);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action2();
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
NGCCHandler h = new simpleType(this, super._source, $runtime, 258);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 9:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","itemType"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 266, fa);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
action0();
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 9:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("itemType"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 266, fa);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("itemType"))) {
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("itemType"))) {
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 9:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 266, fa);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","itemType"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 260);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 266:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
break;
|
||||
case 264:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 258:
|
||||
{
|
||||
itemType = ((SimpleTypeImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 260:
|
||||
{
|
||||
itemTypeName = ((UName)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
/** computed simple type object */
|
||||
private ListSimpleTypeImpl result;
|
||||
|
||||
// reference to the base type
|
||||
private Ref.SimpleType itemType;
|
||||
|
||||
// locator of <list>
|
||||
private Locator lloc;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class SimpleType_Restriction extends NGCCHandler {
|
||||
private Locator locator;
|
||||
private AnnotationImpl annotation;
|
||||
private String name;
|
||||
private UName baseTypeName;
|
||||
private Set finalSet;
|
||||
private ForeignAttributesImpl fa;
|
||||
private XSFacet facet;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public SimpleType_Restriction(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.annotation = _annotation;
|
||||
this.locator = _locator;
|
||||
this.fa = _fa;
|
||||
this.name = _name;
|
||||
this.finalSet = _finalSet;
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
|
||||
public SimpleType_Restriction(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) {
|
||||
this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
result.addFacet(facet);
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
|
||||
result = new RestrictionSimpleTypeImpl(
|
||||
$runtime.document, annotation, locator, fa, name, name==null, finalSet, baseType );
|
||||
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
|
||||
baseType = new DelayedRef.SimpleType(
|
||||
$runtime, rloc, $runtime.currentSchema, baseTypeName );
|
||||
|
||||
}
|
||||
|
||||
private void action3()throws SAXException {
|
||||
rloc=$runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 12:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","base"))>=0 && ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || (((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 164, annotation,AnnotationContext.SIMPLETYPE_DECL);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
action1();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
NGCCHandler h = new simpleType(this, super._source, $runtime, 158);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
|
||||
NGCCHandler h = new facet(this, super._source, $runtime, 153);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
|
||||
NGCCHandler h = new facet(this, super._source, $runtime, 154);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action3();
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 12:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","base"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
action1();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("base"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
action1();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("base"))) {
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("base"))) {
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
action1();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 8:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 160);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 166, fa);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
action1();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","base"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 160:
|
||||
{
|
||||
baseTypeName = ((UName)$__result__);
|
||||
action2();
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
break;
|
||||
case 164:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
break;
|
||||
case 154:
|
||||
{
|
||||
facet = ((XSFacet)$__result__);
|
||||
action0();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 166:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
break;
|
||||
case 158:
|
||||
{
|
||||
baseType = ((SimpleTypeImpl)$__result__);
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
case 153:
|
||||
{
|
||||
facet = ((XSFacet)$__result__);
|
||||
action0();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
/** computed simple type object */
|
||||
private RestrictionSimpleTypeImpl result;
|
||||
|
||||
// reference to the base type
|
||||
private Ref.SimpleType baseType;
|
||||
|
||||
// location of restriction
|
||||
private Locator rloc;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,465 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
class SimpleType_Union extends NGCCHandler {
|
||||
private Locator locator;
|
||||
private AnnotationImpl annotation;
|
||||
private String __text;
|
||||
private UName memberTypeName;
|
||||
private String name;
|
||||
private Set finalSet;
|
||||
private ForeignAttributesImpl fa;
|
||||
private SimpleTypeImpl anonymousMemberType;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public SimpleType_Union(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.annotation = _annotation;
|
||||
this.locator = _locator;
|
||||
this.fa = _fa;
|
||||
this.name = _name;
|
||||
this.finalSet = _finalSet;
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
|
||||
public SimpleType_Union(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) {
|
||||
this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
result = new UnionSimpleTypeImpl(
|
||||
$runtime.document, annotation, locator, fa, name, name==null, finalSet,
|
||||
(Ref.SimpleType[])members.toArray(new Ref.SimpleType[members.size()]) );
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
|
||||
members.add(anonymousMemberType);
|
||||
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
|
||||
members.add( new DelayedRef.SimpleType(
|
||||
$runtime, uloc, $runtime.currentSchema, memberTypeName));
|
||||
|
||||
}
|
||||
|
||||
private void action3()throws SAXException {
|
||||
$runtime.processList(__text);}
|
||||
|
||||
private void action4()throws SAXException {
|
||||
uloc=$runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 183, annotation,AnnotationContext.SIMPLETYPE_DECL);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
NGCCHandler h = new simpleType(this, super._source, $runtime, 179);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action4();
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
NGCCHandler h = new simpleType(this, super._source, $runtime, 180);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 185, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
action0();
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 185, fa);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("memberTypes"))) {
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("memberTypes"))) {
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 187);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
__text = $value;
|
||||
$_ngcc_current_state = 9;
|
||||
action3();
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","memberTypes"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 188);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 183:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 187:
|
||||
{
|
||||
memberTypeName = ((UName)$__result__);
|
||||
action2();
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
break;
|
||||
case 179:
|
||||
{
|
||||
anonymousMemberType = ((SimpleTypeImpl)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 188:
|
||||
{
|
||||
memberTypeName = ((UName)$__result__);
|
||||
action2();
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
break;
|
||||
case 185:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
case 180:
|
||||
{
|
||||
anonymousMemberType = ((SimpleTypeImpl)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
/** computed simple type object */
|
||||
private UnionSimpleTypeImpl result;
|
||||
|
||||
// Vector of Ref.SimpleType
|
||||
private final Vector members = new Vector();
|
||||
|
||||
// locator of <union>
|
||||
private Locator uloc;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import com.sun.xml.internal.xsom.parser.AnnotationParser;
|
||||
|
||||
|
||||
class annotation extends NGCCHandler {
|
||||
private AnnotationContext context;
|
||||
private AnnotationImpl existing;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public annotation(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AnnotationImpl _existing, AnnotationContext _context) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.existing = _existing;
|
||||
this.context = _context;
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
|
||||
public annotation(NGCCRuntimeEx runtime, AnnotationImpl _existing, AnnotationContext _context) {
|
||||
this(null, runtime, runtime, -1, _existing, _context);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
locator = $runtime.copyLocator();
|
||||
parser = $runtime.createAnnotationParser();
|
||||
$runtime.redirectSubtree(parser.getContentHandler(
|
||||
context,
|
||||
$runtime.getAnnotationContextElementName(),
|
||||
$runtime.getErrorHandler(),
|
||||
$runtime.parser.getEntityResolver()
|
||||
), $uri, $localName, $qname );
|
||||
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action0();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private AnnotationParser parser;
|
||||
private Locator locator;
|
||||
|
||||
public AnnotationImpl makeResult() {
|
||||
Object e = null;
|
||||
if(existing!=null) e=existing.getAnnotation();
|
||||
|
||||
return new AnnotationImpl( parser.getResult(e),locator);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,535 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
class attributeDeclBody extends NGCCHandler {
|
||||
private String name;
|
||||
private ForeignAttributesImpl fa;
|
||||
private AnnotationImpl annotation;
|
||||
private Locator locator;
|
||||
private boolean isLocal;
|
||||
private String defaultValue;
|
||||
private UName typeName;
|
||||
private String fixedValue;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public attributeDeclBody(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, Locator _locator, boolean _isLocal, String _defaultValue, String _fixedValue) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.locator = _locator;
|
||||
this.isLocal = _isLocal;
|
||||
this.defaultValue = _defaultValue;
|
||||
this.fixedValue = _fixedValue;
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
|
||||
public attributeDeclBody(NGCCRuntimeEx runtime, Locator _locator, boolean _isLocal, String _defaultValue, String _fixedValue) {
|
||||
this(null, runtime, runtime, -1, _locator, _isLocal, _defaultValue, _fixedValue);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
type = new DelayedRef.SimpleType(
|
||||
$runtime, locator, $runtime.currentSchema, typeName );
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
formSpecified = true;
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 388, null,AnnotationContext.ATTRIBUTE_DECL);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","type"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 12;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
NGCCHandler h = new simpleType(this, super._source, $runtime, 379);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 12;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("type"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("form"))) {
|
||||
$_ngcc_current_state = 15;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 12;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("type"))) {
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("form"))) {
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
$_ngcc_current_state = 12;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("type"))) {
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 12;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if($value.equals("unqualified")) {
|
||||
NGCCHandler h = new qualification(this, super._source, $runtime, 395);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
else {
|
||||
if($value.equals("qualified")) {
|
||||
NGCCHandler h = new qualification(this, super._source, $runtime, 395);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
name = WhiteSpaceProcessor.collapse($value);
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 381);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 388:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 379:
|
||||
{
|
||||
type = ((SimpleTypeImpl)$__result__);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
break;
|
||||
case 390:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
break;
|
||||
case 395:
|
||||
{
|
||||
form = ((Boolean)$__result__).booleanValue();
|
||||
action1();
|
||||
$_ngcc_current_state = 14;
|
||||
}
|
||||
break;
|
||||
case 381:
|
||||
{
|
||||
typeName = ((UName)$__result__);
|
||||
action0();
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 7))));
|
||||
}
|
||||
|
||||
|
||||
private boolean form;
|
||||
private boolean formSpecified = false;
|
||||
|
||||
private AttributeDeclImpl makeResult() {
|
||||
|
||||
if(type==null)
|
||||
// type defaults to anySimpleType
|
||||
type = $runtime.parser.schemaSet.anySimpleType;
|
||||
|
||||
if(!formSpecified) form = $runtime.attributeFormDefault;
|
||||
// global attributes are always qualified
|
||||
if(!isLocal) form = true;
|
||||
|
||||
String tns;
|
||||
if(form==true) tns = $runtime.currentSchema.getTargetNamespace();
|
||||
else tns = "";
|
||||
|
||||
// proper handling of anonymous types
|
||||
return new AttributeDeclImpl( $runtime.document, tns, name,
|
||||
annotation, locator, fa, isLocal,
|
||||
$runtime.createXmlString(defaultValue),
|
||||
$runtime.createXmlString(fixedValue),
|
||||
type );
|
||||
}
|
||||
private Ref.SimpleType type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,451 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
class attributeGroupDecl extends NGCCHandler {
|
||||
private AnnotationImpl annotation;
|
||||
private String name;
|
||||
private ForeignAttributesImpl fa;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public attributeGroupDecl(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 14;
|
||||
}
|
||||
|
||||
public attributeGroupDecl(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
result = new AttGroupDeclImpl(
|
||||
$runtime.document, annotation, locator, fa, name );
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
locator=$runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 6:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute")))))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 246, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 241, result);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action1();
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 244, null,AnnotationContext.ATTRIBUTE_GROUP);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 3;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 246, fa);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 241, result);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 13:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("id"))) {
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("id"))) {
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","id"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 6;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
name = WhiteSpaceProcessor.collapse($value);
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 241:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 246:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
case 244:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private AttGroupDeclImpl result;
|
||||
private Locator locator;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,962 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class attributeUses extends NGCCHandler {
|
||||
private String use;
|
||||
private AttributesHolder owner;
|
||||
private ForeignAttributesImpl fa;
|
||||
private WildcardImpl wildcard;
|
||||
private AnnotationImpl annotation;
|
||||
private UName attDeclName;
|
||||
private AttributeDeclImpl anonymousDecl;
|
||||
private String defaultValue;
|
||||
private String fixedValue;
|
||||
private UName groupName;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public attributeUses(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AttributesHolder _owner) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.owner = _owner;
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
|
||||
public attributeUses(NGCCRuntimeEx runtime, AttributesHolder _owner) {
|
||||
this(null, runtime, runtime, -1, _owner);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
owner.setWildcard(wildcard);
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
wloc = $runtime.copyLocator();
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
|
||||
owner.addAttGroup(new DelayedRef.AttGroup(
|
||||
$runtime, locator, $runtime.currentSchema, groupName ));
|
||||
|
||||
}
|
||||
|
||||
private void action3()throws SAXException {
|
||||
locator=$runtime.copyLocator();
|
||||
}
|
||||
|
||||
private void action4()throws SAXException {
|
||||
|
||||
if("prohibited".equals(use))
|
||||
owner.addProhibitedAttribute(attDeclName);
|
||||
else
|
||||
owner.addAttributeUse(attDeclName,
|
||||
new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl,
|
||||
$runtime.createXmlString(defaultValue),
|
||||
$runtime.createXmlString(fixedValue),
|
||||
"required".equals(use)));
|
||||
|
||||
}
|
||||
|
||||
private void action5()throws SAXException {
|
||||
|
||||
decl = new DelayedRef.Attribute(
|
||||
$runtime, locator, $runtime.currentSchema, attDeclName );
|
||||
|
||||
}
|
||||
|
||||
private void action6()throws SAXException {
|
||||
|
||||
decl = anonymousDecl;
|
||||
attDeclName = new UName(
|
||||
anonymousDecl.getTargetNamespace(),
|
||||
anonymousDecl.getName());
|
||||
defaultValue = null;
|
||||
fixedValue = null;
|
||||
|
||||
}
|
||||
|
||||
private void action7()throws SAXException {
|
||||
|
||||
locator=$runtime.copyLocator();
|
||||
use=null;
|
||||
defaultValue=null;
|
||||
fixedValue=null;
|
||||
decl=null;
|
||||
annotation=null;
|
||||
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action7();
|
||||
$_ngcc_current_state = 33;
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action3();
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action1();
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
action2();
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0))) {
|
||||
NGCCHandler h = new wildcardBody(this, super._source, $runtime, 290, wloc);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","name"))>=0 || ($ai = $runtime.getAttributeIndex("","form"))>=0)) {
|
||||
NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 315, locator,true,defaultValue,fixedValue);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 33:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 29;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 25:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 17;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 29:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 25;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 297, null,AnnotationContext.ATTRIBUTE_USE);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
action4();
|
||||
$_ngcc_current_state = 15;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action7();
|
||||
$_ngcc_current_state = 33;
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action3();
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 308, null,AnnotationContext.ATTRIBUTE_USE);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 18;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
action2();
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(((($ai = $runtime.getAttributeIndex("","namespace"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ((($ai = $runtime.getAttributeIndex("","processContents"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute"))))) {
|
||||
NGCCHandler h = new wildcardBody(this, super._source, $runtime, 290, wloc);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if(((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) || (($ai = $runtime.getAttributeIndex("","form"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
|
||||
NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 315, locator,true,defaultValue,fixedValue);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 33:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 29;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 25:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 17;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 29:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 25;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
action4();
|
||||
$_ngcc_current_state = 15;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
{
|
||||
$_ngcc_current_state = 18;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 306, null);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
action2();
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
|
||||
NGCCHandler h = new wildcardBody(this, super._source, $runtime, 290, wloc);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if((($__uri.equals("") && $__local.equals("name")) || ($__uri.equals("") && $__local.equals("form")))) {
|
||||
NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 315, locator,true,defaultValue,fixedValue);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("") && $__local.equals("ref"))) {
|
||||
$_ngcc_current_state = 22;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 33:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("use"))) {
|
||||
$_ngcc_current_state = 35;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 29;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 25:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("fixed"))) {
|
||||
$_ngcc_current_state = 27;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 17;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 29:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("default"))) {
|
||||
$_ngcc_current_state = 31;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 25;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
action4();
|
||||
$_ngcc_current_state = 15;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("ref"))) {
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
{
|
||||
$_ngcc_current_state = 18;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
action2();
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 34:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("use"))) {
|
||||
$_ngcc_current_state = 29;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 26:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("fixed"))) {
|
||||
$_ngcc_current_state = 17;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("ref"))) {
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 33:
|
||||
{
|
||||
$_ngcc_current_state = 29;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 21:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("ref"))) {
|
||||
$_ngcc_current_state = 19;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 25:
|
||||
{
|
||||
$_ngcc_current_state = 17;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 30:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("default"))) {
|
||||
$_ngcc_current_state = 25;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 29:
|
||||
{
|
||||
$_ngcc_current_state = 25;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
action4();
|
||||
$_ngcc_current_state = 15;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
{
|
||||
$_ngcc_current_state = 18;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 31:
|
||||
{
|
||||
defaultValue = $value;
|
||||
$_ngcc_current_state = 30;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
action2();
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
|
||||
NGCCHandler h = new wildcardBody(this, super._source, $runtime, 290, wloc);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
else {
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
NGCCHandler h = new wildcardBody(this, super._source, $runtime, 290, wloc);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
|
||||
NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 315, locator,true,defaultValue,fixedValue);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
else {
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
NGCCHandler h = new attributeDeclBody(this, super._source, $runtime, 315, locator,true,defaultValue,fixedValue);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
else {
|
||||
if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 33:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","use"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 29;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 25:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 17;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 22:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 311);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 29:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","default"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 25;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 300);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 35:
|
||||
{
|
||||
use = $value;
|
||||
$_ngcc_current_state = 34;
|
||||
}
|
||||
break;
|
||||
case 27:
|
||||
{
|
||||
fixedValue = $value;
|
||||
$_ngcc_current_state = 26;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
action4();
|
||||
$_ngcc_current_state = 15;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","ref"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
{
|
||||
$_ngcc_current_state = 18;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 300:
|
||||
{
|
||||
groupName = ((UName)$__result__);
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
break;
|
||||
case 297:
|
||||
{
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
break;
|
||||
case 306:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 16;
|
||||
}
|
||||
break;
|
||||
case 290:
|
||||
{
|
||||
wildcard = ((WildcardImpl)$__result__);
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 315:
|
||||
{
|
||||
anonymousDecl = ((AttributeDeclImpl)$__result__);
|
||||
action6();
|
||||
$_ngcc_current_state = 16;
|
||||
}
|
||||
break;
|
||||
case 311:
|
||||
{
|
||||
attDeclName = ((UName)$__result__);
|
||||
action5();
|
||||
$_ngcc_current_state = 21;
|
||||
}
|
||||
break;
|
||||
case 308:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 18;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 5))));
|
||||
}
|
||||
|
||||
|
||||
private Ref.Attribute decl;
|
||||
private Locator wloc; // locator for wildcards
|
||||
private Locator locator;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class complexType_complexContent_body extends NGCCHandler {
|
||||
private AttributesHolder owner;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public complexType_complexContent_body(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, AttributesHolder _owner) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.owner = _owner;
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
|
||||
public complexType_complexContent_body(NGCCRuntimeEx runtime, AttributesHolder _owner) {
|
||||
this(null, runtime, runtime, -1, _owner);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
if(particle==null)
|
||||
particle = $runtime.parser.schemaSet.empty;
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("anyAttribute")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attribute"))))) {
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 1, owner);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 1, owner);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(particle, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))) {
|
||||
NGCCHandler h = new particle(this, super._source, $runtime, 3);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 1, owner);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(particle, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 1, owner);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(particle, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 1, owner);
|
||||
spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(particle, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
NGCCHandler h = new attributeUses(this, super._source, $runtime, 1, owner);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(particle, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 1:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
particle = ((ParticleImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private ContentTypeImpl particle;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class erSet extends NGCCHandler {
|
||||
private String v;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public erSet(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
|
||||
public erSet(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
v = $value;
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private Integer makeResult() {
|
||||
if(v==null) return new Integer($runtime.finalDefault);
|
||||
|
||||
if(v.indexOf("#all")!=-1)
|
||||
return new Integer(XSType.EXTENSION|XSType.RESTRICTION);
|
||||
|
||||
int r = 0;
|
||||
|
||||
if(v.indexOf("extension")!=-1) r|=XSType.EXTENSION;
|
||||
if(v.indexOf("restriction")!=-1) r|=XSType.RESTRICTION;
|
||||
|
||||
return new Integer(r);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class ersSet extends NGCCHandler {
|
||||
private String v;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public ersSet(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
|
||||
public ersSet(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
v = $value;
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private Integer makeResult() {
|
||||
if(v==null) return new Integer($runtime.blockDefault);
|
||||
|
||||
if(v.indexOf("#all")!=-1)
|
||||
return new Integer(
|
||||
XSType.EXTENSION|XSType.RESTRICTION|XSType.SUBSTITUTION);
|
||||
|
||||
int r = 0;
|
||||
|
||||
if(v.indexOf("extension")!=-1) r|=XSType.EXTENSION;
|
||||
if(v.indexOf("restriction")!=-1) r|=XSType.RESTRICTION;
|
||||
if(v.indexOf("substitution")!=-1) r|=XSType.SUBSTITUTION;
|
||||
|
||||
return new Integer(r);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,401 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class facet extends NGCCHandler {
|
||||
private AnnotationImpl annotation;
|
||||
private String fixed;
|
||||
private String value;
|
||||
private ForeignAttributesImpl fa;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public facet(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
|
||||
public facet(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
result = new FacetImpl( $runtime.document,
|
||||
annotation, locator, fa, $localName/*name of the facet*/,
|
||||
$runtime.createXmlString(value), $runtime.parseBoolean(fixed) );
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
locator=$runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 12:
|
||||
{
|
||||
if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action1();
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 230, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","value"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 228, null,AnnotationContext.SIMPLETYPE_DECL);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 230, fa);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if((((((((((((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minExclusive")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxExclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxInclusive"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("totalDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("fractionDigits"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("length"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("maxLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("minLength"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("enumeration"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("whiteSpace"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("pattern")))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
action0();
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","value"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("fixed"))) {
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("value"))) {
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 5:
|
||||
{
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("value"))) {
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("fixed"))) {
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","fixed"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
fixed = $value;
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","value"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
value = $value;
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 230:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 228:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private FacetImpl result;
|
||||
private Locator locator;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class foreignAttributes extends NGCCHandler {
|
||||
private ForeignAttributesImpl current;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public foreignAttributes(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, ForeignAttributesImpl _current) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.current = _current;
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
|
||||
public foreignAttributes(NGCCRuntimeEx runtime, ForeignAttributesImpl _current) {
|
||||
this(null, runtime, runtime, -1, _current);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
ForeignAttributesImpl makeResult() {
|
||||
return $runtime.parseForeignAttributes(current);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,444 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
class group extends NGCCHandler {
|
||||
private AnnotationImpl annotation;
|
||||
private String name;
|
||||
private ModelGroupImpl term;
|
||||
private ForeignAttributesImpl fa;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public group(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 15;
|
||||
}
|
||||
|
||||
public group(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
result = new ModelGroupDeclImpl( $runtime.document,
|
||||
annotation, loc, fa,
|
||||
$runtime.currentSchema.getTargetNamespace(),
|
||||
name,
|
||||
term
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
|
||||
mloc = $runtime.copyLocator();
|
||||
compositorName = $localName;
|
||||
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
loc = $runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 10:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 357, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 359, null,AnnotationContext.MODELGROUP_DECL);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action2();
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")) || ((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))))))) {
|
||||
NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 355, mloc,compositorName);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 10:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
action0();
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence")))) {
|
||||
NGCCHandler h = new modelGroupBody(this, super._source, $runtime, 355, mloc,compositorName);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 10:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("ID"))) {
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 11:
|
||||
{
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("ID"))) {
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 10:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","ID"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
$_ngcc_current_state = 5;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
name = WhiteSpaceProcessor.collapse($value);
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 357:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
case 359:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
break;
|
||||
case 355:
|
||||
{
|
||||
term = ((ModelGroupImpl)$__result__);
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private ModelGroupDeclImpl result;
|
||||
private Locator loc,mloc;
|
||||
private String compositorName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,590 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
class identityConstraint extends NGCCHandler {
|
||||
private String name;
|
||||
private UName ref;
|
||||
private ForeignAttributesImpl fa;
|
||||
private AnnotationImpl ann;
|
||||
private XPathImpl field;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public identityConstraint(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 18;
|
||||
}
|
||||
|
||||
public identityConstraint(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
fields.add(field);
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
|
||||
refer = new DelayedRef.IdentityConstraint(
|
||||
$runtime, $runtime.copyLocator(), $runtime.currentSchema, ref );
|
||||
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
if($localName.equals("key"))
|
||||
category = XSIdentityConstraint.KEY;
|
||||
else
|
||||
if($localName.equals("keyref"))
|
||||
category = XSIdentityConstraint.KEYREF;
|
||||
else
|
||||
if($localName.equals("unique"))
|
||||
category = XSIdentityConstraint.UNIQUE;
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 16:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","name"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 287, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
{
|
||||
if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action2();
|
||||
$_ngcc_current_state = 17;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 270);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 277, null,AnnotationContext.IDENTITY_CONSTRAINT);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","refer"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 274);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("key")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("keyref"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("unique")))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 287, null);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("field")))) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 270);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","refer"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("selector")))) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 274);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 16:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 15;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 287, null);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("xpath"))) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 270);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("refer"))) {
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("xpath"))) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 274);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("refer"))) {
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 15:
|
||||
{
|
||||
name = WhiteSpaceProcessor.collapse($value);
|
||||
$_ngcc_current_state = 14;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
NGCCHandler h = new qname(this, super._source, $runtime, 280);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 287, null);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 270);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","refer"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 8;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
NGCCHandler h = new xpath(this, super._source, $runtime, 274);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 270:
|
||||
{
|
||||
field = ((XPathImpl)$__result__);
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 287:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 16;
|
||||
}
|
||||
break;
|
||||
case 280:
|
||||
{
|
||||
ref = ((UName)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
break;
|
||||
case 277:
|
||||
{
|
||||
ann = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
break;
|
||||
case 274:
|
||||
{
|
||||
selector = ((XPathImpl)$__result__);
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private short category;
|
||||
private List fields = new ArrayList();
|
||||
private XPathImpl selector;
|
||||
private DelayedRef.IdentityConstraint refer = null;
|
||||
|
||||
private IdentityConstraintImpl makeResult() {
|
||||
return new IdentityConstraintImpl($runtime.document,ann,$runtime.copyLocator(),fa,
|
||||
category,name,selector,fields,refer);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,374 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class importDecl extends NGCCHandler {
|
||||
private String ns;
|
||||
private String schemaLocation;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public importDecl(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
|
||||
public importDecl(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
if(ns==null) ns="";
|
||||
$runtime.importSchema( ns,schemaLocation );
|
||||
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 340, null,AnnotationContext.SCHEMA);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("import"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
action0();
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("namespace"))) {
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 9:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("namespace"))) {
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
ns = $value;
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
schemaLocation = $value;
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 340:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class includeDecl extends NGCCHandler {
|
||||
private String schemaLocation;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public includeDecl(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
|
||||
public includeDecl(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
$runtime.includeSchema( schemaLocation );
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 372, null,AnnotationContext.SCHEMA);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("include"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
action0();
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
schemaLocation = $value;
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 372:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,370 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
class modelGroupBody extends NGCCHandler {
|
||||
private AnnotationImpl annotation;
|
||||
private String compositorName;
|
||||
private Locator locator;
|
||||
private ParticleImpl childParticle;
|
||||
private ForeignAttributesImpl fa;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public modelGroupBody(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, Locator _locator, String _compositorName) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.locator = _locator;
|
||||
this.compositorName = _compositorName;
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
|
||||
public modelGroupBody(NGCCRuntimeEx runtime, Locator _locator, String _compositorName) {
|
||||
this(null, runtime, runtime, -1, _locator, _compositorName);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
|
||||
XSModelGroup.Compositor compositor = null;
|
||||
if(compositorName.equals("all")) compositor = XSModelGroup.ALL;
|
||||
if(compositorName.equals("sequence")) compositor = XSModelGroup.SEQUENCE;
|
||||
if(compositorName.equals("choice")) compositor = XSModelGroup.CHOICE;
|
||||
if(compositor==null)
|
||||
throw new InternalError("unable to process "+compositorName);
|
||||
|
||||
result = new ModelGroupImpl( $runtime.document, annotation, locator, fa, compositor,
|
||||
(ParticleImpl[])particles.toArray(new ParticleImpl[0]));
|
||||
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
|
||||
particles.add(childParticle);
|
||||
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 174, null,AnnotationContext.MODELGROUP);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))) {
|
||||
NGCCHandler h = new particle(this, super._source, $runtime, 171);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any"))))))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 176, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 176, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("element")) || (((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("all")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("choice"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("sequence"))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("any")))))) {
|
||||
NGCCHandler h = new particle(this, super._source, $runtime, 170);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
action0();
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 176, null);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 176, null);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 176, null);
|
||||
spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 176, null);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 174:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 176:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
break;
|
||||
case 171:
|
||||
{
|
||||
childParticle = ((ParticleImpl)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 170:
|
||||
{
|
||||
childParticle = ((ParticleImpl)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return((($_ngcc_current_state == 1) || (($_ngcc_current_state == 2) || (($_ngcc_current_state == 4) || ($_ngcc_current_state == 0)))));
|
||||
}
|
||||
|
||||
|
||||
private ModelGroupImpl result;
|
||||
|
||||
private final List particles = new ArrayList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,477 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
class notation extends NGCCHandler {
|
||||
private String name;
|
||||
private String pub;
|
||||
private ForeignAttributesImpl fa;
|
||||
private String sys;
|
||||
private AnnotationImpl ann;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public notation(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 16;
|
||||
}
|
||||
|
||||
public notation(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
loc = $runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 209, null,AnnotationContext.NOTATION);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action0();
|
||||
$_ngcc_current_state = 15;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","name"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("notation"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("system"))) {
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("public"))) {
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("public"))) {
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("system"))) {
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
pub = $value;
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 224, null);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","system"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","public"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 4;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
name = WhiteSpaceProcessor.collapse($value);
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
sys = $value;
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 209:
|
||||
{
|
||||
ann = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 224:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 14;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private Locator loc;
|
||||
private XSNotation makeResult() {
|
||||
return new NotationImpl( $runtime.document,ann,loc,fa,name,pub,sys);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
class occurs extends NGCCHandler {
|
||||
private String v;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public occurs(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
|
||||
public occurs(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
min = new BigInteger(v);
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
max=BigInteger.valueOf(-1);
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
max = new BigInteger(v);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("minOccurs"))) {
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("minOccurs"))) {
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("maxOccurs"))) {
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","minOccurs"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
v = $value;
|
||||
$_ngcc_current_state = 2;
|
||||
action0();
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","maxOccurs"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if($value.equals("unbounded")) {
|
||||
$_ngcc_current_state = 6;
|
||||
action1();
|
||||
}
|
||||
else {
|
||||
v = $value;
|
||||
$_ngcc_current_state = 6;
|
||||
action2();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return((($_ngcc_current_state == 5) || (($_ngcc_current_state == 0) || ($_ngcc_current_state == 1))));
|
||||
}
|
||||
|
||||
|
||||
BigInteger max = BigInteger.valueOf(1);
|
||||
BigInteger min = BigInteger.valueOf(1);
|
||||
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
class qname extends NGCCHandler {
|
||||
private String qvalue;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public qname(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
|
||||
public qname(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute($runtime.parseUName(qvalue), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText($runtime.parseUName(qvalue), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
qvalue = WhiteSpaceProcessor.collapse($value);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class qualification extends NGCCHandler {
|
||||
private String text;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public qualification(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
|
||||
public qualification(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(new Boolean(text.trim().equals("qualified")), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(new Boolean(text.trim().equals("qualified")), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(new Boolean(text.trim().equals("qualified")), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(new Boolean(text.trim().equals("qualified")), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(new Boolean(text.trim().equals("qualified")), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if($value.equals("qualified")) {
|
||||
text = $value;
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
if($value.equals("unqualified")) {
|
||||
text = $value;
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class redefine extends NGCCHandler {
|
||||
private String schemaLocation;
|
||||
private ModelGroupDeclImpl newGrp;
|
||||
private AttGroupDeclImpl newAg;
|
||||
private SimpleTypeImpl newSt;
|
||||
private ComplexTypeImpl newCt;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public redefine(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 15;
|
||||
}
|
||||
|
||||
public redefine(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
XSAttGroupDecl oldAg = $runtime.currentSchema.getAttGroupDecl(newAg.getName());
|
||||
if(oldAg==null) {
|
||||
$runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_ATTRIBUTEGROUP,newAg.getName()) );
|
||||
} else {
|
||||
newAg.redefine((AttGroupDeclImpl)oldAg);
|
||||
$runtime.currentSchema.addAttGroupDecl(newAg,true);
|
||||
}
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
XSModelGroupDecl oldGrp = $runtime.currentSchema.getModelGroupDecl(newGrp.getName());
|
||||
if(oldGrp==null) {
|
||||
$runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_MODELGROUP,newGrp.getName()) );
|
||||
} else {
|
||||
newGrp.redefine((ModelGroupDeclImpl)oldGrp);
|
||||
$runtime.currentSchema.addModelGroupDecl(newGrp,true);
|
||||
}
|
||||
}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
XSComplexType oldCt = $runtime.currentSchema.getComplexType(newCt.getName());
|
||||
if(oldCt==null) {
|
||||
$runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_COMPLEXTYPE,newCt.getName()) );
|
||||
} else {
|
||||
newCt.redefine((ComplexTypeImpl)oldCt);
|
||||
$runtime.currentSchema.addComplexType(newCt,true);
|
||||
}
|
||||
}
|
||||
|
||||
private void action3()throws SAXException {
|
||||
XSSimpleType oldSt = $runtime.currentSchema.getSimpleType(newSt.getName());
|
||||
if(oldSt==null) {
|
||||
$runtime.reportError( Messages.format(Messages.ERR_UNDEFINED_SIMPLETYPE,newSt.getName()) );
|
||||
} else {
|
||||
newSt.redefine((SimpleTypeImpl)oldSt);
|
||||
$runtime.currentSchema.addSimpleType(newSt,true);
|
||||
}
|
||||
}
|
||||
|
||||
private void action4()throws SAXException {
|
||||
$runtime.includeSchema( schemaLocation );
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 684, null,AnnotationContext.SCHEMA);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
NGCCHandler h = new simpleType(this, super._source, $runtime, 685);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
|
||||
NGCCHandler h = new complexType(this, super._source, $runtime, 686);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
|
||||
NGCCHandler h = new group(this, super._source, $runtime, 687);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 688);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 689, null,AnnotationContext.SCHEMA);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
NGCCHandler h = new simpleType(this, super._source, $runtime, 690);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("complexType"))) {
|
||||
NGCCHandler h = new complexType(this, super._source, $runtime, 691);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("group"))) {
|
||||
NGCCHandler h = new group(this, super._source, $runtime, 692);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("attributeGroup"))) {
|
||||
NGCCHandler h = new attributeGroupDecl(this, super._source, $runtime, 693);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 14;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("redefine"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schemaLocation"))) {
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
{
|
||||
schemaLocation = $value;
|
||||
$_ngcc_current_state = 12;
|
||||
action4();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 689:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 690:
|
||||
{
|
||||
newSt = ((SimpleTypeImpl)$__result__);
|
||||
action3();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 691:
|
||||
{
|
||||
newCt = ((ComplexTypeImpl)$__result__);
|
||||
action2();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 692:
|
||||
{
|
||||
newGrp = ((ModelGroupDeclImpl)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 693:
|
||||
{
|
||||
newAg = ((AttGroupDeclImpl)$__result__);
|
||||
action0();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 684:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 685:
|
||||
{
|
||||
newSt = ((SimpleTypeImpl)$__result__);
|
||||
action3();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 686:
|
||||
{
|
||||
newCt = ((ComplexTypeImpl)$__result__);
|
||||
action2();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 687:
|
||||
{
|
||||
newGrp = ((ModelGroupDeclImpl)$__result__);
|
||||
action1();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 688:
|
||||
{
|
||||
newAg = ((AttGroupDeclImpl)$__result__);
|
||||
action0();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,503 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
|
||||
import com.sun.xml.internal.bind.WhiteSpaceProcessor;
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
class simpleType extends NGCCHandler {
|
||||
private AnnotationImpl annotation;
|
||||
private String name;
|
||||
private ForeignAttributesImpl fa;
|
||||
private String finalValue;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public simpleType(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 19;
|
||||
}
|
||||
|
||||
public simpleType(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
finalSet = makeFinalSet(finalValue);
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
locator=$runtime.copyLocator();
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 15:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 11;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
action1();
|
||||
$_ngcc_current_state = 15;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 89, null,AnnotationContext.SIMPLETYPE_DECL);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction")) || (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list")))))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 91, fa);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(result, super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("restriction"))) {
|
||||
NGCCHandler h = new SimpleType_Restriction(this, super._source, $runtime, 85, annotation,locator,fa,name,finalSet);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("list"))) {
|
||||
NGCCHandler h = new SimpleType_List(this, super._source, $runtime, 86, annotation,locator,fa,name,finalSet);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("union"))) {
|
||||
NGCCHandler h = new SimpleType_Union(this, super._source, $runtime, 80, annotation,locator,fa,name,finalSet);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 15:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 11;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 15:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("final"))) {
|
||||
$_ngcc_current_state = 17;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 11;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 13;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 15:
|
||||
{
|
||||
$_ngcc_current_state = 11;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("name"))) {
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("final"))) {
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(result, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 13:
|
||||
{
|
||||
name = WhiteSpaceProcessor.collapse($value);
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","final"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 11;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 10;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
$_ngcc_current_state = 7;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
action0();
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
finalValue = $value;
|
||||
$_ngcc_current_state = 16;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(result, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 89:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
break;
|
||||
case 91:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
break;
|
||||
case 85:
|
||||
{
|
||||
result = ((RestrictionSimpleTypeImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 86:
|
||||
{
|
||||
result = ((ListSimpleTypeImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 80:
|
||||
{
|
||||
result = ((UnionSimpleTypeImpl)$__result__);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
/** computed simple type object */
|
||||
private SimpleTypeImpl result;
|
||||
|
||||
private Locator locator;
|
||||
|
||||
private Set finalSet;
|
||||
|
||||
private Set makeFinalSet(String finalValue) {
|
||||
if(finalValue==null)
|
||||
return Collections.EMPTY_SET;
|
||||
|
||||
Set s = new HashSet();
|
||||
StringTokenizer tokens = new StringTokenizer(finalValue);
|
||||
while(tokens.hasMoreTokens()) {
|
||||
String token = tokens.nextToken();
|
||||
if(token.equals("#all")) {
|
||||
s.add(XSVariety.ATOMIC);
|
||||
s.add(XSVariety.UNION);
|
||||
s.add(XSVariety.LIST);
|
||||
}
|
||||
if(token.equals("list")) {
|
||||
s.add(XSVariety.LIST);
|
||||
}
|
||||
if(token.equals("union")) {
|
||||
s.add(XSVariety.UNION);
|
||||
}
|
||||
if(token.equals("restriction")) {
|
||||
s.add(XSVariety.ATOMIC);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,446 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.HashSet;
|
||||
|
||||
|
||||
class wildcardBody extends NGCCHandler {
|
||||
private AnnotationImpl annotation;
|
||||
private Locator locator;
|
||||
private String modeValue;
|
||||
private String ns;
|
||||
private ForeignAttributesImpl fa;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public wildcardBody(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, Locator _locator) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.locator = _locator;
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
|
||||
public wildcardBody(NGCCRuntimeEx runtime, Locator _locator) {
|
||||
this(null, runtime, runtime, -1, _locator);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 411, null,AnnotationContext.WILDCARD);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 9;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","namespace"))>=0 || ($ai = $runtime.getAttributeIndex("","processContents"))>=0)) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 9;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("namespace"))) {
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("processContents"))) {
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if((($__uri.equals("") && $__local.equals("namespace")) || ($__uri.equals("") && $__local.equals("processContents")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 9;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("processContents"))) {
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 9;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("namespace"))) {
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 1:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
ns = $value;
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","processContents"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
else {
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
else {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 409, null);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
$_ngcc_current_state = 9;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
modeValue = $value;
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 409:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
break;
|
||||
case 411:
|
||||
{
|
||||
annotation = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 9;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 5) || ($_ngcc_current_state == 1))));
|
||||
}
|
||||
|
||||
|
||||
private WildcardImpl makeResult() {
|
||||
if(modeValue==null) modeValue="strict";
|
||||
|
||||
int mode=-1;
|
||||
if(modeValue.equals("strict")) mode = XSWildcard.STRTICT;
|
||||
if(modeValue.equals("lax")) mode = XSWildcard.LAX;
|
||||
if(modeValue.equals("skip")) mode = XSWildcard.SKIP;
|
||||
if(mode==-1) throw new InternalError();
|
||||
|
||||
if(ns==null || ns.equals("##any"))
|
||||
return new WildcardImpl.Any( $runtime.document, annotation,locator,fa,mode);
|
||||
|
||||
if(ns.equals("##other"))
|
||||
return new WildcardImpl.Other( $runtime.document,
|
||||
annotation,locator,fa,
|
||||
$runtime.currentSchema.getTargetNamespace(),mode);
|
||||
|
||||
StringTokenizer tokens = new StringTokenizer(ns);
|
||||
HashSet s = new HashSet();
|
||||
while(tokens.hasMoreTokens()) {
|
||||
String ns = tokens.nextToken();
|
||||
if(ns.equals("##local")) ns="";
|
||||
if(ns.equals("##targetNamespace")) ns=$runtime.currentSchema.getTargetNamespace();
|
||||
s.add(ns);
|
||||
}
|
||||
|
||||
return new WildcardImpl.Finite( $runtime.document, annotation,locator,fa,s,mode);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.xml.internal.xsom.impl.parser.state;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx;
|
||||
|
||||
import com.sun.xml.internal.xsom.*;
|
||||
import com.sun.xml.internal.xsom.parser.*;
|
||||
import com.sun.xml.internal.xsom.impl.*;
|
||||
import com.sun.xml.internal.xsom.impl.parser.*;
|
||||
import org.xml.sax.Locator;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.helpers.*;
|
||||
import java.util.*;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
||||
|
||||
class xpath extends NGCCHandler {
|
||||
private String xpath;
|
||||
private ForeignAttributesImpl fa;
|
||||
private AnnotationImpl ann;
|
||||
protected final NGCCRuntimeEx $runtime;
|
||||
private int $_ngcc_current_state;
|
||||
protected String $uri;
|
||||
protected String $localName;
|
||||
protected String $qname;
|
||||
|
||||
public final NGCCRuntime getRuntime() {
|
||||
return($runtime);
|
||||
}
|
||||
|
||||
public xpath(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
|
||||
public xpath(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if((($ai = $runtime.getAttributeIndex("","xpath"))>=0 && ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 77, null);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
|
||||
NGCCHandler h = new annotation(this, super._source, $runtime, 72, null,AnnotationContext.XPATH);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 77, null);
|
||||
spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("xpath"))) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 77, null);
|
||||
spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("xpath"))) {
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedEnterAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
|
||||
int $ai;
|
||||
$uri = $__uri;
|
||||
$localName = $__local;
|
||||
$qname = $__qname;
|
||||
switch($_ngcc_current_state) {
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("xpath"))) {
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void text(String $value) throws SAXException {
|
||||
int $ai;
|
||||
switch($_ngcc_current_state) {
|
||||
case 4:
|
||||
{
|
||||
xpath = $value;
|
||||
$_ngcc_current_state = 3;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(makeResult(), super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 77, null);
|
||||
spawnChildFromText(h, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
$_ngcc_current_state = 0;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","xpath"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
|
||||
switch($__cookie__) {
|
||||
case 77:
|
||||
{
|
||||
fa = ((ForeignAttributesImpl)$__result__);
|
||||
$_ngcc_current_state = 5;
|
||||
}
|
||||
break;
|
||||
case 72:
|
||||
{
|
||||
ann = ((AnnotationImpl)$__result__);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return((($_ngcc_current_state == 1) || ($_ngcc_current_state == 0)));
|
||||
}
|
||||
|
||||
|
||||
private XPathImpl makeResult() {
|
||||
return new XPathImpl($runtime.document,ann,$runtime.copyLocator(),fa,
|
||||
$runtime.createXmlString(xpath));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user