servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1227192 - in /servicemix/smx4/specs/trunk: ./ stax-api-1.0/ stax-api-1.2/ stax-api-1.2/src/ stax-api-1.2/src/main/ stax-api-1.2/src/main/java/ stax-api-1.2/src/main/java/javax/ stax-api-1.2/src/main/java/javax/xml/ stax-api-1.2/src/main/ja...
Date Wed, 04 Jan 2012 15:39:59 GMT
Author: gnodet
Date: Wed Jan  4 15:39:58 2012
New Revision: 1227192

URL: http://svn.apache.org/viewvc?rev=1227192&view=rev
Log:
Add stax 1.2 api and fix imports for stax-1.0 api

Added:
    servicemix/smx4/specs/trunk/stax-api-1.2/
    servicemix/smx4/specs/trunk/stax-api-1.2/pom.xml
      - copied, changed from r1226832, servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml
    servicemix/smx4/specs/trunk/stax-api-1.2/src/
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java
    servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java
Modified:
    servicemix/smx4/specs/trunk/pom.xml
    servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml

Modified: servicemix/smx4/specs/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/pom.xml?rev=1227192&r1=1227191&r2=1227192&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/pom.xml (original)
+++ servicemix/smx4/specs/trunk/pom.xml Wed Jan  4 15:39:58 2012
@@ -40,6 +40,7 @@
         <module>activator</module>
         <module>saaj-api-1.3</module>
         <module>stax-api-1.0</module>
+        <module>stax-api-1.2</module>
         <module>jain-sip-api-1.2</module>
         <module>jaxb-api-2.0</module>
         <module>jaxb-api-2.1</module>

Modified: servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml?rev=1227192&r1=1227191&r2=1227192&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml (original)
+++ servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml Wed Jan  4 15:39:58 2012
@@ -55,7 +55,7 @@
                     <instructions>
                         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                         <Bundle-Description>${project.description}</Bundle-Description>
-                        <Export-Package>javax.xml.stream*;version=1.0.1;-split-package:=merge-first</Export-Package>
+                        <Export-Package>javax.xml.stream*;version=1.0.1;-split-package:=merge-first;-noimport:=true</Export-Package>
                         <Import-Package>*</Import-Package>
                         <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
                         <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>

Copied: servicemix/smx4/specs/trunk/stax-api-1.2/pom.xml (from r1226832, servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml)
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/stax-api-1.2/pom.xml?p2=servicemix/smx4/specs/trunk/stax-api-1.2/pom.xml&p1=servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml&r1=1226832&r2=1227192&rev=1227192&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/stax-api-1.0/pom.xml (original)
+++ servicemix/smx4/specs/trunk/stax-api-1.2/pom.xml Wed Jan  4 15:39:58 2012
@@ -28,16 +28,16 @@
     </parent>
 
     <groupId>org.apache.servicemix.specs</groupId>
-    <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
+    <artifactId>org.apache.servicemix.specs.stax-api-1.2</artifactId>
     <packaging>bundle</packaging>
     <version>2.0-SNAPSHOT</version>
-    <name>Apache ServiceMix :: Specs :: Stax API 1.0</name>
+    <name>Apache ServiceMix :: Specs :: Stax API 1.2</name>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
-            <version>1.0.1</version>
+            <artifactId>geronimo-stax-api_1.2_spec</artifactId>
+            <version>1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.servicemix.specs</groupId>
@@ -55,8 +55,8 @@
                     <instructions>
                         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                         <Bundle-Description>${project.description}</Bundle-Description>
-                        <Export-Package>javax.xml.stream*;version=1.0.1;-split-package:=merge-first</Export-Package>
-                        <Import-Package>*</Import-Package>
+                        <Export-Package>javax.xml.stream*;version=1.2;-split-package:=merge-first;-noimport:=true</Export-Package>
+                        <Import-Package>javax.xml.namespace;version=!,*</Import-Package>
                         <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
                         <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
                         <Implementation-Title>Apache ServiceMix</Implementation-Title>
@@ -77,13 +77,13 @@
                         <configuration>
                             <artifactSet>
                                 <includes>
-                                    <include>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</include>
+                                    <include>org.apache.geronimo.specs:geronimo-stax-api_1.2_spec</include>
                                     <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
                                 </includes>
                             </artifactSet>
                             <filters>
                                 <filter>
