feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
@@ -0,0 +1,629 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// 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.tools.internal.jxc.gen.config;
|
||||
|
||||
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>
|
||||
*
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></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
|
||||
338
jdkSrc/jdk8/com/sun/tools/internal/jxc/gen/config/Classes.java
Normal file
338
jdkSrc/jdk8/com/sun/tools/internal/jxc/gen/config/Classes.java
Normal file
@@ -0,0 +1,338 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.tools.internal.jxc.gen.config;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.tools.internal.jxc.NGCCRuntimeEx;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
*/
|
||||
public class Classes extends NGCCHandler {
|
||||
private String __text;
|
||||
private String exclude_content;
|
||||
private String include_content;
|
||||
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 Classes(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 12;
|
||||
}
|
||||
|
||||
public Classes(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
this.excludes.add(exclude_content);
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
$runtime.processList(__text);}
|
||||
|
||||
private void action2()throws SAXException {
|
||||
this.includes.add(include_content);
|
||||
}
|
||||
|
||||
private void action3()throws SAXException {
|
||||
$runtime.processList(__text);}
|
||||
|
||||
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("") && $__local.equals("classes"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 11;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("excludes"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("includes"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
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 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("classes"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("excludes"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("includes"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
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 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$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 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
$_ngcc_current_state = 3;
|
||||
$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 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
exclude_content = $value;
|
||||
$_ngcc_current_state = 3;
|
||||
action0();
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
__text = $value;
|
||||
$_ngcc_current_state = 9;
|
||||
action3();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
exclude_content = $value;
|
||||
$_ngcc_current_state = 3;
|
||||
action0();
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
__text = $value;
|
||||
$_ngcc_current_state = 4;
|
||||
action1();
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
{
|
||||
include_content = $value;
|
||||
$_ngcc_current_state = 8;
|
||||
action2();
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
include_content = $value;
|
||||
$_ngcc_current_state = 8;
|
||||
action2();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
|
||||
switch(cookie) {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private List includes = new ArrayList();
|
||||
public List getIncludes() { return $runtime.getIncludePatterns(this.includes);}
|
||||
private List excludes = new ArrayList();
|
||||
public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);}
|
||||
|
||||
}
|
||||
336
jdkSrc/jdk8/com/sun/tools/internal/jxc/gen/config/Config.java
Normal file
336
jdkSrc/jdk8/com/sun/tools/internal/jxc/gen/config/Config.java
Normal file
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.tools.internal.jxc.gen.config;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.tools.internal.jxc.NGCCRuntimeEx;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
*/
|
||||
public class Config extends NGCCHandler {
|
||||
private String bd;
|
||||
private Schema _schema;
|
||||
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 Config(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
|
||||
public Config(NGCCRuntimeEx runtime) {
|
||||
this(null, runtime, runtime, -1);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
this.schema.add (_schema);
|
||||
}
|
||||
|
||||
private void action1()throws SAXException {
|
||||
baseDir = $runtime.getBaseDir(bd);
|
||||
}
|
||||
|
||||
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("") && $__local.equals("schema"))) {
|
||||
NGCCHandler h = new Schema(this, super._source, $runtime, 19, baseDir);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("config"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("classes"))) {
|
||||
NGCCHandler h = new Classes(this, super._source, $runtime, 22);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
unexpectedEnterElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schema"))) {
|
||||
NGCCHandler h = new Schema(this, super._source, $runtime, 20, baseDir);
|
||||
spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","baseDir"))>=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(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("config"))) {
|
||||
$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;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","baseDir"))>=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(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("baseDir"))) {
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
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(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("baseDir"))) {
|
||||
$_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 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
bd = $value;
|
||||
$_ngcc_current_state = 5;
|
||||
action1();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","baseDir"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
|
||||
switch(cookie) {
|
||||
case 19:
|
||||
{
|
||||
this._schema = ((Schema)result);
|
||||
action0();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
case 22:
|
||||
{
|
||||
this.classes = ((Classes)result);
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
break;
|
||||
case 20:
|
||||
{
|
||||
this._schema = ((Schema)result);
|
||||
action0();
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean accepted() {
|
||||
return(($_ngcc_current_state == 0));
|
||||
}
|
||||
|
||||
|
||||
private File baseDir;
|
||||
private Classes classes;
|
||||
private List schema = new ArrayList();
|
||||
public Classes getClasses() { return this.classes;}
|
||||
public File getBaseDir() { return baseDir;}
|
||||
public List getSchema() { return this.schema;}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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.tools.internal.jxc.gen.config;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
*
|
||||
* @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,52 @@
|
||||
/*
|
||||
* 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.tools.internal.jxc.gen.config;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
*
|
||||
* @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,193 @@
|
||||
/*
|
||||
* 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.tools.internal.jxc.gen.config;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
*
|
||||
* @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,353 @@
|
||||
/*
|
||||
* 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.tools.internal.jxc.gen.config;
|
||||
|
||||
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.
|
||||
*
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
* @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,557 @@
|
||||
/*
|
||||
* 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.tools.internal.jxc.gen.config;
|
||||
|
||||
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.
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
331
jdkSrc/jdk8/com/sun/tools/internal/jxc/gen/config/Schema.java
Normal file
331
jdkSrc/jdk8/com/sun/tools/internal/jxc/gen/config/Schema.java
Normal file
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* this file is generated by RelaxNGCC */
|
||||
package com.sun.tools.internal.jxc.gen.config;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.XMLReader;
|
||||
import org.xml.sax.Attributes;
|
||||
import com.sun.tools.internal.jxc.NGCCRuntimeEx;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* <p><b>
|
||||
* Auto-generated, do not edit.
|
||||
* </b></p>
|
||||
*/
|
||||
public class Schema extends NGCCHandler {
|
||||
private File baseDir;
|
||||
private String loc;
|
||||
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 Schema(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, File _baseDir) {
|
||||
super(source, parent, cookie);
|
||||
$runtime = runtime;
|
||||
this.baseDir = _baseDir;
|
||||
$_ngcc_current_state = 10;
|
||||
}
|
||||
|
||||
public Schema(NGCCRuntimeEx runtime, File _baseDir) {
|
||||
this(null, runtime, runtime, -1, _baseDir);
|
||||
}
|
||||
|
||||
private void action0()throws SAXException {
|
||||
location = new File(baseDir,loc);
|
||||
}
|
||||
|
||||
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 2:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","location"))>=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 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=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 10:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("schema"))) {
|
||||
$runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs);
|
||||
$_ngcc_current_state = 6;
|
||||
}
|
||||
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("") && $__local.equals("schema"))) {
|
||||
$runtime.onLeaveElementConsumed($__uri, $__local, $__qname);
|
||||
$_ngcc_current_state = 0;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveElement($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","location"))>=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 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$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 2:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("location"))) {
|
||||
$_ngcc_current_state = 4;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("namespace"))) {
|
||||
$_ngcc_current_state = 8;
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$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 3:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("location"))) {
|
||||
$_ngcc_current_state = 1;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
{
|
||||
if(($__uri.equals("") && $__local.equals("namespace"))) {
|
||||
$_ngcc_current_state = 2;
|
||||
}
|
||||
else {
|
||||
unexpectedLeaveAttribute($__qname);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
$_ngcc_current_state = 2;
|
||||
$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:
|
||||
{
|
||||
namespace = $value;
|
||||
$_ngcc_current_state = 7;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
loc = $value;
|
||||
$_ngcc_current_state = 3;
|
||||
action0();
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
revertToParentFromText(this, super._cookie, $value);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","location"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 1;
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
if(($ai = $runtime.getAttributeIndex("","namespace"))>=0) {
|
||||
$runtime.consumeAttribute($ai);
|
||||
$runtime.sendText(super._cookie, $value);
|
||||
}
|
||||
else {
|
||||
$_ngcc_current_state = 2;
|
||||
$runtime.sendText(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 File location;
|
||||
private String namespace;
|
||||
public String getNamespace() { return this.namespace;}
|
||||
public File getLocation() { return this.location;}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user