New Upstream Release - libjaxp1.3-java
Ready changes
Summary
Merged new upstream version: 1.4.01 (was: 1.3.05).
Resulting package
Built on 2022-05-05T19:10 (took 3m41s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases libjaxp1.3-java
Lintian Result
Diff
diff --git a/LICENSE.dom-software.txt b/LICENSE.dom-software.txt
index 5b4f6a1..81125fe 100644
--- a/LICENSE.dom-software.txt
+++ b/LICENSE.dom-software.txt
@@ -1,4 +1,4 @@
-xml-commons/java/external/LICENSE.dom-software.txt $Id: LICENSE.dom-software.txt 734315 2009-01-14 03:33:42Z mrglavas $
+xml-commons/java/external/LICENSE.dom-software.txt $Id: LICENSE.dom-software.txt 734314 2009-01-14 03:33:27Z mrglavas $
This license came from: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.zip (COPYRIGHT.html)
diff --git a/debian/changelog b/debian/changelog
index 890b684..bf7d136 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libjaxp1.3-java (1.4.01-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Thu, 05 May 2022 19:06:52 -0000
+
libjaxp1.3-java (1.3.05-6) unstable; urgency=medium
* Team upload.
diff --git a/javax/xml/datatype/DatatypeFactory.java b/javax/xml/datatype/DatatypeFactory.java
index 93db068..f111a24 100644
--- a/javax/xml/datatype/DatatypeFactory.java
+++ b/javax/xml/datatype/DatatypeFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-//$Id: DatatypeFactory.java 759805 2009-03-30 00:31:41Z mrglavas $
+//$Id: DatatypeFactory.java 884950 2009-11-27 18:46:18Z mrglavas $
package javax.xml.datatype;
@@ -52,7 +52,7 @@ import java.util.GregorianCalendar;
*
* @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a>
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 759805 $, $Date: 2009-03-29 20:31:41 -0400 (Sun, 29 Mar 2009) $
+ * @version $Revision: 884950 $, $Date: 2009-11-27 13:46:18 -0500 (Fri, 27 Nov 2009) $
* @since 1.5
*/
public abstract class DatatypeFactory {
@@ -69,7 +69,7 @@ public abstract class DatatypeFactory {
*
* <p>Default value is <code>org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl</code>.</p>
*/
- public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS = "org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl";
+ public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS = new String("org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl");
/**
* <p>Protected constructor to prevent instantiation outside of package.</p>
@@ -91,7 +91,6 @@ public abstract class DatatypeFactory {
*/
public static DatatypeFactory newInstance()
throws DatatypeConfigurationException {
-
try {
return (DatatypeFactory) FactoryFinder.find(
/* The default property name according to the JAXP spec */
@@ -103,6 +102,28 @@ public abstract class DatatypeFactory {
throw new DatatypeConfigurationException(e.getMessage(), e.getException());
}
}
+
+ /**
+ * @return New instance of a <code>DocumentBuilderFactory</code>
+ *
+ * @throws DatatypeConfigurationException If the implementation is not
+ * available or cannot be instantiated.
+ */
+ public static DatatypeFactory newInstance(String factoryClassName,
+ ClassLoader classLoader) throws DatatypeConfigurationException {
+ if (factoryClassName == null) {
+ throw new DatatypeConfigurationException("factoryClassName cannot be null.");
+ }
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ try {
+ return (DatatypeFactory) FactoryFinder.newInstance(factoryClassName, classLoader);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new DatatypeConfigurationException(e.getMessage(), e.getException());
+ }
+ }
/**
* <p>Obtain a new instance of a <code>Duration</code>
diff --git a/javax/xml/datatype/Duration.java b/javax/xml/datatype/Duration.java
index 1cf1341..3f304be 100644
--- a/javax/xml/datatype/Duration.java
+++ b/javax/xml/datatype/Duration.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-//$Id: Duration.java 759827 2009-03-30 01:26:10Z mrglavas $
+//$Id: Duration.java 759828 2009-03-30 01:26:29Z mrglavas $
package javax.xml.datatype;
@@ -87,7 +87,7 @@ import javax.xml.namespace.QName;
* @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a>
* @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 759827 $, $Date: 2009-03-29 21:26:10 -0400 (Sun, 29 Mar 2009) $
+ * @version $Revision: 759828 $, $Date: 2009-03-29 21:26:29 -0400 (Sun, 29 Mar 2009) $
* @see XMLGregorianCalendar#add(Duration)
* @since 1.5
*/
@@ -845,14 +845,13 @@ public abstract class Duration {
* <code>true</code> if this duration is the same length as
* <code>duration</code>.
* <code>false</code> if <code>duration</code> is not a
- * <code>Duration</code> object
+ * <code>Duration</code> object, is <code>null</code>,
* or its length is different from this duration.
*
* @throws UnsupportedOperationException If the underlying implementation
* cannot reasonably process the request, e.g. W3C XML Schema allows for
* arbitrarily large/small/precise values, the request may be beyond the
* implementations capability.
- * @throws NullPointerException if parameter is null.
*
* @see #compare(Duration duration)
*/
@@ -860,9 +859,6 @@ public abstract class Duration {
if (duration == this) {
return true;
}
- if (duration == null) {
- throw new NullPointerException();
- }
if (duration instanceof Duration) {
return compare((Duration) duration) == DatatypeConstants.EQUAL;
}
diff --git a/javax/xml/datatype/FactoryFinder.java b/javax/xml/datatype/FactoryFinder.java
index 3f6e220..c6fa3c8 100644
--- a/javax/xml/datatype/FactoryFinder.java
+++ b/javax/xml/datatype/FactoryFinder.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: FactoryFinder.java 670433 2008-06-23 02:02:24Z mrglavas $
+// $Id: FactoryFinder.java 670432 2008-06-23 02:02:08Z mrglavas $
package javax.xml.datatype;
@@ -34,7 +34,7 @@ import java.util.Properties;
* sync. It is package private for secure class loading.</p>
*
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 670433 $, $Date: 2008-06-22 22:02:24 -0400 (Sun, 22 Jun 2008) $
+ * @version $Revision: 670432 $, $Date: 2008-06-22 22:02:08 -0400 (Sun, 22 Jun 2008) $
* @since 1.5
*/
final class FactoryFinder {
@@ -141,7 +141,7 @@ final class FactoryFinder {
*
* @throws ConfigurationError If class could not be created.
*/
- private static Object newInstance(
+ static Object newInstance(
String className,
ClassLoader classLoader)
throws ConfigurationError {
diff --git a/javax/xml/datatype/XMLGregorianCalendar.java b/javax/xml/datatype/XMLGregorianCalendar.java
index 089aca1..a7577de 100644
--- a/javax/xml/datatype/XMLGregorianCalendar.java
+++ b/javax/xml/datatype/XMLGregorianCalendar.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: XMLGregorianCalendar.java 759820 2009-03-30 01:14:57Z mrglavas $
+// $Id: XMLGregorianCalendar.java 759822 2009-03-30 01:15:11Z mrglavas $
package javax.xml.datatype;
@@ -169,7 +169,7 @@ import java.util.GregorianCalendar;
* @author <a href="mailto:Joseph.Fialli@Sun.com">Joseph Fialli</a>
* @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 759820 $, $Date: 2009-03-29 21:14:57 -0400 (Sun, 29 Mar 2009) $
+ * @version $Revision: 759822 $, $Date: 2009-03-29 21:15:11 -0400 (Sun, 29 Mar 2009) $
* @see Duration
* @see DatatypeFactory
* @since 1.5
@@ -658,16 +658,11 @@ public abstract class XMLGregorianCalendar
*
* @return <code>true</code> when <code>obj</code> is an instance of <code>XMLGregorianCalendar</code>
* and {@link #compare(XMLGregorianCalendar obj)} returns {@link DatatypeConstants#EQUAL}, otherwise <code>false</code>.
- *
- * @throws NullPointerException If <code>obj</code> is <code>null</code>.
*/
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
- if (obj == null) {
- throw new NullPointerException("Cannot test null for equality with this XMLGregorianCalendar");
- }
if (obj instanceof XMLGregorianCalendar) {
return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
}
diff --git a/javax/xml/namespace/QName.java b/javax/xml/namespace/QName.java
index 9916b93..63ef751 100644
--- a/javax/xml/namespace/QName.java
+++ b/javax/xml/namespace/QName.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: QName.java 754580 2009-03-15 01:32:01Z mrglavas $
+// $Id: QName.java 754581 2009-03-15 01:32:39Z mrglavas $
package javax.xml.namespace;
@@ -58,7 +58,7 @@ import javax.xml.XMLConstants;
* <p><code>QName</code> is immutable.</p>
*
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 754580 $, $Date: 2009-03-14 21:32:01 -0400 (Sat, 14 Mar 2009) $
+ * @version $Revision: 754581 $, $Date: 2009-03-14 21:32:39 -0400 (Sat, 14 Mar 2009) $
* @see <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2: Datatypes specification</a>
* @see <a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">Namespaces in XML</a>
* @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a>
diff --git a/javax/xml/parsers/DocumentBuilderFactory.java b/javax/xml/parsers/DocumentBuilderFactory.java
index 98feb4d..b677764 100644
--- a/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/javax/xml/parsers/DocumentBuilderFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: DocumentBuilderFactory.java 569979 2007-08-27 03:57:11Z mrglavas $
+// $Id: DocumentBuilderFactory.java 884950 2009-11-27 18:46:18Z mrglavas $
package javax.xml.parsers;
@@ -26,7 +26,7 @@ import javax.xml.validation.Schema;
* parser that produces DOM object trees from XML documents.
*
* @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 569979 $, $Date: 2007-08-26 23:57:11 -0400 (Sun, 26 Aug 2007) $
+ * @version $Revision: 884950 $, $Date: 2009-11-27 13:46:18 -0500 (Fri, 27 Nov 2009) $
*/
public abstract class DocumentBuilderFactory {
@@ -105,11 +105,32 @@ public abstract class DocumentBuilderFactory {
"javax.xml.parsers.DocumentBuilderFactory",
/* The fallback implementation class name */
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
- } catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(),
- e.getMessage());
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ /**
+ * @return New instance of a <code>DocumentBuilderFactory</code>
+ *
+ * @exception FactoryConfigurationError if the implementation is not
+ * available or cannot be instantiated.
+ */
+ public static DocumentBuilderFactory newInstance(String factoryClassName,
+ ClassLoader classLoader) {
+ if (factoryClassName == null) {
+ throw new FactoryConfigurationError("factoryClassName cannot be null.");
+ }
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ try {
+ return (DocumentBuilderFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
}
-
}
/**
diff --git a/javax/xml/parsers/FactoryFinder.java b/javax/xml/parsers/FactoryFinder.java
index 6435f95..c6d0e72 100644
--- a/javax/xml/parsers/FactoryFinder.java
+++ b/javax/xml/parsers/FactoryFinder.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: FactoryFinder.java 670293 2008-06-22 01:34:02Z mrglavas $
+// $Id: FactoryFinder.java 670431 2008-06-23 01:40:03Z mrglavas $
package javax.xml.parsers;
@@ -93,7 +93,7 @@ final class FactoryFinder {
* @param doFallback true if the current ClassLoader should be tried as
* a fallback if the class is not found using cl
*/
- private static Object newInstance(String className, ClassLoader cl,
+ static Object newInstance(String className, ClassLoader cl,
boolean doFallback)
throws ConfigurationError
{
diff --git a/javax/xml/parsers/SAXParserFactory.java b/javax/xml/parsers/SAXParserFactory.java
index 7ca152e..c80fcc6 100644
--- a/javax/xml/parsers/SAXParserFactory.java
+++ b/javax/xml/parsers/SAXParserFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: SAXParserFactory.java 569979 2007-08-27 03:57:11Z mrglavas $
+// $Id: SAXParserFactory.java 884950 2009-11-27 18:46:18Z mrglavas $
package javax.xml.parsers;
@@ -30,7 +30,7 @@ import org.xml.sax.SAXNotSupportedException;
* obtain a SAX based parser to parse XML documents.
*
* @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 569979 $, $Date: 2007-08-26 23:57:11 -0400 (Sun, 26 Aug 2007) $
+ * @version $Revision: 884950 $, $Date: 2009-11-27 13:46:18 -0500 (Fri, 27 Nov 2009) $
*/
public abstract class SAXParserFactory {
@@ -117,9 +117,31 @@ public abstract class SAXParserFactory {
"javax.xml.parsers.SAXParserFactory",
/* The fallback implementation class name */
"org.apache.xerces.jaxp.SAXParserFactoryImpl");
- } catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(),
- e.getMessage());
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ /**
+ * @return A new instance of a SAXParserFactory.
+ *
+ * @exception FactoryConfigurationError if the implementation is
+ * not available or cannot be instantiated.
+ */
+ public static SAXParserFactory newInstance(String factoryClassName,
+ ClassLoader classLoader) {
+ if (factoryClassName == null) {
+ throw new FactoryConfigurationError("factoryClassName cannot be null.");
+ }
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ try {
+ return (SAXParserFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
}
}
diff --git a/javax/xml/parsers/SecuritySupport.java b/javax/xml/parsers/SecuritySupport.java
index ef27bac..2b43266 100644
--- a/javax/xml/parsers/SecuritySupport.java
+++ b/javax/xml/parsers/SecuritySupport.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: SecuritySupport.java 670291 2008-06-22 01:30:16Z mrglavas $
+// $Id: SecuritySupport.java 670282 2008-06-22 01:00:42Z mrglavas $
package javax.xml.parsers;
diff --git a/javax/xml/stream/EventFilter.java b/javax/xml/stream/EventFilter.java
new file mode 100644
index 0000000..11c9088
--- /dev/null
+++ b/javax/xml/stream/EventFilter.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: EventFilter.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+import javax.xml.stream.events.XMLEvent;
+
+public interface EventFilter {
+ public boolean accept(XMLEvent event);
+}
\ No newline at end of file
diff --git a/javax/xml/stream/FactoryConfigurationError.java b/javax/xml/stream/FactoryConfigurationError.java
new file mode 100644
index 0000000..675bc05
--- /dev/null
+++ b/javax/xml/stream/FactoryConfigurationError.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: FactoryConfigurationError.java 670245 2008-06-21 18:03:15Z mrglavas $
+
+package javax.xml.stream;
+
+public class FactoryConfigurationError extends Error {
+
+ private static final long serialVersionUID = -2994412584589975744L;
+
+ private Exception nested;
+
+ public FactoryConfigurationError() {
+ super();
+ }
+
+ public FactoryConfigurationError(Exception e) {
+ nested = e;
+ }
+
+ public FactoryConfigurationError(Exception e, String msg) {
+ super(msg);
+ nested = e;
+ }
+
+ public FactoryConfigurationError(String msg) {
+ super(msg);
+ }
+
+ public FactoryConfigurationError(String msg, Exception e) {
+ super(msg);
+ nested = e;
+ }
+
+ public Exception getException() {
+ return nested;
+ }
+
+ public String getMessage() {
+ String msg = super.getMessage();
+ if (msg != null) {
+ return msg;
+ }
+ if (nested != null) {
+ msg = nested.getMessage();
+ if (msg == null)
+ msg = nested.getClass().toString();
+ }
+ return msg;
+ }
+}
\ No newline at end of file
diff --git a/javax/xml/stream/FactoryFinder.java b/javax/xml/stream/FactoryFinder.java
new file mode 100644
index 0000000..2187a90
--- /dev/null
+++ b/javax/xml/stream/FactoryFinder.java
@@ -0,0 +1,353 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: FactoryFinder.java 670281 2008-06-22 00:55:09Z mrglavas $
+
+package javax.xml.stream;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
+/**
+ * This class is duplicated for each JAXP subpackage so keep it in
+ * sync. It is package private.
+ *
+ * This code is designed to implement the JAXP 1.1 spec pluggability
+ * feature and is designed to run on JDK version 1.1 and later including
+ * JVMs that perform early linking like the Microsoft JVM in IE 5. Note
+ * however that it must be compiled on a JDK version 1.2 or later system
+ * since it calls Thread#getContextClassLoader(). The code also runs both
+ * as part of an unbundled jar file and when bundled as part of the JDK.
+ */
+final class FactoryFinder {
+
+ /**
+ * <p>Debug flag to trace loading process.</p>
+ */
+ private static boolean debug = false;
+
+ /**
+ * <p>Cache properties for performance.</p>
+ */
+ private static Properties cacheProps = new Properties();
+
+ /**
+ * <p>First time requires initialization overhead.</p>
+ */
+ private static boolean firstTime = true;
+
+ /**
+ * Default columns per line.
+ */
+ private static final int DEFAULT_LINE_LENGTH = 80;
+
+ // Define system property "jaxp.debug" to get output
+ static {
+ // Use try/catch block to support applets, which throws
+ // SecurityException out of this code.
+ try {
+ String val = SecuritySupport.getSystemProperty("jaxp.debug");
+ // Allow simply setting the prop to turn on debug
+ debug = val != null && (! "false".equals(val));
+ } catch (SecurityException se) {
+ debug = false;
+ }
+ }
+
+ private FactoryFinder() {}
+
+ private static void dPrint(String msg) {
+ if (debug) {
+ System.err.println("JAXP: " + msg);
+ }
+ }
+
+ /**
+ * Create an instance of a class using the specified ClassLoader and
+ * optionally fall back to the current ClassLoader if not found.
+ *
+ * @param className Name of the concrete class corresponding to the
+ * service provider
+ *
+ * @param cl ClassLoader to use to load the class, null means to use
+ * the bootstrap ClassLoader
+ *
+ * @param doFallback true if the current ClassLoader should be tried as
+ * a fallback if the class is not found using cl
+ */
+ private static Object newInstance(String className, ClassLoader cl,
+ boolean doFallback)
+ throws ConfigurationError
+ {
+ // assert(className != null);
+
+ try {
+ Class providerClass;
+ if (cl == null) {
+ // If classloader is null Use the bootstrap ClassLoader.
+ // Thus Class.forName(String) will use the current
+ // ClassLoader which will be the bootstrap ClassLoader.
+ providerClass = Class.forName(className);
+ } else {
+ try {
+ providerClass = cl.loadClass(className);
+ } catch (ClassNotFoundException x) {
+ if (doFallback) {
+ // Fall back to current classloader
+ cl = FactoryFinder.class.getClassLoader();
+ if (cl != null) {
+ providerClass = cl.loadClass(className);
+ }
+ else {
+ providerClass = Class.forName(className);
+ }
+ } else {
+ throw x;
+ }
+ }
+ }
+
+ Object instance = providerClass.newInstance();
+ if (debug) dPrint("created new instance of " + providerClass +
+ " using ClassLoader: " + cl);
+ return instance;
+ } catch (ClassNotFoundException x) {
+ throw new ConfigurationError(
+ "Provider " + className + " not found", x);
+ } catch (Exception x) {
+ throw new ConfigurationError(
+ "Provider " + className + " could not be instantiated: " + x,
+ x);
+ }
+ }
+
+ /**
+ * Finds the implementation Class object in the specified order. Main
+ * entry point.
+ * @return Class object of factory, never null
+ *
+ * @param factoryId Name of the factory to find, same as
+ * a property name
+ * @param fallbackClassName Implementation class name, if nothing else
+ * is found. Use null to mean no fallback.
+ *
+ * Package private so this code can be shared.
+ */
+ static Object find(String factoryId, String fallbackClassName)
+ throws ConfigurationError {
+ // Figure out which ClassLoader to use for loading the provider
+ // class. If there is a Context ClassLoader then use it.
+ ClassLoader classLoader = SecuritySupport.getContextClassLoader();
+ if (classLoader == null) {
+ // if we have no Context ClassLoader
+ // so use the current ClassLoader
+ classLoader = FactoryFinder.class.getClassLoader();
+ }
+ return find(factoryId, classLoader, fallbackClassName);
+ }
+
+ /**
+ * Finds the implementation Class object in the specified order. Main
+ * entry point.
+ * @return Class object of factory, never null
+ *
+ * @param factoryId Name of the factory to find, same as
+ * a property name
+ * @param classLoader The ClassLoader to use
+ * @param fallbackClassName Implementation class name, if nothing else
+ * is found. Use null to mean no fallback.
+ *
+ * Package private so this code can be shared.
+ */
+ static Object find(String factoryId, ClassLoader classLoader, String fallbackClassName)
+ throws ConfigurationError {
+
+ if (debug) dPrint("find factoryId =" + factoryId);
+
+ // Use the system property first
+ try {
+ String systemProp = SecuritySupport.getSystemProperty(factoryId);
+ if (systemProp != null && systemProp.length() > 0) {
+ if (debug) dPrint("found system property, value=" + systemProp);
+ return newInstance(systemProp, classLoader, true);
+ }
+ } catch (SecurityException se) {
+ //if first option fails due to any reason we should try next option in the
+ //look up algorithm.
+ }
+
+ // try to read from $java.home/lib/stax.properties
+ try {
+ String javah = SecuritySupport.getSystemProperty("java.home");
+ String configFile = javah + File.separator +
+ "lib" + File.separator + "stax.properties";
+ String factoryClassName = null;
+ if(firstTime){
+ synchronized(cacheProps){
+ if(firstTime){
+ File f=new File( configFile );
+ firstTime = false;
+ if(SecuritySupport.doesFileExist(f)){
+ if (debug) dPrint("Read properties file "+f);
+ //cacheProps.load( new FileInputStream(f));
+ cacheProps.load(SecuritySupport.getFileInputStream(f));
+ }
+ }
+ }
+ }
+ factoryClassName = cacheProps.getProperty(factoryId);
+
+ if(factoryClassName != null){
+ if (debug) dPrint("found in $java.home/stax.properties, value=" + factoryClassName);
+ return newInstance(factoryClassName, classLoader, true);
+ }
+ } catch(Exception ex ) {
+ if( debug ) ex.printStackTrace();
+ }
+
+ // Try Jar Service Provider Mechanism
+ Object provider = findJarServiceProvider(factoryId);
+ if (provider != null) {
+ return provider;
+ }
+ if (fallbackClassName == null) {
+ throw new ConfigurationError(
+ "Provider for " + factoryId + " cannot be found", null);
+ }
+
+ if (debug) dPrint("loaded from fallback value: " + fallbackClassName);
+ return newInstance(fallbackClassName, classLoader, true);
+ }
+
+ /*
+ * Try to find provider using Jar Service Provider Mechanism
+ *
+ * @return instance of provider class if found or null
+ */
+ private static Object findJarServiceProvider(String factoryId)
+ throws ConfigurationError
+ {
+
+ String serviceId = "META-INF/services/" + factoryId;
+ InputStream is = null;
+
+ // First try the Context ClassLoader
+ ClassLoader cl = SecuritySupport.getContextClassLoader();
+ if (cl != null) {
+ is = SecuritySupport.getResourceAsStream(cl, serviceId);
+
+ // If no provider found then try the current ClassLoader
+ if (is == null) {
+ cl = FactoryFinder.class.getClassLoader();
+ is = SecuritySupport.getResourceAsStream(cl, serviceId);
+ }
+ } else {
+ // No Context ClassLoader, try the current
+ // ClassLoader
+ cl = FactoryFinder.class.getClassLoader();
+ is = SecuritySupport.getResourceAsStream(cl, serviceId);
+ }
+
+ if (is == null) {
+ // No provider found
+ return null;
+ }
+
+ if (debug) dPrint("found jar resource=" + serviceId +
+ " using ClassLoader: " + cl);
+
+ // Read the service provider name in UTF-8 as specified in
+ // the jar spec. Unfortunately this fails in Microsoft
+ // VJ++, which does not implement the UTF-8
+ // encoding. Theoretically, we should simply let it fail in
+ // that case, since the JVM is obviously broken if it
+ // doesn't support such a basic standard. But since there
+ // are still some users attempting to use VJ++ for
+ // development, we have dropped in a fallback which makes a
+ // second attempt using the platform's default encoding. In
+ // VJ++ this is apparently ASCII, which is a subset of
+ // UTF-8... and since the strings we'll be reading here are
+ // also primarily limited to the 7-bit ASCII range (at
+ // least, in English versions), this should work well
+ // enough to keep us on the air until we're ready to
+ // officially decommit from VJ++. [Edited comment from
+ // jkesselm]
+ BufferedReader rd;
+ try {
+ rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
+ } catch (java.io.UnsupportedEncodingException e) {
+ rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
+ }
+
+ String factoryClassName = null;
+ try {
+ // XXX Does not handle all possible input as specified by the
+ // Jar Service Provider specification
+ factoryClassName = rd.readLine();
+ }
+ catch (IOException x) {
+ // No provider found
+ return null;
+ }
+ finally {
+ try {
+ // try to close the reader.
+ rd.close();
+ }
+ // Ignore the exception.
+ catch (IOException exc) {}
+ }
+
+ if (factoryClassName != null &&
+ ! "".equals(factoryClassName)) {
+ if (debug) dPrint("found in resource, value="
+ + factoryClassName);
+
+ // Note: here we do not want to fall back to the current
+ // ClassLoader because we want to avoid the case where the
+ // resource file was found using one ClassLoader and the
+ // provider class was instantiated using a different one.
+ return newInstance(factoryClassName, cl, false);
+ }
+
+ // No provider found
+ return null;
+ }
+
+ static class ConfigurationError extends Error {
+ private static final long serialVersionUID = 1L;
+ private Exception exception;
+
+ /**
+ * Construct a new instance with the specified detail string and
+ * exception.
+ */
+ ConfigurationError(String msg, Exception x) {
+ super(msg);
+ this.exception = x;
+ }
+
+ Exception getException() {
+ return exception;
+ }
+ }
+
+}
diff --git a/javax/xml/stream/Location.java b/javax/xml/stream/Location.java
new file mode 100644
index 0000000..8b9ffad
--- /dev/null
+++ b/javax/xml/stream/Location.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: Location.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+public interface Location {
+ public int getCharacterOffset();
+
+ public int getColumnNumber();
+
+ public int getLineNumber();
+
+ public String getPublicId();
+
+ public String getSystemId();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/SecuritySupport.java b/javax/xml/stream/SecuritySupport.java
new file mode 100644
index 0000000..550c6ad
--- /dev/null
+++ b/javax/xml/stream/SecuritySupport.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: SecuritySupport.java 670281 2008-06-22 00:55:09Z mrglavas $
+
+package javax.xml.stream;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * This class is duplicated for each JAXP subpackage so keep it in sync.
+ * It is package private and therefore is not exposed as part of the JAXP
+ * API.
+ *
+ * Security related methods that only work on J2SE 1.2 and newer.
+ */
+final class SecuritySupport {
+
+ private SecuritySupport() {}
+
+ static ClassLoader getContextClassLoader() {
+ return (ClassLoader)
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ ClassLoader cl = null;
+ try {
+ cl = Thread.currentThread().getContextClassLoader();
+ } catch (SecurityException ex) { }
+ return cl;
+ }
+ });
+ }
+
+ static String getSystemProperty(final String propName) {
+ return (String)
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty(propName);
+ }
+ });
+ }
+
+ static FileInputStream getFileInputStream(final File file)
+ throws FileNotFoundException
+ {
+ try {
+ return (FileInputStream)
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws FileNotFoundException {
+ return new FileInputStream(file);
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ throw (FileNotFoundException)e.getException();
+ }
+ }
+
+ static InputStream getResourceAsStream(final ClassLoader cl,
+ final String name)
+ {
+ return (InputStream)
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ InputStream ris;
+ if (cl == null) {
+ ris = ClassLoader.getSystemResourceAsStream(name);
+ } else {
+ ris = cl.getResourceAsStream(name);
+ }
+ return ris;
+ }
+ });
+ }
+
+ static boolean doesFileExist(final File f) {
+ return ((Boolean)
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return f.exists() ? Boolean.TRUE : Boolean.FALSE;
+ }
+ })).booleanValue();
+ }
+
+}
diff --git a/javax/xml/stream/StreamFilter.java b/javax/xml/stream/StreamFilter.java
new file mode 100644
index 0000000..3b91878
--- /dev/null
+++ b/javax/xml/stream/StreamFilter.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: StreamFilter.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+public interface StreamFilter {
+ public boolean accept(XMLStreamReader reader);
+}
\ No newline at end of file
diff --git a/javax/xml/stream/XMLEventFactory.java b/javax/xml/stream/XMLEventFactory.java
new file mode 100644
index 0000000..870f2ad
--- /dev/null
+++ b/javax/xml/stream/XMLEventFactory.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLEventFactory.java 730320 2008-12-31 06:20:06Z mrglavas $
+
+package javax.xml.stream;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.events.ProcessingInstruction;
+import javax.xml.namespace.QName;
+import javax.xml.stream.events.Characters;
+import javax.xml.stream.events.Comment;
+import javax.xml.stream.events.DTD;
+import javax.xml.stream.events.EndElement;
+import javax.xml.stream.events.EntityDeclaration;
+import javax.xml.stream.events.Namespace;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.EndDocument;
+import javax.xml.stream.events.EntityReference;
+import javax.xml.stream.events.StartDocument;
+import javax.xml.stream.events.StartElement;
+
+public abstract class XMLEventFactory {
+
+ private static final String PROPERTY_NAME = "javax.xml.stream.XMLEventFactory";
+ private static final String DEFAULT_FACTORY = "org.apache.xerces.stax.XMLEventFactoryImpl";
+
+ protected XMLEventFactory() {}
+
+ public static XMLEventFactory newInstance()
+ throws FactoryConfigurationError {
+ try {
+ return (XMLEventFactory) FactoryFinder.find(PROPERTY_NAME, DEFAULT_FACTORY);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ public static XMLEventFactory newInstance(String factoryId,
+ ClassLoader classLoader) throws FactoryConfigurationError {
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ try {
+ return (XMLEventFactory) FactoryFinder.find(factoryId, classLoader, DEFAULT_FACTORY);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ public abstract void setLocation(Location location);
+
+ public abstract Attribute createAttribute(QName name, String value);
+
+ public abstract Attribute createAttribute(String localName, String value);
+
+ public abstract Attribute createAttribute(String prefix,
+ String namespaceURI, String localName, String value);
+
+ public abstract Namespace createNamespace(String namespaceUri);
+
+ public abstract Namespace createNamespace(String prefix, String namespaceUri);
+
+ public abstract StartElement createStartElement(QName name,
+ Iterator attributes, Iterator namespaces);
+
+ public abstract StartElement createStartElement(String prefix,
+ String namespaceUri, String localName);
+
+ public abstract StartElement createStartElement(String prefix,
+ String namespaceUri, String localName, Iterator attributes,
+ Iterator namespaces);
+
+ public abstract StartElement createStartElement(String prefix,
+ String namespaceUri, String localName, Iterator attributes,
+ Iterator namespaces, NamespaceContext context);
+
+ public abstract EndElement createEndElement(QName name, Iterator namespaces);
+
+ public abstract EndElement createEndElement(String prefix,
+ String namespaceUri, String localName);
+
+ public abstract EndElement createEndElement(String prefix,
+ String namespaceUri, String localName, Iterator namespaces);
+
+ public abstract Characters createCharacters(String content);
+
+ public abstract Characters createCData(String content);
+
+ public abstract Characters createSpace(String content);
+
+ public abstract Characters createIgnorableSpace(String content);
+
+ public abstract StartDocument createStartDocument();
+
+ public abstract StartDocument createStartDocument(String encoding);
+
+ public abstract StartDocument createStartDocument(String encoding,
+ String version);
+
+ public abstract StartDocument createStartDocument(String encoding,
+ String version, boolean standalone);
+
+ public abstract EndDocument createEndDocument();
+
+ public abstract EntityReference createEntityReference(String name,
+ EntityDeclaration declaration);
+
+ public abstract Comment createComment(String text);
+
+ public abstract ProcessingInstruction createProcessingInstruction(
+ String target, String data);
+
+ public abstract DTD createDTD(String dtd);
+}
diff --git a/javax/xml/stream/XMLEventReader.java b/javax/xml/stream/XMLEventReader.java
new file mode 100644
index 0000000..65574cf
--- /dev/null
+++ b/javax/xml/stream/XMLEventReader.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLEventReader.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+import java.util.Iterator;
+
+import javax.xml.stream.events.XMLEvent;
+
+public interface XMLEventReader extends Iterator {
+ public void close() throws XMLStreamException;
+
+ public String getElementText() throws XMLStreamException;
+
+ public Object getProperty(String name) throws IllegalArgumentException;
+
+ public boolean hasNext();
+
+ public XMLEvent nextEvent() throws XMLStreamException;
+
+ public XMLEvent nextTag() throws XMLStreamException;
+
+ public XMLEvent peek() throws XMLStreamException;
+}
diff --git a/javax/xml/stream/XMLEventWriter.java b/javax/xml/stream/XMLEventWriter.java
new file mode 100644
index 0000000..81b3faa
--- /dev/null
+++ b/javax/xml/stream/XMLEventWriter.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLEventWriter.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.events.XMLEvent;
+import javax.xml.stream.util.XMLEventConsumer;
+
+public interface XMLEventWriter extends XMLEventConsumer {
+ public void add(XMLEvent event) throws XMLStreamException;
+
+ public void add(XMLEventReader reader) throws XMLStreamException;
+
+ public void close() throws XMLStreamException;
+
+ public void flush() throws XMLStreamException;
+
+ public NamespaceContext getNamespaceContext();
+
+ public String getPrefix(String uri) throws XMLStreamException;
+
+ public void setDefaultNamespace(String uri) throws XMLStreamException;
+
+ public void setNamespaceContext(NamespaceContext context) throws XMLStreamException;
+
+ public void setPrefix(String prefix, String uri) throws XMLStreamException;
+}
diff --git a/javax/xml/stream/XMLInputFactory.java b/javax/xml/stream/XMLInputFactory.java
new file mode 100644
index 0000000..d95ba6f
--- /dev/null
+++ b/javax/xml/stream/XMLInputFactory.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLInputFactory.java 670283 2008-06-22 01:04:09Z mrglavas $
+
+package javax.xml.stream;
+
+import java.io.InputStream;
+import java.io.Reader;
+
+import javax.xml.stream.util.XMLEventAllocator;
+
+public abstract class XMLInputFactory {
+
+ public static final String ALLOCATOR = "javax.xml.stream.allocator";
+ public static final String IS_COALESCING = "javax.xml.stream.isCoalescing";
+ public static final String IS_NAMESPACE_AWARE = "javax.xml.stream.isNamespaceAware";
+ public static final String IS_REPLACING_ENTITY_REFERENCES = "javax.xml.stream.isReplacingEntityReferences";
+ public static final String IS_SUPPORTING_EXTERNAL_ENTITIES = "javax.xml.stream.isSupportingExternalEntities";
+ public static final String IS_VALIDATING = "javax.xml.stream.isValidating";
+ public static final String REPORTER = "javax.xml.stream.reporter";
+ public static final String RESOLVER = "javax.xml.stream.resolver";
+ public static final String SUPPORT_DTD = "javax.xml.stream.supportDTD";
+
+ private static final String PROPERTY_NAME = "javax.xml.stream.XMLInputFactory";
+ private static final String DEFAULT_FACTORY = "com.ctc.wstx.stax.WstxInputFactory";
+
+ protected XMLInputFactory() {}
+
+ public static XMLInputFactory newInstance()
+ throws FactoryConfigurationError {
+ try {
+ return (XMLInputFactory) FactoryFinder.find(PROPERTY_NAME, DEFAULT_FACTORY);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ public static XMLInputFactory newInstance(String factoryId,
+ ClassLoader classLoader) throws FactoryConfigurationError {
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ try {
+ return (XMLInputFactory) FactoryFinder.find(factoryId, classLoader, DEFAULT_FACTORY);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ public abstract XMLStreamReader createXMLStreamReader(Reader reader)
+ throws XMLStreamException;
+
+ public abstract XMLStreamReader createXMLStreamReader(
+ javax.xml.transform.Source source) throws XMLStreamException;
+
+ public abstract XMLStreamReader createXMLStreamReader(
+ InputStream stream) throws XMLStreamException;
+
+ public abstract XMLStreamReader createXMLStreamReader(
+ InputStream stream, String encoding)
+ throws XMLStreamException;
+
+ public abstract XMLStreamReader createXMLStreamReader(
+ String systemId, InputStream stream)
+ throws XMLStreamException;
+
+ public abstract XMLStreamReader createXMLStreamReader(
+ String systemId, Reader reader)
+ throws XMLStreamException;
+
+ public abstract XMLEventReader createXMLEventReader(Reader reader)
+ throws XMLStreamException;
+
+ public abstract XMLEventReader createXMLEventReader(
+ String systemId, Reader reader)
+ throws XMLStreamException;
+
+ public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
+ throws XMLStreamException;
+
+ public abstract XMLEventReader createXMLEventReader(
+ javax.xml.transform.Source source) throws XMLStreamException;
+
+ public abstract XMLEventReader createXMLEventReader(
+ InputStream stream) throws XMLStreamException;
+
+ public abstract XMLEventReader createXMLEventReader(
+ InputStream stream, String encoding)
+ throws XMLStreamException;
+
+ public abstract XMLEventReader createXMLEventReader(
+ String systemId, InputStream stream)
+ throws XMLStreamException;
+
+ public abstract XMLStreamReader createFilteredReader(
+ XMLStreamReader reader, StreamFilter filter)
+ throws XMLStreamException;
+
+ public abstract XMLEventReader createFilteredReader(XMLEventReader reader,
+ EventFilter filter) throws XMLStreamException;
+
+ public abstract XMLResolver getXMLResolver();
+
+ public abstract void setXMLResolver(XMLResolver resolver);
+
+ public abstract XMLReporter getXMLReporter();
+
+ public abstract void setXMLReporter(XMLReporter reporter);
+
+ public abstract void setProperty(String name,
+ Object value) throws IllegalArgumentException;
+
+ public abstract Object getProperty(String name)
+ throws IllegalArgumentException;
+
+ public abstract boolean isPropertySupported(String name);
+
+ public abstract void setEventAllocator(XMLEventAllocator allocator);
+
+ public abstract XMLEventAllocator getEventAllocator();
+}
diff --git a/javax/xml/stream/XMLOutputFactory.java b/javax/xml/stream/XMLOutputFactory.java
new file mode 100644
index 0000000..3bc318a
--- /dev/null
+++ b/javax/xml/stream/XMLOutputFactory.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLOutputFactory.java 670283 2008-06-22 01:04:09Z mrglavas $
+
+package javax.xml.stream;
+
+import java.io.OutputStream;
+import java.io.Writer;
+
+public abstract class XMLOutputFactory {
+
+ public static final String IS_REPAIRING_NAMESPACES = "javax.xml.stream.isRepairingNamespaces";
+
+ private static final String PROPERTY_NAME = "javax.xml.stream.XMLOutputFactory";
+ private static final String DEFAULT_FACTORY = "com.ctc.wstx.stax.WstxOutputFactory";
+
+ protected XMLOutputFactory() {}
+
+ public static XMLOutputFactory newInstance()
+ throws FactoryConfigurationError {
+ try {
+ return (XMLOutputFactory) FactoryFinder.find(PROPERTY_NAME, DEFAULT_FACTORY);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ public static XMLInputFactory newInstance(String factoryId,
+ ClassLoader classLoader) throws FactoryConfigurationError {
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ try {
+ return (XMLInputFactory) FactoryFinder.find(factoryId,
+ classLoader, "com.ctc.wstx.stax.WstxInputFactory");
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new FactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ public abstract XMLStreamWriter createXMLStreamWriter(Writer stream)
+ throws XMLStreamException;
+
+ public abstract XMLStreamWriter createXMLStreamWriter(
+ OutputStream stream) throws XMLStreamException;
+
+ public abstract XMLStreamWriter createXMLStreamWriter(
+ OutputStream stream, String encoding)
+ throws XMLStreamException;
+
+ public abstract XMLStreamWriter createXMLStreamWriter(
+ javax.xml.transform.Result result) throws XMLStreamException;
+
+ public abstract XMLEventWriter createXMLEventWriter(
+ javax.xml.transform.Result result) throws XMLStreamException;
+
+ public abstract XMLEventWriter createXMLEventWriter(
+ OutputStream stream) throws XMLStreamException;
+
+ public abstract XMLEventWriter createXMLEventWriter(
+ OutputStream stream, String encoding)
+ throws XMLStreamException;
+
+ public abstract XMLEventWriter createXMLEventWriter(Writer stream)
+ throws XMLStreamException;
+
+ public abstract void setProperty(String name, Object value)
+ throws IllegalArgumentException;
+
+ public abstract Object getProperty(String name)
+ throws IllegalArgumentException;
+
+ public abstract boolean isPropertySupported(String name);
+}
diff --git a/javax/xml/stream/XMLReporter.java b/javax/xml/stream/XMLReporter.java
new file mode 100644
index 0000000..ce479e9
--- /dev/null
+++ b/javax/xml/stream/XMLReporter.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLReporter.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+public interface XMLReporter {
+ void report(String message,
+ String errorType,
+ Object relatedInformation,
+ Location location) throws XMLStreamException;
+}
diff --git a/javax/xml/stream/XMLResolver.java b/javax/xml/stream/XMLResolver.java
new file mode 100644
index 0000000..ceb033b
--- /dev/null
+++ b/javax/xml/stream/XMLResolver.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLResolver.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+public interface XMLResolver {
+ public Object resolveEntity(String publicID,
+ String systemID,
+ String baseURI,
+ String namespace) throws XMLStreamException;
+}
diff --git a/javax/xml/stream/XMLStreamConstants.java b/javax/xml/stream/XMLStreamConstants.java
new file mode 100644
index 0000000..60cd498
--- /dev/null
+++ b/javax/xml/stream/XMLStreamConstants.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLStreamConstants.java 670269 2008-06-21 23:27:48Z mrglavas $
+
+package javax.xml.stream;
+
+public interface XMLStreamConstants {
+
+ public static final int START_ELEMENT = 1;
+ public static final int END_ELEMENT = 2;
+ public static final int PROCESSING_INSTRUCTION = 3;
+ public static final int CHARACTERS = 4;
+ public static final int COMMENT = 5;
+ public static final int SPACE = 6;
+ public static final int START_DOCUMENT = 7;
+ public static final int END_DOCUMENT = 8;
+ public static final int ENTITY_REFERENCE = 9;
+ public static final int ATTRIBUTE = 10;
+ public static final int DTD = 11;
+ public static final int CDATA = 12;
+ public static final int NAMESPACE = 13;
+ public static final int NOTATION_DECLARATION = 14;
+ public static final int ENTITY_DECLARATION = 15;
+
+}
\ No newline at end of file
diff --git a/javax/xml/stream/XMLStreamException.java b/javax/xml/stream/XMLStreamException.java
new file mode 100644
index 0000000..f703305
--- /dev/null
+++ b/javax/xml/stream/XMLStreamException.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLStreamException.java 670245 2008-06-21 18:03:15Z mrglavas $
+
+package javax.xml.stream;
+
+public class XMLStreamException extends Exception {
+
+ private static final long serialVersionUID = 2018819321811497362L;
+
+ protected Throwable nested;
+ protected Location location;
+
+ public XMLStreamException() {
+ super();
+ }
+
+ public XMLStreamException(String msg) {
+ super(msg);
+ }
+
+ public XMLStreamException(Throwable th) {
+ this.nested = th;
+ }
+
+ public XMLStreamException(String msg, Throwable th) {
+ super(msg);
+ this.nested = th;
+ }
+
+ public XMLStreamException(String msg, Location location,
+ Throwable th) {
+ super(msg);
+ this.location = location;
+ this.nested = th;
+ }
+
+ public XMLStreamException(String msg, Location location) {
+ super(msg);
+ this.location = location;
+ }
+
+ public Throwable getNestedException() {
+ return nested;
+ }
+
+ public Location getLocation() {
+ return location;
+ }
+}
diff --git a/javax/xml/stream/XMLStreamReader.java b/javax/xml/stream/XMLStreamReader.java
new file mode 100644
index 0000000..75b1043
--- /dev/null
+++ b/javax/xml/stream/XMLStreamReader.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLStreamReader.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+public interface XMLStreamReader extends XMLStreamConstants {
+ public void close() throws XMLStreamException;
+
+ public int getAttributeCount();
+
+ public String getAttributeLocalName(int index);
+
+ public QName getAttributeName(int index);
+
+ public String getAttributeNamespace(int index);
+
+ public String getAttributePrefix(int index);
+
+ public String getAttributeType(int index);
+
+ public String getAttributeValue(int index);
+
+ public String getAttributeValue(String namespaceURI,
+ String localName);
+
+ public String getCharacterEncodingScheme();
+
+ public String getElementText() throws XMLStreamException;
+
+ public String getEncoding();
+
+ public int getEventType();
+
+ public String getLocalName();
+
+ public Location getLocation();
+
+ public QName getName();
+
+ public NamespaceContext getNamespaceContext();
+
+ public int getNamespaceCount();
+
+ public String getNamespacePrefix(int index);
+
+ public String getNamespaceURI();
+
+ public String getNamespaceURI(int index);
+
+ public String getNamespaceURI(String prefix);
+
+ public String getPIData();
+
+ public String getPITarget();
+
+ public String getPrefix();
+
+ public java.lang.Object getProperty(String name) throws IllegalArgumentException;
+
+ public String getText();
+
+ public char[] getTextCharacters();
+
+ public int getTextCharacters(int sourceStart, char[] target, int targetStart,
+ int length) throws XMLStreamException;
+
+ public int getTextLength();
+
+ public int getTextStart();
+
+ public String getVersion();
+
+ public boolean hasName();
+
+ public boolean hasNext() throws XMLStreamException;
+
+ public boolean hasText();
+
+ public boolean isAttributeSpecified(int index);
+
+ public boolean isCharacters();
+
+ public boolean isEndElement();
+
+ public boolean isStandalone();
+
+ public boolean isStartElement();
+
+ public boolean isWhiteSpace();
+
+ public int next() throws XMLStreamException;
+
+ public int nextTag() throws XMLStreamException ;
+
+ public void require(int type, String namespaceURI,
+ String localName) throws XMLStreamException ;
+
+ public boolean standaloneSet();
+}
diff --git a/javax/xml/stream/XMLStreamWriter.java b/javax/xml/stream/XMLStreamWriter.java
new file mode 100644
index 0000000..d5e4e04
--- /dev/null
+++ b/javax/xml/stream/XMLStreamWriter.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLStreamWriter.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream;
+
+import javax.xml.namespace.NamespaceContext;
+
+public interface XMLStreamWriter {
+ public void close() throws XMLStreamException;
+
+ public void flush() throws XMLStreamException;
+
+ public NamespaceContext getNamespaceContext();
+
+ public String getPrefix(String uri) throws XMLStreamException;
+
+ public Object getProperty(String name) throws IllegalArgumentException;
+
+ public void setDefaultNamespace(String uri) throws XMLStreamException;
+
+ public void setNamespaceContext(NamespaceContext context)
+ throws XMLStreamException;
+
+ public void setPrefix(String prefix, String uri) throws XMLStreamException;
+
+ public void writeAttribute(String localName, String value)
+ throws XMLStreamException;
+
+ public void writeAttribute(String namespaceURI, String localName,
+ String value) throws XMLStreamException;
+
+ public void writeAttribute(String prefix, String namespaceURI,
+ String localName, String value) throws XMLStreamException;
+
+ public void writeCData(String data) throws XMLStreamException;
+
+ public void writeCharacters(char[] text, int start, int len)
+ throws XMLStreamException;
+
+ public void writeCharacters(String text) throws XMLStreamException;
+
+ public void writeComment(String data) throws XMLStreamException;
+
+ public void writeDefaultNamespace(String namespaceURI)
+ throws XMLStreamException;
+
+ public void writeDTD(String dtd) throws XMLStreamException;
+
+ public void writeEmptyElement(String localName) throws XMLStreamException;
+
+ public void writeEmptyElement(String namespaceURI, String localName)
+ throws XMLStreamException;
+
+ public void writeEmptyElement(String prefix, String localName,
+ String namespaceURI) throws XMLStreamException;
+
+ public void writeEndDocument() throws XMLStreamException;
+
+ public void writeEndElement() throws XMLStreamException;
+
+ public void writeEntityRef(String name) throws XMLStreamException;
+
+ public void writeNamespace(String prefix, String namespaceURI)
+ throws XMLStreamException;
+
+ public void writeProcessingInstruction(String target)
+ throws XMLStreamException;
+
+ public void writeProcessingInstruction(String target, String data)
+ throws XMLStreamException;
+
+ public void writeStartDocument() throws XMLStreamException;
+
+ public void writeStartDocument(String version) throws XMLStreamException;
+
+ public void writeStartDocument(String encoding, String version)
+ throws XMLStreamException;
+
+ public void writeStartElement(String localName) throws XMLStreamException;
+
+ public void writeStartElement(String namespaceURI, String localName)
+ throws XMLStreamException;
+
+ public void writeStartElement(String prefix, String localName,
+ String namespaceURI) throws XMLStreamException;
+}
diff --git a/javax/xml/stream/events/Attribute.java b/javax/xml/stream/events/Attribute.java
new file mode 100644
index 0000000..e1c87d4
--- /dev/null
+++ b/javax/xml/stream/events/Attribute.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: Attribute.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+import javax.xml.namespace.QName;
+
+public interface Attribute extends XMLEvent {
+ public String getDTDType();
+
+ public QName getName();
+
+ public String getValue();
+
+ public boolean isSpecified();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/Characters.java b/javax/xml/stream/events/Characters.java
new file mode 100644
index 0000000..83cae3a
--- /dev/null
+++ b/javax/xml/stream/events/Characters.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: Characters.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface Characters extends XMLEvent {
+ public String getData();
+
+ public boolean isCData();
+
+ public boolean isIgnorableWhiteSpace();
+
+ public boolean isWhiteSpace();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/Comment.java b/javax/xml/stream/events/Comment.java
new file mode 100644
index 0000000..744647c
--- /dev/null
+++ b/javax/xml/stream/events/Comment.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: Comment.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface Comment extends XMLEvent {
+ public String getText();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/DTD.java b/javax/xml/stream/events/DTD.java
new file mode 100644
index 0000000..ac1e19f
--- /dev/null
+++ b/javax/xml/stream/events/DTD.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: DTD.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+import java.util.List;
+
+public interface DTD extends XMLEvent {
+ public String getDocumentTypeDeclaration();
+
+ public List getEntities();
+
+ public List getNotations();
+
+ public Object getProcessedDTD();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/EndDocument.java b/javax/xml/stream/events/EndDocument.java
new file mode 100644
index 0000000..3d61622
--- /dev/null
+++ b/javax/xml/stream/events/EndDocument.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: EndDocument.java 669791 2008-06-20 04:54:13Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface EndDocument extends XMLEvent {
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/EndElement.java b/javax/xml/stream/events/EndElement.java
new file mode 100644
index 0000000..93bbf38
--- /dev/null
+++ b/javax/xml/stream/events/EndElement.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: EndElement.java 669791 2008-06-20 04:54:13Z mrglavas $
+
+package javax.xml.stream.events;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+public interface EndElement extends XMLEvent {
+ public QName getName();
+ public Iterator getNamespaces();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/EntityDeclaration.java b/javax/xml/stream/events/EntityDeclaration.java
new file mode 100644
index 0000000..2cdb0fa
--- /dev/null
+++ b/javax/xml/stream/events/EntityDeclaration.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: EntityDeclaration.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface EntityDeclaration extends XMLEvent {
+ public String getBaseURI();
+
+ public String getName();
+
+ public String getNotationName();
+
+ public String getPublicId();
+
+ public String getReplacementText();
+
+ public String getSystemId();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/EntityReference.java b/javax/xml/stream/events/EntityReference.java
new file mode 100644
index 0000000..87282b7
--- /dev/null
+++ b/javax/xml/stream/events/EntityReference.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: EntityReference.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface EntityReference extends XMLEvent {
+ public EntityDeclaration getDeclaration();
+
+ public String getName();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/Namespace.java b/javax/xml/stream/events/Namespace.java
new file mode 100644
index 0000000..1a57cab
--- /dev/null
+++ b/javax/xml/stream/events/Namespace.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: Namespace.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface Namespace extends Attribute {
+ public String getNamespaceURI();
+
+ public String getPrefix();
+
+ public boolean isDefaultNamespaceDeclaration();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/NotationDeclaration.java b/javax/xml/stream/events/NotationDeclaration.java
new file mode 100644
index 0000000..76792e6
--- /dev/null
+++ b/javax/xml/stream/events/NotationDeclaration.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: NotationDeclaration.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface NotationDeclaration extends XMLEvent {
+ public String getName();
+
+ public String getPublicId();
+
+ public String getSystemId();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/ProcessingInstruction.java b/javax/xml/stream/events/ProcessingInstruction.java
new file mode 100644
index 0000000..e34d030
--- /dev/null
+++ b/javax/xml/stream/events/ProcessingInstruction.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: ProcessingInstruction.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface ProcessingInstruction extends XMLEvent {
+ public String getData();
+
+ public String getTarget();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/StartDocument.java b/javax/xml/stream/events/StartDocument.java
new file mode 100644
index 0000000..56c77fd
--- /dev/null
+++ b/javax/xml/stream/events/StartDocument.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: StartDocument.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+public interface StartDocument extends XMLEvent {
+ public boolean encodingSet();
+
+ public String getCharacterEncodingScheme();
+
+ public String getSystemId();
+
+ public String getVersion();
+
+ public boolean isStandalone();
+
+ public boolean standaloneSet();
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/StartElement.java b/javax/xml/stream/events/StartElement.java
new file mode 100644
index 0000000..5d51d7f
--- /dev/null
+++ b/javax/xml/stream/events/StartElement.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: StartElement.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+import java.util.Iterator;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+public interface StartElement extends XMLEvent {
+ public Attribute getAttributeByName(QName name);
+
+ public Iterator getAttributes();
+
+ public QName getName();
+
+ public NamespaceContext getNamespaceContext();
+
+ public Iterator getNamespaces();
+
+ public String getNamespaceURI(String prefix);
+}
\ No newline at end of file
diff --git a/javax/xml/stream/events/XMLEvent.java b/javax/xml/stream/events/XMLEvent.java
new file mode 100644
index 0000000..0f1c6cd
--- /dev/null
+++ b/javax/xml/stream/events/XMLEvent.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLEvent.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.events;
+
+import java.io.Writer;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+
+public interface XMLEvent extends XMLStreamConstants {
+ public Characters asCharacters();
+
+ public EndElement asEndElement();
+
+ public StartElement asStartElement();
+
+ public int getEventType();
+
+ public Location getLocation();
+
+ public QName getSchemaType();
+
+ public boolean isAttribute();
+
+ public boolean isCharacters();
+
+ public boolean isEndDocument();
+
+ public boolean isEndElement();
+
+ public boolean isEntityReference();
+
+ public boolean isNamespace();
+
+ public boolean isProcessingInstruction();
+
+ public boolean isStartDocument();
+
+ public boolean isStartElement();
+
+ public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException;
+}
\ No newline at end of file
diff --git a/javax/xml/stream/util/EventReaderDelegate.java b/javax/xml/stream/util/EventReaderDelegate.java
new file mode 100644
index 0000000..3782702
--- /dev/null
+++ b/javax/xml/stream/util/EventReaderDelegate.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: EventReaderDelegate.java 670273 2008-06-21 23:31:31Z mrglavas $
+
+package javax.xml.stream.util;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.XMLEvent;
+
+public class EventReaderDelegate implements XMLEventReader {
+
+ private XMLEventReader reader;
+
+ public EventReaderDelegate() {}
+
+ public EventReaderDelegate(XMLEventReader reader) {
+ this.reader = reader;
+ }
+
+ public void setParent(XMLEventReader reader) {
+ this.reader = reader;
+ }
+
+ public XMLEventReader getParent() {
+ return reader;
+ }
+
+ /*
+ * XMLEventReader methods
+ */
+
+ public void close() throws XMLStreamException {
+ reader.close();
+ }
+
+ public String getElementText() throws XMLStreamException {
+ return reader.getElementText();
+ }
+
+ public Object getProperty(String name)
+ throws IllegalArgumentException {
+ return reader.getProperty(name);
+ }
+
+ public boolean hasNext() {
+ return reader.hasNext();
+ }
+
+ public Object next() {
+ return reader.next();
+ }
+
+ public XMLEvent nextEvent() throws XMLStreamException {
+ return reader.nextEvent();
+ }
+
+ public XMLEvent nextTag() throws XMLStreamException {
+ return reader.nextTag();
+ }
+
+ public XMLEvent peek() throws XMLStreamException {
+ return reader.peek();
+ }
+
+ public void remove() {
+ reader.remove();
+ }
+}
\ No newline at end of file
diff --git a/javax/xml/stream/util/StreamReaderDelegate.java b/javax/xml/stream/util/StreamReaderDelegate.java
new file mode 100644
index 0000000..3f6c9f1
--- /dev/null
+++ b/javax/xml/stream/util/StreamReaderDelegate.java
@@ -0,0 +1,232 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: StreamReaderDelegate.java 670273 2008-06-21 23:31:31Z mrglavas $
+
+package javax.xml.stream.util;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+public class StreamReaderDelegate implements XMLStreamReader {
+
+ private XMLStreamReader reader;
+
+ public StreamReaderDelegate() {}
+
+ public StreamReaderDelegate(XMLStreamReader reader) {
+ this.reader = reader;
+ }
+
+ public void setParent(XMLStreamReader reader) {
+ this.reader = reader;
+ }
+
+ public XMLStreamReader getParent() {
+ return reader;
+ }
+
+ /*
+ * XMLStreamReader methods
+ */
+
+ public int next() throws XMLStreamException {
+ return reader.next();
+ }
+
+ public int nextTag() throws XMLStreamException {
+ return reader.nextTag();
+ }
+
+ public String getElementText() throws XMLStreamException {
+ return reader.getElementText();
+ }
+
+ public void require(int type, String namespaceURI, String localName)
+ throws XMLStreamException {
+ reader.require(type, namespaceURI, localName);
+ }
+
+ public boolean hasNext() throws XMLStreamException {
+ return reader.hasNext();
+ }
+
+ public void close() throws XMLStreamException {
+ reader.close();
+ }
+
+ public String getNamespaceURI(String prefix) {
+ return reader.getNamespaceURI(prefix);
+ }
+
+ public NamespaceContext getNamespaceContext() {
+ return reader.getNamespaceContext();
+ }
+
+ public boolean isStartElement() {
+ return reader.isStartElement();
+ }
+
+ public boolean isEndElement() {
+ return reader.isEndElement();
+ }
+
+ public boolean isCharacters() {
+ return reader.isCharacters();
+ }
+
+ public boolean isWhiteSpace() {
+ return reader.isWhiteSpace();
+ }
+
+ public String getAttributeValue(String namespaceURI, String localName) {
+ return reader.getAttributeValue(namespaceURI, localName);
+ }
+
+ public int getAttributeCount() {
+ return reader.getAttributeCount();
+ }
+
+ public QName getAttributeName(int index) {
+ return reader.getAttributeName(index);
+ }
+
+ public String getAttributePrefix(int index) {
+ return reader.getAttributePrefix(index);
+ }
+
+ public String getAttributeNamespace(int index) {
+ return reader.getAttributeNamespace(index);
+ }
+
+ public String getAttributeLocalName(int index) {
+ return reader.getAttributeLocalName(index);
+ }
+
+ public String getAttributeType(int index) {
+ return reader.getAttributeType(index);
+ }
+
+ public String getAttributeValue(int index) {
+ return reader.getAttributeValue(index);
+ }
+
+ public boolean isAttributeSpecified(int index) {
+ return reader.isAttributeSpecified(index);
+ }
+
+ public int getNamespaceCount() {
+ return reader.getNamespaceCount();
+ }
+
+ public String getNamespacePrefix(int index) {
+ return reader.getNamespacePrefix(index);
+ }
+
+ public String getNamespaceURI(int index) {
+ return reader.getNamespaceURI(index);
+ }
+
+ public int getEventType() {
+ return reader.getEventType();
+ }
+
+ public String getText() {
+ return reader.getText();
+ }
+
+ public int getTextCharacters(int sourceStart, char[] target,
+ int targetStart, int length) throws XMLStreamException {
+ return reader.getTextCharacters(sourceStart, target, targetStart,
+ length);
+ }
+
+ public char[] getTextCharacters() {
+ return reader.getTextCharacters();
+ }
+
+ public int getTextStart() {
+ return reader.getTextStart();
+ }
+
+ public int getTextLength() {
+ return reader.getTextLength();
+ }
+
+ public String getEncoding() {
+ return reader.getEncoding();
+ }
+
+ public boolean hasText() {
+ return reader.hasText();
+ }
+
+ public Location getLocation() {
+ return reader.getLocation();
+ }
+
+ public QName getName() {
+ return reader.getName();
+ }
+
+ public String getLocalName() {
+ return reader.getLocalName();
+ }
+
+ public boolean hasName() {
+ return reader.hasName();
+ }
+
+ public String getNamespaceURI() {
+ return reader.getNamespaceURI();
+ }
+
+ public String getPrefix() {
+ return reader.getPrefix();
+ }
+
+ public String getVersion() {
+ return reader.getVersion();
+ }
+
+ public boolean isStandalone() {
+ return reader.isStandalone();
+ }
+
+ public boolean standaloneSet() {
+ return reader.standaloneSet();
+ }
+
+ public String getCharacterEncodingScheme() {
+ return reader.getCharacterEncodingScheme();
+ }
+
+ public String getPITarget() {
+ return reader.getPITarget();
+ }
+
+ public String getPIData() {
+ return reader.getPIData();
+ }
+
+ public Object getProperty(String name) throws IllegalArgumentException {
+ return reader.getProperty(name);
+ }
+}
diff --git a/javax/xml/stream/util/XMLEventAllocator.java b/javax/xml/stream/util/XMLEventAllocator.java
new file mode 100644
index 0000000..0f17b4c
--- /dev/null
+++ b/javax/xml/stream/util/XMLEventAllocator.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLEventAllocator.java 669794 2008-06-20 05:13:36Z mrglavas $
+
+package javax.xml.stream.util;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.XMLEvent;
+
+public interface XMLEventAllocator {
+ public XMLEvent allocate(XMLStreamReader reader) throws XMLStreamException;
+
+ public void allocate(XMLStreamReader reader, XMLEventConsumer consumer)
+ throws XMLStreamException;
+
+ public XMLEventAllocator newInstance();
+}
diff --git a/javax/xml/stream/util/XMLEventConsumer.java b/javax/xml/stream/util/XMLEventConsumer.java
new file mode 100644
index 0000000..39b1daf
--- /dev/null
+++ b/javax/xml/stream/util/XMLEventConsumer.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: XMLEventConsumer.java 669791 2008-06-20 04:54:13Z mrglavas $
+
+package javax.xml.stream.util;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.XMLEvent;
+
+public interface XMLEventConsumer {
+ public void add(XMLEvent event) throws XMLStreamException;
+}
diff --git a/javax/xml/transform/FactoryFinder.java b/javax/xml/transform/FactoryFinder.java
index 05e8a2f..591578a 100644
--- a/javax/xml/transform/FactoryFinder.java
+++ b/javax/xml/transform/FactoryFinder.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: FactoryFinder.java 670293 2008-06-22 01:34:02Z mrglavas $
+// $Id: FactoryFinder.java 670431 2008-06-23 01:40:03Z mrglavas $
package javax.xml.transform;
@@ -93,7 +93,7 @@ final class FactoryFinder {
* @param doFallback true if the current ClassLoader should be tried as
* a fallback if the class is not found using cl
*/
- private static Object newInstance(String className, ClassLoader cl,
+ static Object newInstance(String className, ClassLoader cl,
boolean doFallback)
throws ConfigurationError
{
diff --git a/javax/xml/transform/SecuritySupport.java b/javax/xml/transform/SecuritySupport.java
index 6048a42..e9f3cfd 100644
--- a/javax/xml/transform/SecuritySupport.java
+++ b/javax/xml/transform/SecuritySupport.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: SecuritySupport.java 670291 2008-06-22 01:30:16Z mrglavas $
+// $Id: SecuritySupport.java 670282 2008-06-22 01:00:42Z mrglavas $
package javax.xml.transform;
diff --git a/javax/xml/transform/TransformerFactory.java b/javax/xml/transform/TransformerFactory.java
index 1949baf..aad4a9c 100644
--- a/javax/xml/transform/TransformerFactory.java
+++ b/javax/xml/transform/TransformerFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: TransformerFactory.java 570103 2007-08-27 13:24:55Z mrglavas $
+// $Id: TransformerFactory.java 884963 2009-11-27 19:11:59Z mrglavas $
package javax.xml.transform;
@@ -116,10 +116,31 @@ public abstract class TransformerFactory {
"javax.xml.transform.TransformerFactory",
/* The fallback implementation class name */
"org.apache.xalan.processor.TransformerFactoryImpl");
- } catch (FactoryFinder.ConfigurationError e) {
- throw new TransformerFactoryConfigurationError(
- e.getException(),
- e.getMessage());
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new TransformerFactoryConfigurationError(e.getException(), e.getMessage());
+ }
+ }
+
+ /**
+ * @return new TransformerFactory instance, never null.
+ *
+ * @throws TransformerFactoryConfigurationError Thrown if the implementation
+ * is not available or cannot be instantiated.
+ */
+ public static TransformerFactory newInstance(String factoryClassName,
+ ClassLoader classLoader) throws TransformerFactoryConfigurationError {
+ if (factoryClassName == null) {
+ throw new TransformerFactoryConfigurationError("factoryClassName cannot be null.");
+ }
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ try {
+ return (TransformerFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
+ }
+ catch (FactoryFinder.ConfigurationError e) {
+ throw new TransformerFactoryConfigurationError(e.getException(), e.getMessage());
}
}
@@ -136,9 +157,10 @@ public abstract class TransformerFactory {
* @param source <code>Source </code> of XSLT document used to create
* <code>Transformer</code>.
* Examples of XML <code>Source</code>s include
- * {@link javax.xml.transform.dom.DOMSource DOMSource},
- * {@link javax.xml.transform.sax.SAXSource SAXSource}, and
- * {@link javax.xml.transform.stream.StreamSource StreamSource}.
+ * {@link javax.xml.transform.stream.StreamSource StreamSource},
+ * {@link javax.xml.transform.sax.SAXSource SAXSource},
+ * {@link javax.xml.transform.dom.DOMSource DOMSource} and
+ * {@link javax.xml.transform.stax.StAXSource StAXSource}.
*
* @return A <code>Transformer</code> object that may be used to perform
* a transformation in a single <code>Thread</code>, never
diff --git a/javax/xml/transform/stax/StAXResult.java b/javax/xml/transform/stax/StAXResult.java
new file mode 100644
index 0000000..7dbd0d8
--- /dev/null
+++ b/javax/xml/transform/stax/StAXResult.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: StAXResult.java 670395 2008-06-22 18:50:54Z mrglavas $
+
+package javax.xml.transform.stax;
+
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.Result;
+
+public class StAXResult implements Result {
+
+ public static final String FEATURE = "http://javax.xml.transform.stax.StAXResult/feature";
+
+ private final XMLStreamWriter xmlStreamWriter;
+ private final XMLEventWriter xmlEventWriter;
+
+ public StAXResult(XMLStreamWriter xmlStreamWriter) {
+ if (xmlStreamWriter == null) {
+ throw new IllegalArgumentException("XMLStreamWriter cannot be null.");
+ }
+ this.xmlStreamWriter = xmlStreamWriter;
+ this.xmlEventWriter = null;
+ }
+
+ public StAXResult(XMLEventWriter xmlEventWriter) {
+ if (xmlEventWriter == null) {
+ throw new IllegalArgumentException("XMLEventWriter cannot be null.");
+ }
+ this.xmlStreamWriter = null;
+ this.xmlEventWriter = xmlEventWriter;
+ }
+
+ public XMLStreamWriter getXMLStreamWriter() {
+ return xmlStreamWriter;
+ }
+
+ public XMLEventWriter getXMLEventWriter() {
+ return xmlEventWriter;
+ }
+
+ public String getSystemId() {
+ return null;
+ }
+
+ public void setSystemId(String systemId) {
+ throw new UnsupportedOperationException("Setting systemId is not supported.");
+ }
+}
diff --git a/javax/xml/transform/stax/StAXSource.java b/javax/xml/transform/stax/StAXSource.java
new file mode 100644
index 0000000..891e409
--- /dev/null
+++ b/javax/xml/transform/stax/StAXSource.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// $Id: StAXSource.java 670394 2008-06-22 18:50:36Z mrglavas $
+
+package javax.xml.transform.stax;
+
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.events.XMLEvent;
+import javax.xml.transform.Source;
+
+public class StAXSource implements Source {
+
+ public static final String FEATURE = "http://javax.xml.transform.stax.StAXSource/feature";
+
+ private final XMLStreamReader xmlStreamReader;
+ private final XMLEventReader xmlEventReader;
+ private final String systemId;
+
+ public StAXSource(XMLStreamReader xmlStreamReader) {
+ if (xmlStreamReader == null) {
+ throw new IllegalArgumentException("XMLStreamReader cannot be null.");
+ }
+ final int event = xmlStreamReader.getEventType();
+ if (event != XMLStreamConstants.START_DOCUMENT &&
+ event != XMLStreamConstants.START_ELEMENT) {
+ throw new IllegalStateException("The state of the XMLStreamReader must be START_DOCUMENT or START_ELEMENT");
+ }
+ this.xmlStreamReader = xmlStreamReader;
+ this.xmlEventReader = null;
+ this.systemId = xmlStreamReader.getLocation().getSystemId();
+ }
+
+ public StAXSource(XMLEventReader xmlEventReader)
+ throws XMLStreamException {
+ if (xmlEventReader == null) {
+ throw new IllegalArgumentException("XMLEventReader cannot be null.");
+ }
+ final XMLEvent event = xmlEventReader.peek();
+ if (!event.isStartDocument() &&
+ !event.isStartElement()) {
+ throw new IllegalStateException("The state of the XMLEventReader must be START_DOCUMENT or START_ELEMENT");
+ }
+ this.xmlStreamReader = null;
+ this.xmlEventReader = xmlEventReader;
+ this.systemId = event.getLocation().getSystemId();
+ }
+
+ public XMLStreamReader getXMLStreamReader() {
+ return xmlStreamReader;
+ }
+
+ public XMLEventReader getXMLEventReader() {
+ return xmlEventReader;
+ }
+
+ public String getSystemId() {
+ return systemId;
+ }
+
+ public void setSystemId(String systemId) {
+ throw new UnsupportedOperationException("Setting systemId is not supported.");
+ }
+}
diff --git a/javax/xml/transform/stream/StreamResult.java b/javax/xml/transform/stream/StreamResult.java
index 9a685ff..3c3d49e 100644
--- a/javax/xml/transform/stream/StreamResult.java
+++ b/javax/xml/transform/stream/StreamResult.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: StreamResult.java 829968 2009-10-26 21:15:03Z mrglavas $
+// $Id: StreamResult.java 829970 2009-10-26 21:15:29Z mrglavas $
package javax.xml.transform.stream;
diff --git a/javax/xml/transform/stream/StreamSource.java b/javax/xml/transform/stream/StreamSource.java
index e55713b..0bacb26 100644
--- a/javax/xml/transform/stream/StreamSource.java
+++ b/javax/xml/transform/stream/StreamSource.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: StreamSource.java 829969 2009-10-26 21:15:12Z mrglavas $
+// $Id: StreamSource.java 829971 2009-10-26 21:15:39Z mrglavas $
package javax.xml.transform.stream;
@@ -33,7 +33,7 @@ import javax.xml.transform.Source;
* <code>StreamSource</code> instances may only be used once.</p>
*
* @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 829969 $, $Date: 2009-10-26 17:15:12 -0400 (Mon, 26 Oct 2009) $
+ * @version $Revision: 829971 $, $Date: 2009-10-26 17:15:39 -0400 (Mon, 26 Oct 2009) $
*/
public class StreamSource implements Source {
diff --git a/javax/xml/validation/SchemaFactory.java b/javax/xml/validation/SchemaFactory.java
index ed5b398..329e659 100644
--- a/javax/xml/validation/SchemaFactory.java
+++ b/javax/xml/validation/SchemaFactory.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-// $Id: SchemaFactory.java 569992 2007-08-27 04:18:22Z mrglavas $
+// $Id: SchemaFactory.java 884952 2009-11-27 18:55:08Z mrglavas $
package javax.xml.validation;
@@ -98,7 +98,7 @@ import org.xml.sax.SAXNotSupportedException;
* </table>
*
* @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 569992 $, $Date: 2007-08-27 00:18:22 -0400 (Mon, 27 Aug 2007) $
+ * @version $Revision: 884952 $, $Date: 2009-11-27 13:55:08 -0500 (Fri, 27 Nov 2009) $
* @since 1.5
*/
public abstract class SchemaFactory {
@@ -196,6 +196,33 @@ public abstract class SchemaFactory {
return f;
}
+ /**
+ * @return New instance of a <code>SchemaFactory</code>
+ *
+ * @throws IllegalArgumentException
+ * If no implementation of the schema language is available.
+ *
+ * @throws NullPointerException
+ * If the <tt>schemLanguage</tt> parameter is null.
+ */
+ public static SchemaFactory newInstance(String schemaLanguage,
+ String factoryClassName, ClassLoader classLoader) {
+ if (schemaLanguage == null) {
+ throw new NullPointerException();
+ }
+ if (factoryClassName == null) {
+ throw new IllegalArgumentException("factoryClassName cannot be null.");
+ }
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ SchemaFactory f = new SchemaFactoryFinder(classLoader).createInstance(factoryClassName);
+ if (f == null || !f.isSchemaLanguageSupported(schemaLanguage)) {
+ throw new IllegalArgumentException(schemaLanguage);
+ }
+ return f;
+ }
+
/**
* <p>Is specified schema supported by this <code>SchemaFactory</code>?</p>
*
@@ -573,8 +600,10 @@ public abstract class SchemaFactory {
*
* @param schemas
* inputs to be parsed. {@link SchemaFactory} is required
- * to recognize {@link javax.xml.transform.sax.SAXSource},
- * {@link StreamSource}, and {@link javax.xml.transform.dom.DOMSource}.
+ * to recognize {@link StreamSource},
+ * {@link javax.xml.transform.sax.SAXSource},
+ * {@link javax.xml.transform.dom.DOMSource}
+ * and {@link javax.xml.transform.stax.StAXSource}.
*
* @return
* Always return a non-null valid {@link Schema} object.
diff --git a/javax/xml/validation/SchemaFactoryFinder.java b/javax/xml/validation/SchemaFactoryFinder.java
index f969972..b12bf5f 100644
--- a/javax/xml/validation/SchemaFactoryFinder.java
+++ b/javax/xml/validation/SchemaFactoryFinder.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// $Id: SchemaFactoryFinder.java 727365 2008-12-17 12:59:01Z mrglavas $
+// $Id: SchemaFactoryFinder.java 727367 2008-12-17 13:05:26Z mrglavas $
package javax.xml.validation;
@@ -36,10 +36,14 @@ import javax.xml.XMLConstants;
* Implementation of {@link SchemaFactory#newInstance(String)}.
*
* @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 727365 $, $Date: 2008-12-17 07:59:01 -0500 (Wed, 17 Dec 2008) $
+ * @version $Revision: 727367 $, $Date: 2008-12-17 08:05:26 -0500 (Wed, 17 Dec 2008) $
* @since 1.5
*/
final class SchemaFactoryFinder {
+
+ /** XML Schema language identifiers. */
+ private static final String W3C_XML_SCHEMA10_NS_URI = "http://www.w3.org/XML/XMLSchema/v1.0";
+ private static final String W3C_XML_SCHEMA11_NS_URI = "http://www.w3.org/XML/XMLSchema/v1.1";
/** debug support code. */
private static boolean debug = false;
@@ -269,11 +273,15 @@ final class SchemaFactoryFinder {
}
}
- // platform default
- if (schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
- if (debug) debugPrintln("attempting to use the platform default XML Schema validator");
+ // platform defaults
+ if (schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI) || schemaLanguage.equals(W3C_XML_SCHEMA10_NS_URI)) {
+ if (debug) debugPrintln("attempting to use the platform default XML Schema 1.0 validator");
return createInstance("org.apache.xerces.jaxp.validation.XMLSchemaFactory");
}
+ else if (schemaLanguage.equals(W3C_XML_SCHEMA11_NS_URI)) {
+ if (debug) debugPrintln("attempting to use the platform default XML Schema 1.1 validator");
+ return createInstance("org.apache.xerces.jaxp.validation.XMLSchema11Factory");
+ }
if (debug) debugPrintln("all things were tried, but none was found. bailing out.");
return null;
@@ -288,7 +296,7 @@ final class SchemaFactoryFinder {
* @return null
* if it fails. Error messages will be printed by this method.
*/
- private SchemaFactory createInstance( String className ) {
+ SchemaFactory createInstance( String className ) {
try {
if (debug) debugPrintln("instanciating "+className);
Class clazz;
diff --git a/javax/xml/validation/TypeInfoProvider.java b/javax/xml/validation/TypeInfoProvider.java
index 872f68a..464a45e 100644
--- a/javax/xml/validation/TypeInfoProvider.java
+++ b/javax/xml/validation/TypeInfoProvider.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// $Id: TypeInfoProvider.java 569992 2007-08-27 04:18:22Z mrglavas $
+// $Id: TypeInfoProvider.java 884939 2009-11-27 18:20:46Z mrglavas $
package javax.xml.validation;
@@ -35,7 +35,7 @@ import org.w3c.dom.TypeInfo;
* {@link ValidatorHandler#getTypeInfoProvider()} method.
*
* @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 569992 $, $Date: 2007-08-27 00:18:22 -0400 (Mon, 27 Aug 2007) $
+ * @version $Revision: 884939 $, $Date: 2009-11-27 13:20:46 -0500 (Fri, 27 Nov 2009) $
* @see org.w3c.dom.TypeInfo
* @since 1.5
*/
@@ -54,7 +54,7 @@ public abstract class TypeInfoProvider {
* <p>Returns the immutable {@link TypeInfo} object for the current element.</p>
*
* <p>
- * The method may only be called by the startElement event of
+ * The method may only be called by the startElement and endElement event of
* the {@link org.xml.sax.ContentHandler} that the application sets to the
* {@link ValidatorHandler}.</p>
*
diff --git a/javax/xml/validation/Validator.java b/javax/xml/validation/Validator.java
index 63edd16..9535fc0 100644
--- a/javax/xml/validation/Validator.java
+++ b/javax/xml/validation/Validator.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// $Id: Validator.java 446598 2006-09-15 12:55:40Z jeremias $
+// $Id: Validator.java 888884 2009-12-09 17:36:46Z mrglavas $
package javax.xml.validation;
@@ -43,10 +43,10 @@ import org.xml.sax.SAXNotSupportedException;
*
* Note that while the {@link #validate(javax.xml.transform.Source)} and {@link #validate(javax.xml.transform.Source, javax.xml.transform.Result)}
* methods take a {@link Source} instance, the <code>Source</code>
- * instance must be a <code>SAXSource</code> or <code>DOMSource</code>.
+ * instance must be a <code>SAXSource</code>, <code>DOMSource</code>, <code>StAXSource</code> or <code>StreamSource</code>.
*
* @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
+ * @version $Revision: 888884 $, $Date: 2009-12-09 12:36:46 -0500 (Wed, 09 Dec 2009) $
* @since 1.5
*/
public abstract class Validator {
@@ -109,6 +109,8 @@ public abstract class Validator {
* <td></td>
* <td>{@link javax.xml.transform.sax.SAXSource}</td>
* <td>{@link javax.xml.transform.dom.DOMSource}</td>
+ * <td>{@link javax.xml.transform.stax.StAXSource}</td>
+ * <td>{@link javax.xml.transform.stream.StreamSource}</td>
* </tr>
* </thead>
* <tbody>
@@ -116,23 +118,42 @@ public abstract class Validator {
* <td><tt>null</tt></td>
* <td>OK</td>
* <td>OK</td>
+ * <td>OK</td>
+ * <td>OK</td>
* </tr>
* <tr>
* <td>{@link javax.xml.transform.sax.SAXResult}</td>
* <td>OK</td>
* <td>Err</td>
+ * <td>Err</td>
+ * <td>Err</td>
* </tr>
* <tr>
* <td>{@link javax.xml.transform.dom.DOMResult}</td>
* <td>Err</td>
* <td>OK</td>
+ * <td>Err</td>
+ * <td>Err</td>
+ * </tr>
+ * <tr>
+ * <td>{@link javax.xml.transform.stax.StAXResult}</td>
+ * <td>Err</td>
+ * <td>Err</td>
+ * <td>OK</td>
+ * <td>Err</td>
+ * </tr>
+ * <tr>
+ * <td>{@link javax.xml.transform.stream.StreamResult}</td>
+ * <td>Err</td>
+ * <td>Err</td>
+ * <td>Err</td>
+ * <td>OK</td>
* </tr>
* </tbody>
* </table>
*
* <p>
- * <strong>Note that {@link javax.xml.transform.stream.StreamSource} instances are not allowed.</strong> To process
- * a <code>StreamSource</code>, or to validate one {@link Source} into another kind of {@link Result}, use the identity transformer
+ * To validate one {@link Source} into another kind of {@link Result}, use the identity transformer
* (see {@link javax.xml.transform.TransformerFactory#newTransformer()}).
*
* <p>
@@ -162,9 +183,11 @@ public abstract class Validator {
*
* @throws IllegalArgumentException
* If the {@link Result} type doesn't match the {@link Source} type,
- * or if the specified source is neither
- * {@link javax.xml.transform.sax.SAXSource} nor
- * {@link javax.xml.transform.dom.DOMSource}.
+ * or if the specified source is not a
+ * {@link javax.xml.transform.sax.SAXSource},
+ * {@link javax.xml.transform.dom.DOMSource},
+ * {@link javax.xml.transform.stax.StAXSource} or
+ * {@link javax.xml.transform.stream.StreamSource}.
*
* @throws SAXException
* If the {@link ErrorHandler} throws a {@link SAXException} or
diff --git a/javax/xml/xpath/XPathFactory.java b/javax/xml/xpath/XPathFactory.java
index 3ede465..de85593 100644
--- a/javax/xml/xpath/XPathFactory.java
+++ b/javax/xml/xpath/XPathFactory.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// $Id: XPathFactory.java 884953 2009-11-27 18:55:59Z mrglavas $
+// $Id: XPathFactory.java 888889 2009-12-09 17:43:18Z mrglavas $
package javax.xml.xpath;
@@ -26,7 +26,7 @@ package javax.xml.xpath;
*
* @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
* @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 884953 $, $Date: 2009-11-27 13:55:59 -0500 (Fri, 27 Nov 2009) $
+ * @version $Revision: 888889 $, $Date: 2009-12-09 12:43:18 -0500 (Wed, 09 Dec 2009) $
* @since 1.5
*/
public abstract class XPathFactory {
@@ -43,7 +43,8 @@ public abstract class XPathFactory {
public static final String DEFAULT_OBJECT_MODEL_URI = "http://java.sun.com/jaxp/xpath/dom";
/**
- * <p>Protected constructor as {@link #newInstance()} or {@link #newInstance(String uri)}
+ * <p>Protected constructor as {@link #newInstance()}, {@link #newInstance(String uri)}
+ * or {@link #newInstance(String uri, String factoryClassName, ClassLoader classLoader)}
* should be used to create a new instance of an <code>XPathFactory</code>.</p>
*/
protected XPathFactory() {
@@ -64,10 +65,10 @@ public abstract class XPathFactory {
* @return Instance of an <code>XPathFactory</code>.
*/
public static final XPathFactory newInstance() {
-
try {
return newInstance(DEFAULT_OBJECT_MODEL_URI);
- } catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) {
+ }
+ catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) {
throw new RuntimeException(
"XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
+ DEFAULT_OBJECT_MODEL_URI
@@ -131,36 +132,64 @@ public abstract class XPathFactory {
*/
public static final XPathFactory newInstance(final String uri)
throws XPathFactoryConfigurationException {
-
if (uri == null) {
- throw new NullPointerException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == null"
- );
+ throw new NullPointerException(
+ "XPathFactory#newInstance(String uri) cannot be called with uri == null"
+ );
}
-
- if (uri.length() == 0) {
- throw new IllegalArgumentException(
- "XPathFactory#newInstance(String uri) cannot be called with uri == \"\""
- );
- }
-
- ClassLoader classLoader = SecuritySupport.getContextClassLoader();
-
+ if (uri.length() == 0) {
+ throw new IllegalArgumentException(
+ "XPathFactory#newInstance(String uri) cannot be called with uri == \"\""
+ );
+ }
+ ClassLoader classLoader = SecuritySupport.getContextClassLoader();
if (classLoader == null) {
//use the current class loader
classLoader = XPathFactory.class.getClassLoader();
}
-
- XPathFactory xpathFactory = new XPathFactoryFinder(classLoader).newFactory(uri);
-
- if (xpathFactory == null) {
- throw new XPathFactoryConfigurationException(
- "No XPathFctory implementation found for the object model: "
- + uri
- );
- }
-
- return xpathFactory;
+ XPathFactory xpathFactory = new XPathFactoryFinder(classLoader).newFactory(uri);
+ if (xpathFactory == null) {
+ throw new XPathFactoryConfigurationException(
+ "No XPathFctory implementation found for the object model: "
+ + uri
+ );
+ }
+ return xpathFactory;
+ }
+
+ /**
+ * @return Instance of an <code>XPathFactory</code>.
+ *
+ * @throws XPathFactoryConfigurationException If the specified object model is unavailable.
+ * @throws NullPointerException If <code>uri</code> is <code>null</code>.
+ * @throws IllegalArgumentException If <code>uri.length() == 0</code>.
+ */
+ public static XPathFactory newInstance(String uri, String factoryClassName,
+ ClassLoader classLoader) throws XPathFactoryConfigurationException {
+ if (uri == null) {
+ throw new NullPointerException(
+ "XPathFactory#newInstance(String uri) cannot be called with uri == null"
+ );
+ }
+ if (uri.length() == 0) {
+ throw new IllegalArgumentException(
+ "XPathFactory#newInstance(String uri) cannot be called with uri == \"\""
+ );
+ }
+ if (factoryClassName == null) {
+ throw new XPathFactoryConfigurationException("factoryClassName cannot be null.");
+ }
+ if (classLoader == null) {
+ classLoader = SecuritySupport.getContextClassLoader();
+ }
+ XPathFactory xpathFactory = new XPathFactoryFinder(classLoader).createInstance(factoryClassName);
+ if (xpathFactory == null || !xpathFactory.isObjectModelSupported(uri)) {
+ throw new XPathFactoryConfigurationException(
+ "No XPathFctory implementation found for the object model: "
+ + uri
+ );
+ }
+ return xpathFactory;
}
/**
diff --git a/javax/xml/xpath/XPathFactoryFinder.java b/javax/xml/xpath/XPathFactoryFinder.java
index 4b32de0..6ea7a24 100644
--- a/javax/xml/xpath/XPathFactoryFinder.java
+++ b/javax/xml/xpath/XPathFactoryFinder.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-// $Id: XPathFactoryFinder.java 670433 2008-06-23 02:02:24Z mrglavas $
+// $Id: XPathFactoryFinder.java 670432 2008-06-23 02:02:08Z mrglavas $
package javax.xml.xpath;
@@ -36,7 +36,7 @@ import javax.xml.validation.SchemaFactory;
* Implementation of {@link XPathFactory#newInstance(String)}.
*
* @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 670433 $, $Date: 2008-06-22 22:02:24 -0400 (Sun, 22 Jun 2008) $
+ * @version $Revision: 670432 $, $Date: 2008-06-22 22:02:08 -0400 (Sun, 22 Jun 2008) $
* @since 1.5
*/
final class XPathFactoryFinder {
@@ -266,7 +266,7 @@ final class XPathFactoryFinder {
* @return null
* if it fails. Error messages will be printed by this method.
*/
- private XPathFactory createInstance( String className ) {
+ XPathFactory createInstance( String className ) {
try {
if (debug) debugPrintln("instanciating "+className);
Class clazz;
diff --git a/manifest.commons b/manifest.commons
index 9718474..7a4a297 100644
--- a/manifest.commons
+++ b/manifest.commons
@@ -4,7 +4,7 @@ Created-By: 1.3.1 (IBM Corporation)
Name: org/apache/xmlcommons/Version
Comment: XmlCommonsExternal for http://xml.apache.org/ subproject's use
Implementation-Title: org.apache.xmlcommons.Version
-Implementation-Version: 1.3.05
+Implementation-Version: 1.4.01
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/commons/
@@ -38,53 +38,72 @@ Implementation-Version: 1.0
Implementation-Vendor: World Wide Web Consortium
Implementation-URL: http://www.w3c.org/DOM/
+Name: javax/xml/stream/
+Comment: xml-commons for http://xml.apache.org/ subproject's use
+Specification-Title: Streaming API for XML (StAX) 1.0
+Specification-Vendor: BEA Systems, Inc.
+Specification-Version: 1.0
+Implementation-Title: javax.xml.stream
+Implementation-Version: 1.4.01
+Implementation-Vendor: Apache Software Foundation
+Implementation-URL: http://xml.apache.org/commons/
+
+Name: javax/xml/datatype/
+Comment: xml-commons for http://xml.apache.org/ subproject's use
+Specification-Title: Java API for XML Processing (JAXP) 1.4
+Specification-Vendor: Sun Microsystems Inc.
+Specification-Version: 1.4
+Implementation-Title: javax.xml.datatype
+Implementation-Version: 1.4.01
+Implementation-Vendor: Apache Software Foundation
+Implementation-URL: http://xml.apache.org/commons/
+
+Name: javax/xml/namespace/
+Comment: xml-commons for http://xml.apache.org/ subproject's use
+Specification-Title: Java API for XML Processing (JAXP) 1.4
+Specification-Vendor: Sun Microsystems Inc.
+Specification-Version: 1.4
+Implementation-Title: javax.xml.namespace
+Implementation-Version: 1.4.01
+Implementation-Vendor: Apache Software Foundation
+Implementation-URL: http://xml.apache.org/commons/
+
Name: javax/xml/parsers/
Comment: xml-commons for http://xml.apache.org/ subproject's use
-Specification-Title: JSR 206, Java API for XML Processing 1.3
-Specification-Version: 1.3
+Specification-Title: Java API for XML Processing (JAXP) 1.4
Specification-Vendor: Sun Microsystems Inc.
+Specification-Version: 1.4
Implementation-Title: javax.xml.parsers
-Implementation-Version: 1.3.05
+Implementation-Version: 1.4.01
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/commons/
Name: javax/xml/transform/
Comment: xml-commons for http://xml.apache.org/ subproject's use
-Specification-Title: JSR 206 Java API for XML Processing 1.3
-Specification-Version: 1.3
+Specification-Title: Java API for XML Processing (JAXP) 1.4
Specification-Vendor: Sun Microsystems Inc.
+Specification-Version: 1.4
Implementation-Title: javax.xml.transform
-Implementation-Version: 1.3.05
+Implementation-Version: 1.4.01
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/commons/
Name: javax/xml/validation/
Comment: xml-commons for http://xml.apache.org/ subproject's use
-Specification-Title: JSR 206 Java API for XML Processing 1.3
-Specification-Version: 1.3
+Specification-Title: Java API for XML Processing (JAXP) 1.4
Specification-Vendor: Sun Microsystems Inc.
+Specification-Version: 1.4
Implementation-Title: javax.xml.validation
-Implementation-Version: 1.3.05
-Implementation-Vendor: Apache Software Foundation
-Implementation-URL: http://xml.apache.org/commons/
-
-Name: javax/xml/datatype/
-Comment: xml-commons for http://xml.apache.org/ subproject's use
-Specification-Title: JSR 206 Java API for XML Processing 1.3
-Specification-Version: 1.3
-Specification-Vendor: Sun Microsystems Inc.
-Implementation-Title: javax.xml.datatype
-Implementation-Version: 1.3.05
+Implementation-Version: 1.4.01
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/commons/
Name: javax/xml/xpath/
Comment: xml-commons for http://xml.apache.org/ subproject's use
-Specification-Title: JSR 206 Java API for XML Processing 1.3
-Specification-Version: 1.3
+Specification-Title: Java API for XML Processing (JAXP) 1.4
Specification-Vendor: Sun Microsystems Inc.
+Specification-Version: 1.4
Implementation-Title: javax.xml.xpath
-Implementation-Version: 1.3.05
+Implementation-Version: 1.4.01
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/commons/
-
diff --git a/org/apache/xmlcommons/Version.java b/org/apache/xmlcommons/Version.java
index b9d83a5..cf08b84 100644
--- a/org/apache/xmlcommons/Version.java
+++ b/org/apache/xmlcommons/Version.java
@@ -57,7 +57,7 @@ public class Version
*/
public static String getVersionNum()
{
- return "1.3.05";
+ return "1.4.01";
}
/**
diff --git a/org/w3c/dom/ElementTraversal.java b/org/w3c/dom/ElementTraversal.java
new file mode 100644
index 0000000..bd3b8d0
--- /dev/null
+++ b/org/w3c/dom/ElementTraversal.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2009 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] 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.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom;
+
+/**
+ * The <code>ElementTraversal</code> interface is a set of read-only attributes
+ * which allow an author to easily navigate between elements in a document.
+ * <p>In conforming implementations of Element Traversal, all objects that
+ * implement {@link Element} must also implement the
+ * <code>ElementTraversal</code> interface. Four of the methods,
+ * {@link #getFirstElementChild}, {@link #getLastElementChild},
+ * {@link #getPreviousElementSibling}, and {@link #getNextElementSibling},
+ * each return a live reference to another element with the defined
+ * relationship to the current element, if the related element exists. The
+ * fifth method, {@link #getChildElementCount}, exposes the number of child
+ * elements of an element, for preprocessing before navigation.
+ * <p>See also the
+ * <a href='http://www.w3.org/TR/ElementTraversal/'><cite>Element Traversal Specification</cite></a>.
+ */
+public interface ElementTraversal {
+
+ /**
+ * Returns the first child element node of this element. <code>null</code>
+ * if this element has no child elements.
+ */
+ Element getFirstElementChild();
+
+ /**
+ * Returns the last child element node of this element. <code>null</code>
+ * if this element has no child elements.
+ */
+ Element getLastElementChild();
+
+ /**
+ * Returns the previous sibling element node of this element.
+ * <code>null</code> if this element has no element sibling nodes that
+ * come before this one in the document tree.
+ */
+ Element getPreviousElementSibling();
+
+ /**
+ * Returns the next sibling element node of this element.
+ * <code>null</code> if this element has no element sibling nodes that
+ * come after this one in the document tree.
+ */
+ Element getNextElementSibling();
+
+ /**
+ * Returns the current number of element nodes that are children of this
+ * element. <code>0</code> if this element has no child nodes that are of
+ * <code>nodeType</code> <code>1</code>.
+ */
+ int getChildElementCount();
+}
diff --git a/org/xml/sax/helpers/NewInstance.java b/org/xml/sax/helpers/NewInstance.java
index d72b379..1195743 100644
--- a/org/xml/sax/helpers/NewInstance.java
+++ b/org/xml/sax/helpers/NewInstance.java
@@ -3,7 +3,7 @@
// Written by Edwin Goei, edwingo@apache.org
// and by David Brownell, dbrownell@users.sourceforge.net
// NO WARRANTY! This class is in the Public Domain.
-// $Id: NewInstance.java 670297 2008-06-22 01:57:58Z mrglavas $
+// $Id: NewInstance.java 670295 2008-06-22 01:46:43Z mrglavas $
package org.xml.sax.helpers;
diff --git a/org/xml/sax/helpers/ParserFactory.java b/org/xml/sax/helpers/ParserFactory.java
index d3972ec..379e08c 100644
--- a/org/xml/sax/helpers/ParserFactory.java
+++ b/org/xml/sax/helpers/ParserFactory.java
@@ -1,7 +1,7 @@
//SAX parser factory.
//http://www.saxproject.org
//No warranty; no copyright -- use this as you will.
-//$Id: ParserFactory.java 670297 2008-06-22 01:57:58Z mrglavas $
+//$Id: ParserFactory.java 670295 2008-06-22 01:46:43Z mrglavas $
package org.xml.sax.helpers;
diff --git a/org/xml/sax/helpers/XMLReaderFactory.java b/org/xml/sax/helpers/XMLReaderFactory.java
index ece0067..5f56439 100644
--- a/org/xml/sax/helpers/XMLReaderFactory.java
+++ b/org/xml/sax/helpers/XMLReaderFactory.java
@@ -3,7 +3,7 @@
// Written by David Megginson
// and by David Brownell
// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReaderFactory.java 670297 2008-06-22 01:57:58Z mrglavas $
+// $Id: XMLReaderFactory.java 670295 2008-06-22 01:46:43Z mrglavas $
package org.xml.sax.helpers;
import java.io.BufferedReader;
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files