-                                    <artifact>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</artifact>
+                                    <artifact>org.apache.geronimo.specs:geronimo-stax-api_1.2_spec</artifact>
                                     <excludes>
                                         <exclude>javax/**</exclude>
                                     </excludes>
@@ -127,7 +127,7 @@
                                     <artifactItems>
                                         <artifactItem>
                                             <groupId>org.apache.geronimo.specs</groupId>
-                                            <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+                                            <artifactId>geronimo-stax-api_1.2_spec</artifactId>
                                             <classifier>sources</classifier>
                                         </artifactItem>
                                         <artifactItem>

Added: servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java?rev=1227192&view=auto
==============================================================================
--- servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java
(added)
+++ servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java
Wed Jan  4 15:39:58 2012
@@ -0,0 +1,156 @@
+/**
+ * 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.
+ */
+package javax.xml.stream;
+
+import java.io.InputStream;
+import java.io.File;
+import java.io.FileInputStream;
+
+import java.util.Arrays;
+import java.util.Properties;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+
+/*
+ * Here is the beef on the finding the Factory Class
+ * 
+ * 1. Use the javax.xml.stream.XMLInputFactory system property. 2. Use the
+ * properties file "lib/stax.properties" in the JRE directory. This
+ * configuration file is in standard java.util.Properties format and contains
+ * the fully qualified name of the implementation class with the key being the
+ * system property defined above. 3. Use the Services API (as detailed in the
+ * JAR specification), if available, to determine the classname. The Services
+ * API will look for a classname in the file
+ * META-INF/services/javax.xml.stream.XMLInputFactory in jars available to the
+ * runtime. Platform default XMLInputFactory instance.
+ * 
+ * If the user provided a classloader we'll use that...if not, we'll assume the 
+ * classloader of this class.
+ */
+
+class FactoryLocator {
+	static Object locate(String factoryId) throws FactoryConfigurationError {
+		return locate(factoryId, null);
+	}
+
+	static Object locate(String factoryId, String[] altClassName)
+			throws FactoryConfigurationError {
+		return locate(factoryId, altClassName,
+                              Thread.currentThread().getContextClassLoader());
+	}
+
+	static Object locate(String factoryId, String[] altClassName,
+                         ClassLoader classLoader) throws FactoryConfigurationError {
+        try {
+            // If we are deployed into an OSGi environment, leverage it
+            ClassLoader cl = FactoryLocator.class.getClassLoader();
+            if (cl == null) {
+                cl = ClassLoader.getSystemClassLoader();
+            }
+            Class factoryClass = cl.loadClass(factoryId);
+            Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass,
factoryId);
+            if (spiClass != null) {
+                return spiClass.newInstance();
+            }
+        } catch (Throwable e) {
+        }
+
+        try {
+			String prop = System.getProperty(factoryId);
+			if (prop != null) {
+				return loadFactory(prop, classLoader);
+			}
+		} catch (Exception e) {
+		}
+
+		try {
+			String configFile = System.getProperty("java.home")
+					+ File.separator + "lib" + File.separator
+					+ "stax.properties";
+			File f = new File(configFile);
+			if (f.exists()) {
+				Properties props = new Properties();
+				props.load(new FileInputStream(f));
+				String factoryClassName = props.getProperty(factoryId);
+				return loadFactory(factoryClassName, classLoader);
+			}
+		} catch (Exception e) {
+		}
+
+		String serviceId = "META-INF/services/" + factoryId;
+		try {
+			InputStream is = null;
+
+			if (classLoader == null) {
+				is = ClassLoader.getSystemResourceAsStream(serviceId);
+			} else {
+				is = classLoader.getResourceAsStream(serviceId);
+			}
+
+			if (is != null) {
+				BufferedReader br = new BufferedReader(new InputStreamReader(
+						is, "UTF-8"));
+				String factoryClassName = br.readLine();
+				br.close();
+
+				if (factoryClassName != null && !"".equals(factoryClassName)) {
+					return loadFactory(factoryClassName, classLoader);
+				}
+			}
+		} catch (Exception ex) {
+		}
+
+		if (altClassName == null) {
+			throw new FactoryConfigurationError("Unable to locate factory for "
+					+ factoryId + ".", null);
+		}
+		return loadFactory(altClassName, classLoader);
+	}
+
+    private static Object loadFactory(String[] classNames, ClassLoader classLoader)
+            throws FactoryConfigurationError {
+        for (String className : classNames) {
+            try {
+                Class factoryClass = classLoader == null ? Class.forName(className)
+                        : classLoader.loadClass(className);
+
+                return factoryClass.newInstance();
+            } catch (Exception x) {
+            }
+        }
+        throw new FactoryConfigurationError("Requested factory "
+                + Arrays.asList(classNames).toString()
+                + " could not be instantiated");
+    }
+
+	private static Object loadFactory(String className, ClassLoader classLoader)
+			throws FactoryConfigurationError {
+		try {
+			Class factoryClass = classLoader == null ? Class.forName(className)
+					: classLoader.loadClass(className);
+
+			return factoryClass.newInstance();
+		} catch (ClassNotFoundException x) {
+			throw new FactoryConfigurationError("Requested factory "
+					+ className + " cannot be located.  Classloader ="
+					+ classLoader.toString(), x);
+		} catch (Exception x) {
+			throw new FactoryConfigurationError("Requested factory "
+					+ className + " could not be instantiated: " + x, x);
+		}
+	}
+}

