diff options
Diffstat (limited to 'libjava/classpath/javax/xml')
-rw-r--r-- | libjava/classpath/javax/xml/stream/XMLEventFactory.java | 10 | ||||
-rw-r--r-- | libjava/classpath/javax/xml/stream/XMLInputFactory.java | 7 | ||||
-rw-r--r-- | libjava/classpath/javax/xml/stream/XMLOutputFactory.java | 46 | ||||
-rw-r--r-- | libjava/classpath/javax/xml/stream/events/Namespace.java | 2 | ||||
-rw-r--r-- | libjava/classpath/javax/xml/stream/util/StreamReaderDelegate.java (renamed from libjava/classpath/javax/xml/stream/util/ReaderDelegate.java) | 10 |
5 files changed, 47 insertions, 28 deletions
diff --git a/libjava/classpath/javax/xml/stream/XMLEventFactory.java b/libjava/classpath/javax/xml/stream/XMLEventFactory.java index 30e1607..7e7a981 100644 --- a/libjava/classpath/javax/xml/stream/XMLEventFactory.java +++ b/libjava/classpath/javax/xml/stream/XMLEventFactory.java @@ -1,5 +1,5 @@ /* XMLEventFactory.java -- - Copyright (C) 2005,2006 Free Software Foundation, Inc. + Copyright (C) 2005,2006,2009 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -94,8 +94,14 @@ public abstract class XMLEventFactory * system resource</li> * <li>the default factory class</li> * </ol> + * @param factoryId name of the factory to find, same as a property name + * @param classLoader the class loader to use + * @return the factory implementation + * @exception FactoryConfigurationError if an instance of this factory + * cannot be loaded */ - static XMLEventFactory newInstance(String factoryId, ClassLoader classLoader) + public static XMLEventFactory newInstance(String factoryId, + ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; diff --git a/libjava/classpath/javax/xml/stream/XMLInputFactory.java b/libjava/classpath/javax/xml/stream/XMLInputFactory.java index 437bf83..e57449d7 100644 --- a/libjava/classpath/javax/xml/stream/XMLInputFactory.java +++ b/libjava/classpath/javax/xml/stream/XMLInputFactory.java @@ -1,5 +1,5 @@ /* XMLInputFactory.java -- - Copyright (C) 2005,2006 Free Software Foundation, Inc. + Copyright (C) 2005,2006,2009 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -206,6 +206,11 @@ public abstract class XMLInputFactory * system resource</li> * <li>the default factory class</li> * </ol> + * @param factoryId name of the factory, same as a property name + * @param classLoader the class loader to use + * @return the factory implementation + * @exception FactoryConfigurationError if an instance of this factory + * cannot be loaded */ public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) diff --git a/libjava/classpath/javax/xml/stream/XMLOutputFactory.java b/libjava/classpath/javax/xml/stream/XMLOutputFactory.java index 908f84f..ef89b64 100644 --- a/libjava/classpath/javax/xml/stream/XMLOutputFactory.java +++ b/libjava/classpath/javax/xml/stream/XMLOutputFactory.java @@ -1,5 +1,5 @@ /* XMLOutputFactory.java -- - Copyright (C) 2005,2006 Free Software Foundation, Inc. + Copyright (C) 2005,2006,2009 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -86,6 +86,16 @@ public abstract class XMLOutputFactory /** * Creates a new <b>output</b> factory. + * @see #newInstance(String,ClassLoader) + */ + public static XMLOutputFactory newInstance() + throws FactoryConfigurationError + { + return newInstance(null, null); + } + + /** + * Creates a new <b>output</b> factory. * The implementation class to load is the first found in the following * locations: * <ol> @@ -98,25 +108,35 @@ public abstract class XMLOutputFactory * system resource</li> * <li>the default factory class</li> * </ol> + * @param factoryId the name of the factory, same as the property + * @param classLoader the class loader to use + * @return a new factory instance + * @exception FactoryConfigurationError if an instance of this factory + * could not be loaded */ - public static XMLOutputFactory newInstance() + public static XMLOutputFactory newInstance(String factoryId, + ClassLoader classLoader) throws FactoryConfigurationError { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - if (loader == null) + if (classLoader == null) { - loader = XMLOutputFactory.class.getClassLoader(); + classLoader = Thread.currentThread().getContextClassLoader(); + } + if (classLoader == null) + { + classLoader = XMLOutputFactory.class.getClassLoader(); } String className = null; int count = 0; do { - className = getFactoryClassName(loader, count++); + className = getFactoryClassName(classLoader, count++); if (className != null) { try { - Class<?> t = (loader != null) ? loader.loadClass(className) : + Class<?> t = (classLoader != null) ? + classLoader.loadClass(className) : Class.forName(className); return (XMLOutputFactory) t.newInstance(); } @@ -184,18 +204,6 @@ public abstract class XMLOutputFactory } /** - * Creates a new <b>input</b> factory. - * This appears to be an API design bug. - * @see javax.xml.stream.XMLInputFactory.newInstance(String,ClassLoader) - */ - public static XMLInputFactory newInstance(String factoryId, - ClassLoader classLoader) - throws FactoryConfigurationError - { - return XMLInputFactory.newInstance(factoryId, classLoader); - } - - /** * Creates a new stream writer. */ public abstract XMLStreamWriter createXMLStreamWriter(Writer stream) diff --git a/libjava/classpath/javax/xml/stream/events/Namespace.java b/libjava/classpath/javax/xml/stream/events/Namespace.java index 2275432..13dd92f 100644 --- a/libjava/classpath/javax/xml/stream/events/Namespace.java +++ b/libjava/classpath/javax/xml/stream/events/Namespace.java @@ -41,7 +41,7 @@ package javax.xml.stream.events; * A namespace declaration event. */ public interface Namespace - extends XMLEvent + extends Attribute { /** diff --git a/libjava/classpath/javax/xml/stream/util/ReaderDelegate.java b/libjava/classpath/javax/xml/stream/util/StreamReaderDelegate.java index d502866..1c407a2 100644 --- a/libjava/classpath/javax/xml/stream/util/ReaderDelegate.java +++ b/libjava/classpath/javax/xml/stream/util/StreamReaderDelegate.java @@ -1,5 +1,5 @@ -/* ReaderDelegate.java -- - Copyright (C) 2005,2006 Free Software Foundation, Inc. +/* StreamReaderDelegate.java -- + Copyright (C) 2005,2006,2009 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -47,7 +47,7 @@ import javax.xml.stream.XMLStreamReader; /** * Base class for XML stream reader filters. */ -public class ReaderDelegate +public class StreamReaderDelegate implements XMLStreamReader, XMLStreamConstants { @@ -56,14 +56,14 @@ public class ReaderDelegate /** * Constructs an empty filter with no parent set. */ - public ReaderDelegate() + public StreamReaderDelegate() { } /** * Constructs an empty filter with the specfied parent. */ - public ReaderDelegate(XMLStreamReader reader) + public StreamReaderDelegate(XMLStreamReader reader) { parent = reader; } |