Added: servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java?rev=1227192&view=auto
==============================================================================
--- servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java
(added)
+++ servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java
Wed Jan  4 15:39:58 2012
@@ -0,0 +1,141 @@
+/*
+ **
+ ** 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.
+ */
+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 {
+
+    protected XMLEventFactory() {
+    }
+
+    public static XMLEventFactory newInstance() throws FactoryConfigurationError {
+        return (XMLEventFactory)FactoryLocator.locate("javax.xml.stream.XMLEventFactory",
+                new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl",
"com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" });
+    }
+
+    public static XMLEventFactory newFactory() throws FactoryConfigurationError {
+        return (XMLEventFactory)FactoryLocator.locate("javax.xml.stream.XMLEventFactory",
+                new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl",
"com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" });
+    }
+
+    /**
+     * Create a new XMLEventFactory
+     *
+     * @deprecated to maintain API consistency.  All newInstance methods are
+     * replaced with corresponding newFactory methods.  The replacement
+     * newFactory(String factoryId, ClassLoader classLoader)
+     * method defines no changes in behavior from this method.
+     */
+    public static XMLEventFactory newInstance(String factoryId,
+                                              ClassLoader classLoader) throws FactoryConfigurationError
{
+        return (XMLEventFactory)FactoryLocator.locate(factoryId,
+                new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl",
"com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" },
+                classLoader);
+    }
+
+
+    public static XMLEventFactory newFactory(String factoryId,
+                                             ClassLoader classLoader) throws FactoryConfigurationError
{
+        return (XMLEventFactory)FactoryLocator.locate(factoryId,
+                new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl",
"com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" },
+                classLoader);
+    }
+
+    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);
+}
\ No newline at end of file

Added: servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java?rev=1227192&view=auto
==============================================================================
--- servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java
(added)
+++ servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java
Wed Jan  4 15:39:58 2012
@@ -0,0 +1,149 @@
+/*
+ **
+ ** 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.
+ */
+package javax.xml.stream;
+
+import javax.xml.stream.util.XMLEventAllocator;
+
+public abstract class XMLInputFactory {
+    public static final java.lang.String ALLOCATOR = "javax.xml.stream.allocator";
+    public static final java.lang.String IS_COALESCING = "javax.xml.stream.isCoalescing";
+    public static final java.lang.String IS_NAMESPACE_AWARE = "javax.xml.stream.isNamespaceAware";
+    public static final java.lang.String IS_REPLACING_ENTITY_REFERENCES = "javax.xml.stream.isReplacingEntityReferences";
+    public static final java.lang.String IS_SUPPORTING_EXTERNAL_ENTITIES = "javax.xml.stream.isSupportingExternalEntities";
+    public static final java.lang.String IS_VALIDATING = "javax.xml.stream.isValidating";
+    public static final java.lang.String REPORTER = "javax.xml.stream.reporter";
+    public static final java.lang.String RESOLVER = "javax.xml.stream.resolver";
+    public static final java.lang.String SUPPORT_DTD = "javax.xml.stream.supportDTD";
+
+    protected XMLInputFactory() {
+    }
+
+    public static XMLInputFactory newInstance()
+            throws FactoryConfigurationError {
+        // We'll assume the XMLInputFactory from the RI as a backup.
+        return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory",
+                new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl"
});
+    }
+
+    public static XMLInputFactory newFactory()
+            throws FactoryConfigurationError {
+        // We'll assume the XMLInputFactory from the RI as a backup.
+        return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory",
+                new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl"
});
+    }
+
+
+    /**
+     * Create a new XMLInputFactory
+     *
+     * @deprecated to maintain API consistency.  All newInstance methods are
+     * replaced with corresponding newFactory methods.  The replacement
+     * newFactory(String factoryId, ClassLoader classLoader)
+     * method defines no changes in behavior from this method.
+     */
+    public static XMLInputFactory newInstance(java.lang.String factoryId,
+                                              java.lang.ClassLoader classLoader) throws FactoryConfigurationError
{
+        // We'll assume the XMLInputFactory from the RI as a backup.
+        return (XMLInputFactory)FactoryLocator.locate(factoryId,
+                new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl"
},
+                classLoader);
+    }
+
+
+    public static XMLInputFactory newFactory(java.lang.String factoryId,
+                                             java.lang.ClassLoader classLoader) throws FactoryConfigurationError
{
+        // We'll assume the XMLInputFactory from the RI as a backup.
+        return (XMLInputFactory)FactoryLocator.locate(factoryId,
+                new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl"
},
+                classLoader);
+    }
+
+    public abstract XMLStreamReader createXMLStreamReader(java.io.Reader reader)
+            throws XMLStreamException;
+
+    public abstract XMLStreamReader createXMLStreamReader(
+            javax.xml.transform.Source source) throws XMLStreamException;
+
+    public abstract XMLStreamReader createXMLStreamReader(
+            java.io.InputStream stream) throws XMLStreamException;
+
+    public abstract XMLStreamReader createXMLStreamReader(
+            java.io.InputStream stream, java.lang.String encoding)
+            throws XMLStreamException;
+
+    public abstract XMLStreamReader createXMLStreamReader(
+            java.lang.String systemId, java.io.InputStream stream)
+            throws XMLStreamException;
+
+    public abstract XMLStreamReader createXMLStreamReader(
+            java.lang.String systemId, java.io.Reader reader)
+            throws XMLStreamException;
+
+    public abstract XMLEventReader createXMLEventReader(java.io.Reader reader)
+            throws XMLStreamException;
+
+    public abstract XMLEventReader createXMLEventReader(
+            java.lang.String systemId, java.io.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(
+            java.io.InputStream stream) throws XMLStreamException;
+
+    public abstract XMLEventReader createXMLEventReader(
+            java.io.InputStream stream, java.lang.String encoding)
+            throws XMLStreamException;
+
+    public abstract XMLEventReader createXMLEventReader(
+            java.lang.String systemId, java.io.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(java.lang.String name,
+                                     java.lang.Object value) throws java.lang.IllegalArgumentException;
+
+    public abstract java.lang.Object getProperty(java.lang.String name)
+            throws java.lang.IllegalArgumentException;
+
+    public abstract boolean isPropertySupported(java.lang.String name);
+
+    public abstract void setEventAllocator(XMLEventAllocator allocator);
+
+    public abstract XMLEventAllocator getEventAllocator();
+}
\ No newline at end of file

Added: servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java?rev=1227192&view=auto
==============================================================================
--- servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java
(added)
+++ servicemix/smx4/specs/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java
Wed Jan  4 15:39:58 2012
@@ -0,0 +1,104 @@
+/*
+ **
+ ** 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.
+ */
+package javax.xml.stream;
+
+public abstract class XMLOutputFactory {
+    public static final String IS_REPAIRING_NAMESPACES = "javax.xml.stream.isRepairingNamespaces";
+
+    protected XMLOutputFactory() { }
+
+    public static XMLOutputFactory newInstance() throws FactoryConfigurationError {
+        return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory",
+                new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl"
});
+    }
+
+    /**
+     * Create a new XMLOutputFactory
+     *
+     * @deprecated This method has been deprecated because
+     * it returns an instance of XMLInputFactory, which is of the
+     * wrong class.  Use the new method
+     * newFactory(java.lang.String factoryId,java.lang.ClassLoader classLoader)
+     * instead.
+     */
+    public static XMLInputFactory newInstance(String factoryId,
+                                              java.lang.ClassLoader classLoader) throws FactoryConfigurationError
{
+        return (XMLInputFactory) FactoryLocator.locate(factoryId,
+                new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl"
}, classLoader);
+
+    }
+
+
+    /**
+     * Create a new XMLOutputFactory
+     *
+     * This is the replacement for the deprecated newInstance() method
+     */
+    public static XMLOutputFactory newFactory()	throws FactoryConfigurationError {
+        return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory",
+                new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl"
});
+    }
+
+    /**
+     * Create a new XMLOutputFactory
+     *
+     * This is the replacement for the deprecated newInstance() method
+     */
+    public static XMLOutputFactory newFactory(String factoryId,	ClassLoader classLoader)
+            throws FactoryConfigurationError {
+        // essentially the same thing as deprecated newInstance(), but the correct return
type.
+        return (XMLOutputFactory) FactoryLocator.locate(factoryId,
+                new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl"
}, classLoader);
+    }
+
+    public abstract XMLStreamWriter createXMLStreamWriter(java.io.Writer stream)
+            throws XMLStreamException;
+
+    public abstract XMLStreamWriter createXMLStreamWriter(
+            java.io.OutputStream stream) throws XMLStreamException;
+
+    public abstract XMLStreamWriter createXMLStreamWriter(
+            java.io.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(
+            java.io.OutputStream stream) throws XMLStreamException;
+
+    public abstract XMLEventWriter createXMLEventWriter(
+            java.io.OutputStream stream, String encoding)
+            throws XMLStreamException;
+
+    public abstract XMLEventWriter createXMLEventWriter(java.io.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);
+}
\ No newline at end of file



Mime
View raw message