diff options
Diffstat (limited to 'libjava/classpath/external/sax/org/xml/sax')
35 files changed, 2213 insertions, 2215 deletions
diff --git a/libjava/classpath/external/sax/org/xml/sax/AttributeList.java b/libjava/classpath/external/sax/org/xml/sax/AttributeList.java index 7d8e9beec37..cceac8983b9 100644 --- a/libjava/classpath/external/sax/org/xml/sax/AttributeList.java +++ b/libjava/classpath/external/sax/org/xml/sax/AttributeList.java @@ -71,11 +71,11 @@ package org.xml.sax; */ public interface AttributeList { - + //////////////////////////////////////////////////////////////////// // Iteration methods. //////////////////////////////////////////////////////////////////// - + /** * Return the number of attributes in this list. @@ -85,11 +85,11 @@ public interface AttributeList { * declared or specified. The number of attributes may be * zero.</p> * - * @return The number of attributes in the list. + * @return The number of attributes in the list. */ public abstract int getLength (); - - + + /** * Return the name of an attribute in this list (by position). * @@ -104,11 +104,11 @@ public interface AttributeList { * @param i The index of the attribute in the list (starting at 0). * @return The name of the indexed attribute, or null * if the index is out of range. - * @see #getLength + * @see #getLength */ public abstract String getName (int i); - - + + /** * Return the type of an attribute in the list (by position). * @@ -127,12 +127,12 @@ public interface AttributeList { * @param i The index of the attribute in the list (starting at 0). * @return The attribute type as a string, or * null if the index is out of range. - * @see #getLength + * @see #getLength * @see #getType(java.lang.String) */ public abstract String getType (int i); - - + + /** * Return the value of an attribute in the list (by position). * @@ -149,12 +149,12 @@ public interface AttributeList { public abstract String getValue (int i); - + //////////////////////////////////////////////////////////////////// // Lookup methods. //////////////////////////////////////////////////////////////////// - - + + /** * Return the type of an attribute in the list (by name). * @@ -170,8 +170,8 @@ public interface AttributeList { * @see #getType(int) */ public abstract String getType (String name); - - + + /** * Return the value of an attribute in the list (by name). * @@ -187,7 +187,7 @@ public interface AttributeList { * @see #getValue(int) */ public abstract String getValue (String name); - + } // end of AttributeList.java diff --git a/libjava/classpath/external/sax/org/xml/sax/Attributes.java b/libjava/classpath/external/sax/org/xml/sax/Attributes.java index 51735908936..0f3c23682fc 100644 --- a/libjava/classpath/external/sax/org/xml/sax/Attributes.java +++ b/libjava/classpath/external/sax/org/xml/sax/Attributes.java @@ -29,8 +29,8 @@ package org.xml.sax; * <p>The list will not contain attributes that were declared * #IMPLIED but not specified in the start tag. It will also not * contain attributes used as Namespace declarations (xmlns*) unless - * the <code>http://xml.org/sax/features/namespace-prefixes</code> - * feature is set to <var>true</var> (it is <var>false</var> by + * the <code>http://xml.org/sax/features/namespace-prefixes</code> + * feature is set to <var>true</var> (it is <var>false</var> by * default). * Because SAX2 conforms to the original "Namespaces in XML" * recommendation, it normally does not @@ -53,8 +53,8 @@ package org.xml.sax; * available.</p> * * <p>This interface replaces the now-deprecated SAX1 {@link - * org.xml.sax.AttributeList AttributeList} interface, which does not - * contain Namespace support. In addition to Namespace support, it + * org.xml.sax.AttributeList AttributeList} interface, which does not + * contain Namespace support. In addition to Namespace support, it * adds the <var>getIndex</var> methods (below).</p> * * <p>The order of attributes in the list is unspecified, and will @@ -69,7 +69,7 @@ package org.xml.sax; public interface Attributes { - + //////////////////////////////////////////////////////////////////// // Indexed access. //////////////////////////////////////////////////////////////////// @@ -166,7 +166,7 @@ public interface Attributes public abstract String getValue (int index); - + //////////////////////////////////////////////////////////////////// // Name-based query. //////////////////////////////////////////////////////////////////// diff --git a/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java b/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java index c0df614108d..f5f439d78c1 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java +++ b/libjava/classpath/external/sax/org/xml/sax/ContentHandler.java @@ -18,11 +18,11 @@ package org.xml.sax; * </blockquote> * * <p>This is the main interface that most SAX applications - * implement: if the application needs to be informed of basic parsing - * events, it implements this interface and registers an instance with - * the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler - * setContentHandler} method. The parser uses the instance to report - * basic document-related events like the start and end of elements + * implement: if the application needs to be informed of basic parsing + * events, it implements this interface and registers an instance with + * the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler + * setContentHandler} method. The parser uses the instance to report + * basic document-related events like the start and end of elements * and character data.</p> * * <p>The order of events in this interface is very important, and @@ -36,7 +36,7 @@ package org.xml.sax; * and for reporting skipped entities (in non-validating XML * processors).</p> * - * <p>Implementors should note that there is also a + * <p>Implementors should note that there is also a * <code>ContentHandler</code> class in the <code>java.net</code> * package; that means that it's probably a bad idea to do</p> * @@ -92,7 +92,7 @@ public interface ContentHandler * Receive notification of the beginning of a document. * * <p>The SAX parser will invoke this method only once, before any - * other event callbacks (except for {@link #setDocumentLocator + * other event callbacks (except for {@link #setDocumentLocator * setDocumentLocator}).</p> * * @throws org.xml.sax.SAXException any SAX exception, possibly @@ -100,7 +100,7 @@ public interface ContentHandler * @see #endDocument */ public void startDocument () - throws SAXException; + throws SAXException; /** @@ -125,14 +125,14 @@ public interface ContentHandler * @see #startDocument */ public void endDocument() - throws SAXException; + throws SAXException; /** * Begin the scope of a prefix-URI Namespace mapping. * * <p>The information from this event is not necessary for - * normal Namespace processing: the SAX XML reader will + * normal Namespace processing: the SAX XML reader will * automatically replace prefixes for element and attribute * names when the <code>http://xml.org/sax/features/namespaces</code> * feature is <var>true</var> (the default).</p> @@ -147,19 +147,19 @@ public interface ContentHandler * <p>Note that start/endPrefixMapping events are not * guaranteed to be properly nested relative to each other: * all startPrefixMapping events will occur immediately before the - * corresponding {@link #startElement startElement} event, + * corresponding {@link #startElement startElement} event, * and all {@link #endPrefixMapping endPrefixMapping} * events will occur immediately after the corresponding * {@link #endElement endElement} event, - * but their order is not otherwise + * but their order is not otherwise * guaranteed.</p> * * <p>There should never be start/endPrefixMapping events for the * "xml" prefix, since it is predeclared and immutable.</p> * * @param prefix the Namespace prefix being declared. - * An empty string is used for the default element namespace, - * which has no prefix. + * An empty string is used for the default element namespace, + * which has no prefix. * @param uri the Namespace URI the prefix is mapped to * @throws org.xml.sax.SAXException the client may throw * an exception during processing @@ -167,27 +167,27 @@ public interface ContentHandler * @see #startElement */ public void startPrefixMapping (String prefix, String uri) - throws SAXException; + throws SAXException; /** * End the scope of a prefix-URI mapping. * - * <p>See {@link #startPrefixMapping startPrefixMapping} for + * <p>See {@link #startPrefixMapping startPrefixMapping} for * details. These events will always occur immediately after the - * corresponding {@link #endElement endElement} event, but the order of + * corresponding {@link #endElement endElement} event, but the order of * {@link #endPrefixMapping endPrefixMapping} events is not otherwise * guaranteed.</p> * * @param prefix the prefix that was being mapped. - * This is the empty string when a default mapping scope ends. + * This is the empty string when a default mapping scope ends. * @throws org.xml.sax.SAXException the client may throw * an exception during processing * @see #startPrefixMapping * @see #endElement */ public void endPrefixMapping (String prefix) - throws SAXException; + throws SAXException; /** @@ -215,7 +215,7 @@ public interface ContentHandler * properties:</p> * * <ul> - * <li>the Namespace URI and local name are required when + * <li>the Namespace URI and local name are required when * the namespaces property is <var>true</var> (the default), and are * optional when the namespaces property is <var>false</var> (if one is * specified, both must be);</li> @@ -230,7 +230,7 @@ public interface ContentHandler * will contain attributes used for Namespace declarations * (xmlns* attributes) only if the * <code>http://xml.org/sax/features/namespace-prefixes</code> - * property is true (it is false by default, and support for a + * property is true (it is false by default, and support for a * true value is optional).</p> * * <p>Like {@link #characters characters()}, attribute values may have @@ -255,8 +255,8 @@ public interface ContentHandler * @see org.xml.sax.helpers.AttributesImpl */ public void startElement (String uri, String localName, - String qName, Attributes atts) - throws SAXException; + String qName, Attributes atts) + throws SAXException; /** @@ -264,7 +264,7 @@ public interface ContentHandler * * <p>The SAX parser will invoke this method at the end of every * element in the XML document; there will be a corresponding - * {@link #startElement startElement} event for every endElement + * {@link #startElement startElement} event for every endElement * event (even when the element is empty).</p> * * <p>For information on the names, see startElement.</p> @@ -281,8 +281,8 @@ public interface ContentHandler * wrapping another exception */ public void endElement (String uri, String localName, - String qName) - throws SAXException; + String qName) + throws SAXException; /** @@ -317,7 +317,7 @@ public interface ContentHandler * * <p>Note that some parsers will report whitespace in element * content using the {@link #ignorableWhitespace ignorableWhitespace} - * method rather than this one (validating parsers <em>must</em> + * method rather than this one (validating parsers <em>must</em> * do so).</p> * * @param ch the characters from the XML document @@ -325,11 +325,11 @@ public interface ContentHandler * @param length the number of characters to read from the array * @throws org.xml.sax.SAXException any SAX exception, possibly * wrapping another exception - * @see #ignorableWhitespace + * @see #ignorableWhitespace * @see org.xml.sax.Locator */ public void characters (char ch[], int start, int length) - throws SAXException; + throws SAXException; /** @@ -358,7 +358,7 @@ public interface ContentHandler * @see #characters */ public void ignorableWhitespace (char ch[], int start, int length) - throws SAXException; + throws SAXException; /** @@ -384,7 +384,7 @@ public interface ContentHandler * wrapping another exception */ public void processingInstruction (String target, String data) - throws SAXException; + throws SAXException; /** @@ -405,7 +405,7 @@ public interface ContentHandler * <code>http://xml.org/sax/features/external-parameter-entities</code> * properties.</p> * - * @param name the name of the skipped entity. If it is a + * @param name the name of the skipped entity. If it is a * parameter entity, the name will begin with '%', and if * it is the external DTD subset, it will be the string * "[dtd]" @@ -413,7 +413,7 @@ public interface ContentHandler * wrapping another exception */ public void skippedEntity (String name) - throws SAXException; + throws SAXException; } // end of ContentHandler.java diff --git a/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java b/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java index f894298cded..67f5bd6a3a4 100644 --- a/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java +++ b/libjava/classpath/external/sax/org/xml/sax/DTDHandler.java @@ -16,10 +16,10 @@ package org.xml.sax; * </blockquote> * * <p>If a SAX application needs information about notations and - * unparsed entities, then the application implements this - * interface and registers an instance with the SAX parser using - * the parser's setDTDHandler method. The parser uses the - * instance to report notation and unparsed entity declarations to + * unparsed entities, then the application implements this + * interface and registers an instance with the SAX parser using + * the parser's setDTDHandler method. The parser uses the + * instance to report notation and unparsed entity declarations to * the application.</p> * * <p>Note that this interface includes only those DTD events that @@ -35,7 +35,7 @@ package org.xml.sax; * used, these events must also be reported before the endDTD event.) * </p> * - * <p>It is up to the application to store the information for + * <p>It is up to the application to store the information for * future use (perhaps in a hash table or object tree). * If the application encounters attributes of type "NOTATION", * "ENTITY", or "ENTITIES", it can use the information that it @@ -48,8 +48,8 @@ package org.xml.sax; * @see org.xml.sax.XMLReader#setDTDHandler */ public interface DTDHandler { - - + + /** * Receive notification of a notation declaration event. * @@ -78,19 +78,19 @@ public interface DTDHandler { * @see org.xml.sax.Attributes */ public abstract void notationDecl (String name, - String publicId, - String systemId) - throws SAXException; - - + String publicId, + String systemId) + throws SAXException; + + /** * Receive notification of an unparsed entity declaration event. * * <p>Note that the notation name corresponds to a notation - * reported by the {@link #notationDecl notationDecl} event. - * It is up to the application to record the entity for later + * reported by the {@link #notationDecl notationDecl} event. + * It is up to the application to record the entity for later * reference, if necessary; - * unparsed entities may appear as attribute values. + * unparsed entities may appear as attribute values. * </p> * * <p>If the system identifier is a URL, the parser must resolve it @@ -107,11 +107,11 @@ public interface DTDHandler { * @see org.xml.sax.Attributes */ public abstract void unparsedEntityDecl (String name, - String publicId, - String systemId, - String notationName) - throws SAXException; - + String publicId, + String systemId, + String notationName) + throws SAXException; + } // end of DTDHandler.java diff --git a/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java b/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java index 08429b6bcf4..339a0ea657a 100644 --- a/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java +++ b/libjava/classpath/external/sax/org/xml/sax/DocumentHandler.java @@ -45,8 +45,8 @@ package org.xml.sax; * @see org.xml.sax.HandlerBase */ public interface DocumentHandler { - - + + /** * Receive an object for locating the origin of SAX document events. * @@ -73,8 +73,8 @@ public interface DocumentHandler { * @see org.xml.sax.Locator */ public abstract void setDocumentLocator (Locator locator); - - + + /** * Receive notification of the beginning of a document. * @@ -86,9 +86,9 @@ public interface DocumentHandler { * wrapping another exception. */ public abstract void startDocument () - throws SAXException; - - + throws SAXException; + + /** * Receive notification of the end of a document. * @@ -102,9 +102,9 @@ public interface DocumentHandler { * wrapping another exception. */ public abstract void endDocument () - throws SAXException; - - + throws SAXException; + + /** * Receive notification of the beginning of an element. * @@ -125,12 +125,12 @@ public interface DocumentHandler { * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see #endElement - * @see org.xml.sax.AttributeList + * @see org.xml.sax.AttributeList */ public abstract void startElement (String name, AttributeList atts) - throws SAXException; - - + throws SAXException; + + /** * Receive notification of the end of an element. * @@ -147,9 +147,9 @@ public interface DocumentHandler { * wrapping another exception. */ public abstract void endElement (String name) - throws SAXException; - - + throws SAXException; + + /** * Receive notification of character data. * @@ -172,13 +172,13 @@ public interface DocumentHandler { * @param length The number of characters to read from the array. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * @see #ignorableWhitespace + * @see #ignorableWhitespace * @see org.xml.sax.Locator */ public abstract void characters (char ch[], int start, int length) - throws SAXException; - - + throws SAXException; + + /** * Receive notification of ignorable whitespace in element content. * @@ -204,9 +204,9 @@ public interface DocumentHandler { * @see #characters */ public abstract void ignorableWhitespace (char ch[], int start, int length) - throws SAXException; - - + throws SAXException; + + /** * Receive notification of a processing instruction. * @@ -225,8 +225,8 @@ public interface DocumentHandler { * wrapping another exception. */ public abstract void processingInstruction (String target, String data) - throws SAXException; - + throws SAXException; + } // end of DocumentHandler.java diff --git a/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java b/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java index e240ba14b48..f1953d5ba0e 100644 --- a/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java +++ b/libjava/classpath/external/sax/org/xml/sax/EntityResolver.java @@ -67,8 +67,8 @@ import java.io.IOException; * @see org.xml.sax.InputSource */ public interface EntityResolver { - - + + /** * Allow the application to resolve external entities. * @@ -111,9 +111,9 @@ public interface EntityResolver { * @see org.xml.sax.InputSource */ public abstract InputSource resolveEntity (String publicId, - String systemId) - throws SAXException, IOException; - + String systemId) + throws SAXException, IOException; + } // end of EntityResolver.java diff --git a/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java b/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java index 5ebe3926321..b315ec06d39 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java +++ b/libjava/classpath/external/sax/org/xml/sax/ErrorHandler.java @@ -29,12 +29,12 @@ package org.xml.sax; * In order to detect validity errors, an ErrorHandler that does something * with {@link #error error()} calls must be registered.</p> * - * <p>For XML processing errors, a SAX driver must use this interface - * in preference to throwing an exception: it is up to the application - * to decide whether to throw an exception for different types of - * errors and warnings. Note, however, that there is no requirement that - * the parser continue to report additional errors after a call to - * {@link #fatalError fatalError}. In other words, a SAX driver class + * <p>For XML processing errors, a SAX driver must use this interface + * in preference to throwing an exception: it is up to the application + * to decide whether to throw an exception for different types of + * errors and warnings. Note, however, that there is no requirement that + * the parser continue to report additional errors after a call to + * {@link #fatalError fatalError}. In other words, a SAX driver class * may throw an exception after reporting any fatalError. * Also parsers may throw appropriate exceptions for non-XML errors. * For example, {@link XMLReader#parse XMLReader.parse()} would throw @@ -44,11 +44,11 @@ package org.xml.sax; * @author David Megginson * @version 2.0.1+ (sax2r3pre1) * @see org.xml.sax.XMLReader#setErrorHandler - * @see org.xml.sax.SAXParseException + * @see org.xml.sax.SAXParseException */ public interface ErrorHandler { - - + + /** * Receive notification of a warning. * @@ -68,12 +68,12 @@ public interface ErrorHandler { * SAX parse exception. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * @see org.xml.sax.SAXParseException + * @see org.xml.sax.SAXParseException */ public abstract void warning (SAXParseException exception) - throws SAXException; - - + throws SAXException; + + /** * Receive notification of a recoverable error. * @@ -97,12 +97,12 @@ public interface ErrorHandler { * SAX parse exception. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. - * @see org.xml.sax.SAXParseException + * @see org.xml.sax.SAXParseException */ public abstract void error (SAXParseException exception) - throws SAXException; - - + throws SAXException; + + /** * Receive notification of a non-recoverable error. * @@ -126,14 +126,14 @@ public interface ErrorHandler { * other events once this method has been invoked.</p> * * @param exception The error information encapsulated in a - * SAX parse exception. + * SAX parse exception. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.SAXParseException */ public abstract void fatalError (SAXParseException exception) - throws SAXException; - + throws SAXException; + } // end of ErrorHandler.java diff --git a/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java b/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java index 7d6ce73616a..da27249fd50 100644 --- a/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java +++ b/libjava/classpath/external/sax/org/xml/sax/HandlerBase.java @@ -45,12 +45,12 @@ package org.xml.sax; public class HandlerBase implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler { - - + + //////////////////////////////////////////////////////////////////// // Default implementation of the EntityResolver interface. //////////////////////////////////////////////////////////////////// - + /** * Resolve an external entity. * @@ -62,7 +62,7 @@ public class HandlerBase * * @param publicId The public identifer, or null if none is * available. - * @param systemId The system identifier provided in the XML + * @param systemId The system identifier provided in the XML * document. * @return The new input source, or null to require the * default behaviour. @@ -71,18 +71,18 @@ public class HandlerBase * @see org.xml.sax.EntityResolver#resolveEntity */ public InputSource resolveEntity (String publicId, String systemId) - throws SAXException + throws SAXException { - return null; + return null; } - - - + + + //////////////////////////////////////////////////////////////////// // Default implementation of DTDHandler interface. //////////////////////////////////////////////////////////////////// - - + + /** * Receive notification of a notation declaration. * @@ -98,10 +98,10 @@ public class HandlerBase */ public void notationDecl (String name, String publicId, String systemId) { - // no op + // no op } - - + + /** * Receive notification of an unparsed entity declaration. * @@ -117,18 +117,18 @@ public class HandlerBase * @see org.xml.sax.DTDHandler#unparsedEntityDecl */ public void unparsedEntityDecl (String name, String publicId, - String systemId, String notationName) + String systemId, String notationName) { - // no op + // no op } - - - + + + //////////////////////////////////////////////////////////////////// // Default implementation of DocumentHandler interface. //////////////////////////////////////////////////////////////////// - - + + /** * Receive a Locator object for document events. * @@ -142,10 +142,10 @@ public class HandlerBase */ public void setDocumentLocator (Locator locator) { - // no op + // no op } - - + + /** * Receive notification of the beginning of the document. * @@ -159,12 +159,12 @@ public class HandlerBase * @see org.xml.sax.DocumentHandler#startDocument */ public void startDocument () - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of the end of the document. * @@ -178,12 +178,12 @@ public class HandlerBase * @see org.xml.sax.DocumentHandler#endDocument */ public void endDocument () - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of the start of an element. * @@ -199,12 +199,12 @@ public class HandlerBase * @see org.xml.sax.DocumentHandler#startElement */ public void startElement (String name, AttributeList attributes) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of the end of an element. * @@ -219,12 +219,12 @@ public class HandlerBase * @see org.xml.sax.DocumentHandler#endElement */ public void endElement (String name) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of character data inside an element. * @@ -242,12 +242,12 @@ public class HandlerBase * @see org.xml.sax.DocumentHandler#characters */ public void characters (char ch[], int start, int length) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of ignorable whitespace in element content. * @@ -265,12 +265,12 @@ public class HandlerBase * @see org.xml.sax.DocumentHandler#ignorableWhitespace */ public void ignorableWhitespace (char ch[], int start, int length) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of a processing instruction. * @@ -287,18 +287,18 @@ public class HandlerBase * @see org.xml.sax.DocumentHandler#processingInstruction */ public void processingInstruction (String target, String data) - throws SAXException + throws SAXException { - // no op + // no op } - - - + + + //////////////////////////////////////////////////////////////////// // Default implementation of the ErrorHandler interface. //////////////////////////////////////////////////////////////////// - - + + /** * Receive notification of a parser warning. * @@ -314,12 +314,12 @@ public class HandlerBase * @see org.xml.sax.SAXParseException */ public void warning (SAXParseException e) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of a recoverable parser error. * @@ -335,12 +335,12 @@ public class HandlerBase * @see org.xml.sax.SAXParseException */ public void error (SAXParseException e) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Report a fatal XML parsing error. * @@ -359,11 +359,11 @@ public class HandlerBase * @see org.xml.sax.SAXParseException */ public void fatalError (SAXParseException e) - throws SAXException + throws SAXException { - throw e; + throw e; } - + } // end of HandlerBase.java diff --git a/libjava/classpath/external/sax/org/xml/sax/InputSource.java b/libjava/classpath/external/sax/org/xml/sax/InputSource.java index 3737b63712d..b5474921c3e 100644 --- a/libjava/classpath/external/sax/org/xml/sax/InputSource.java +++ b/libjava/classpath/external/sax/org/xml/sax/InputSource.java @@ -43,7 +43,7 @@ import java.io.InputStream; * identifier.</p> * * <p>An InputSource object belongs to the application: the SAX parser - * shall never modify it in any way (it may modify a copy if + * shall never modify it in any way (it may modify a copy if * necessary). However, standard processing of both byte and * character streams is to close them on as part of end-of-parse cleanup, * so applications should not attempt to re-use such streams after they @@ -58,7 +58,7 @@ import java.io.InputStream; * @see java.io.Reader */ public class InputSource { - + /** * Zero-argument default constructor. * @@ -71,12 +71,12 @@ public class InputSource { public InputSource () { } - - + + /** * Create a new input source with a system identifier. * - * <p>Applications may use setPublicId to include a + * <p>Applications may use setPublicId to include a * public identifier as well, or setEncoding to specify * the character encoding, if known.</p> * @@ -92,15 +92,15 @@ public class InputSource { */ public InputSource (String systemId) { - setSystemId(systemId); + setSystemId(systemId); } - - + + /** * Create a new input source with a byte stream. * - * <p>Application writers should use setSystemId() to provide a base - * for resolving relative URIs, may use setPublicId to include a + * <p>Application writers should use setSystemId() to provide a base + * for resolving relative URIs, may use setPublicId to include a * public identifier, and may use setEncoding to specify the object's * character encoding.</p> * @@ -113,15 +113,15 @@ public class InputSource { */ public InputSource (InputStream byteStream) { - setByteStream(byteStream); + setByteStream(byteStream); } - - + + /** * Create a new input source with a character stream. * - * <p>Application writers should use setSystemId() to provide a base - * for resolving relative URIs, and may use setPublicId to include a + * <p>Application writers should use setSystemId() to provide a base + * for resolving relative URIs, and may use setPublicId to include a * public identifier.</p> * * <p>The character stream shall not include a byte order mark.</p> @@ -133,10 +133,10 @@ public class InputSource { */ public InputSource (Reader characterStream) { - setCharacterStream(characterStream); + setCharacterStream(characterStream); } - - + + /** * Set the public identifier for this input source. * @@ -151,10 +151,10 @@ public class InputSource { */ public void setPublicId (String publicId) { - this.publicId = publicId; + this.publicId = publicId; } - - + + /** * Get the public identifier for this input source. * @@ -163,10 +163,10 @@ public class InputSource { */ public String getPublicId () { - return publicId; + return publicId; } - - + + /** * Set the system identifier for this input source. * @@ -192,10 +192,10 @@ public class InputSource { */ public void setSystemId (String systemId) { - this.systemId = systemId; + this.systemId = systemId; } - - + + /** * Get the system identifier for this input source. * @@ -210,10 +210,10 @@ public class InputSource { */ public String getSystemId () { - return systemId; + return systemId; } - - + + /** * Set the byte stream for this input source. * @@ -233,10 +233,10 @@ public class InputSource { */ public void setByteStream (InputStream byteStream) { - this.byteStream = byteStream; + this.byteStream = byteStream; } - - + + /** * Get the byte stream for this input source. * @@ -249,11 +249,11 @@ public class InputSource { */ public InputStream getByteStream () { - return byteStream; + return byteStream; } - - - /** + + + /** * Set the character encoding, if known. * * <p>The encoding must be a string acceptable for an @@ -270,10 +270,10 @@ public class InputSource { */ public void setEncoding (String encoding) { - this.encoding = encoding; + this.encoding = encoding; } - - + + /** * Get the character encoding for a byte stream or URI. * This value will be ignored when the application provides a @@ -286,10 +286,10 @@ public class InputSource { */ public String getEncoding () { - return encoding; + return encoding; } - - + + /** * Set the character stream for this input source. * @@ -304,10 +304,10 @@ public class InputSource { */ public void setCharacterStream (Reader characterStream) { - this.characterStream = characterStream; + this.characterStream = characterStream; } - - + + /** * Get the character stream for this input source. * @@ -316,21 +316,21 @@ public class InputSource { */ public Reader getCharacterStream () { - return characterStream; + return characterStream; } - - - + + + //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// - + private String publicId; private String systemId; private InputStream byteStream; private String encoding; private Reader characterStream; - + } // end of InputSource.java diff --git a/libjava/classpath/external/sax/org/xml/sax/Locator.java b/libjava/classpath/external/sax/org/xml/sax/Locator.java index 63947df7ac7..910f0d294fa 100644 --- a/libjava/classpath/external/sax/org/xml/sax/Locator.java +++ b/libjava/classpath/external/sax/org/xml/sax/Locator.java @@ -34,17 +34,17 @@ package org.xml.sax; * locator, it must do so before reporting any other document events. * If no locator has been set by the time the application receives * the {@link org.xml.sax.ContentHandler#startDocument startDocument} - * event, the application should assume that a locator is not + * event, the application should assume that a locator is not * available.</p> * * @since SAX 1.0 * @author David Megginson * @version 2.0.1 (sax2r2) - * @see org.xml.sax.ContentHandler#setDocumentLocator + * @see org.xml.sax.ContentHandler#setDocumentLocator */ public interface Locator { - - + + /** * Return the public identifier for the current document event. * @@ -57,8 +57,8 @@ public interface Locator { * @see #getSystemId */ public abstract String getPublicId (); - - + + /** * Return the system identifier for the current document event. * @@ -76,8 +76,8 @@ public interface Locator { * @see #getPublicId */ public abstract String getSystemId (); - - + + /** * Return the line number where the current document event ends. * Lines are delimited by line ends, which are defined in @@ -95,16 +95,16 @@ public interface Locator { * in the document entity or external parsed entity where the * markup triggering the event appears.</p> * - * <p>If possible, the SAX driver should provide the line position - * of the first character after the text associated with the document + * <p>If possible, the SAX driver should provide the line position + * of the first character after the text associated with the document * event. The first line is line 1.</p> * * @return The line number, or -1 if none is available. * @see #getColumnNumber */ public abstract int getLineNumber (); - - + + /** * Return the column number where the current document event ends. * This is one-based number of Java <code>char</code> values since @@ -122,15 +122,15 @@ public interface Locator { * in the document entity or external parsed entity where the * markup triggering the event appears.</p> * - * <p>If possible, the SAX driver should provide the line position - * of the first character after the text associated with the document + * <p>If possible, the SAX driver should provide the line position + * of the first character after the text associated with the document * event. The first column in each line is column 1.</p> * * @return The column number, or -1 if none is available. * @see #getLineNumber */ public abstract int getColumnNumber (); - + } // end of Locator.java diff --git a/libjava/classpath/external/sax/org/xml/sax/Parser.java b/libjava/classpath/external/sax/org/xml/sax/Parser.java index 5866eb09ce1..994648897ba 100644 --- a/libjava/classpath/external/sax/org/xml/sax/Parser.java +++ b/libjava/classpath/external/sax/org/xml/sax/Parser.java @@ -49,9 +49,9 @@ import java.util.Locale; * @see org.xml.sax.HandlerBase * @see org.xml.sax.InputSource */ -public interface Parser +public interface Parser { - + /** * Allow an application to request a locale for errors and warnings. * @@ -62,15 +62,15 @@ public interface Parser * * @param locale A Java Locale object. * @exception org.xml.sax.SAXException Throws an exception - * (using the previous or default locale) if the + * (using the previous or default locale) if the * requested locale is not supported. * @see org.xml.sax.SAXException * @see org.xml.sax.SAXParseException */ public abstract void setLocale (Locale locale) - throws SAXException; - - + throws SAXException; + + /** * Allow an application to register a custom entity resolver. * @@ -88,8 +88,8 @@ public interface Parser * @see HandlerBase */ public abstract void setEntityResolver (EntityResolver resolver); - - + + /** * Allow an application to register a DTD event handler. * @@ -107,8 +107,8 @@ public interface Parser * @see HandlerBase */ public abstract void setDTDHandler (DTDHandler handler); - - + + /** * Allow an application to register a document event handler. * @@ -126,8 +126,8 @@ public interface Parser * @see HandlerBase */ public abstract void setDocumentHandler (DocumentHandler handler); - - + + /** * Allow an application to register an error event handler. * @@ -146,8 +146,8 @@ public interface Parser * @see HandlerBase */ public abstract void setErrorHandler (ErrorHandler handler); - - + + /** * Parse an XML document. * @@ -176,9 +176,9 @@ public interface Parser * @see #setErrorHandler */ public abstract void parse (InputSource source) - throws SAXException, IOException; - - + throws SAXException, IOException; + + /** * Parse an XML document from a system identifier (URI). * @@ -202,8 +202,8 @@ public interface Parser * @see #parse(org.xml.sax.InputSource) */ public abstract void parse (String systemId) - throws SAXException, IOException; - + throws SAXException, IOException; + } // end of Parser.java diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXException.java b/libjava/classpath/external/sax/org/xml/sax/SAXException.java index b3c23e9aedb..f8691bc575e 100644 --- a/libjava/classpath/external/sax/org/xml/sax/SAXException.java +++ b/libjava/classpath/external/sax/org/xml/sax/SAXException.java @@ -42,22 +42,22 @@ public class SAXException extends Exception { */ public SAXException () { - super(); - this.exception = null; + super(); + this.exception = null; } - - + + /** * Create a new SAXException. * * @param message The error or warning message. */ public SAXException (String message) { - super(message); - this.exception = null; + super(message); + this.exception = null; } - - + + /** * Create a new SAXException wrapping an existing exception. * @@ -69,11 +69,11 @@ public class SAXException extends Exception { */ public SAXException (Exception e) { - super(); - this.exception = e; + super(); + this.exception = e; } - - + + /** * Create a new SAXException from an existing exception. * @@ -85,11 +85,11 @@ public class SAXException extends Exception { */ public SAXException (String message, Exception e) { - super(message); - this.exception = e; + super(message); + this.exception = e; } - - + + /** * Return a detail message for this exception. * @@ -101,16 +101,16 @@ public class SAXException extends Exception { */ public String getMessage () { - String message = super.getMessage(); - - if (message == null && exception != null) { - return exception.getMessage(); - } else { - return message; - } + String message = super.getMessage(); + + if (message == null && exception != null) { + return exception.getMessage(); + } else { + return message; + } } - - + + /** * Return the embedded exception, if any. * @@ -118,7 +118,7 @@ public class SAXException extends Exception { */ public Exception getException () { - return exception; + return exception; } @@ -129,15 +129,15 @@ public class SAXException extends Exception { */ public String toString () { - if (exception != null) { - return exception.toString(); - } else { - return super.toString(); - } + if (exception != null) { + return exception.toString(); + } else { + return super.toString(); + } } - - - + + + ////////////////////////////////////////////////////////////////////// // Internal state. ////////////////////////////////////////////////////////////////////// @@ -145,9 +145,9 @@ public class SAXException extends Exception { /** * @serial The embedded exception if tunnelling, or null. - */ + */ private Exception exception; - + } // end of SAXException.java diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java b/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java index dc411b105ce..b512288ec74 100644 --- a/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java +++ b/libjava/classpath/external/sax/org/xml/sax/SAXNotRecognizedException.java @@ -34,7 +34,7 @@ public class SAXNotRecognizedException extends SAXException */ public SAXNotRecognizedException () { - super(); + super(); } @@ -45,7 +45,7 @@ public class SAXNotRecognizedException extends SAXException */ public SAXNotRecognizedException (String message) { - super(message); + super(message); } } diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java b/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java index 232ce8026de..e59fd40e0f2 100644 --- a/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java +++ b/libjava/classpath/external/sax/org/xml/sax/SAXNotSupportedException.java @@ -24,7 +24,7 @@ package org.xml.sax; * @since SAX 2.0 * @author David Megginson * @version 2.0.1 (sax2r2) - * @see org.xml.sax.SAXNotRecognizedException + * @see org.xml.sax.SAXNotRecognizedException */ public class SAXNotSupportedException extends SAXException { @@ -34,7 +34,7 @@ public class SAXNotSupportedException extends SAXException */ public SAXNotSupportedException () { - super(); + super(); } @@ -45,7 +45,7 @@ public class SAXNotSupportedException extends SAXException */ public SAXNotSupportedException (String message) { - super(message); + super(message); } } diff --git a/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java b/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java index c49ff095be3..0921be76241 100644 --- a/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java +++ b/libjava/classpath/external/sax/org/xml/sax/SAXParseException.java @@ -19,12 +19,12 @@ package org.xml.sax; * in the original XML document, as if it came from a {@link Locator} * object. Note that although the application * will receive a SAXParseException as the argument to the handlers - * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface, - * the application is not actually required to throw the exception; - * instead, it can simply read the information in it and take a + * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface, + * the application is not actually required to throw the exception; + * instead, it can simply read the information in it and take a * different action.</p> * - * <p>Since this exception is a subclass of {@link org.xml.sax.SAXException + * <p>Since this exception is a subclass of {@link org.xml.sax.SAXException * SAXException}, it inherits the ability to wrap another exception.</p> * * @since SAX 1.0 @@ -35,8 +35,8 @@ package org.xml.sax; * @see org.xml.sax.ErrorHandler */ public class SAXParseException extends SAXException { - - + + ////////////////////////////////////////////////////////////////////// // Constructors. ////////////////////////////////////////////////////////////////////// @@ -55,16 +55,16 @@ public class SAXParseException extends SAXException { * @see org.xml.sax.Locator */ public SAXParseException (String message, Locator locator) { - super(message); - if (locator != null) { - init(locator.getPublicId(), locator.getSystemId(), - locator.getLineNumber(), locator.getColumnNumber()); - } else { - init(null, null, -1, -1); - } + super(message); + if (locator != null) { + init(locator.getPublicId(), locator.getSystemId(), + locator.getLineNumber(), locator.getColumnNumber()); + } else { + init(null, null, -1, -1); + } } - - + + /** * Wrap an existing exception in a SAXParseException. * @@ -81,17 +81,17 @@ public class SAXParseException extends SAXException { * @see org.xml.sax.Locator */ public SAXParseException (String message, Locator locator, - Exception e) { - super(message, e); - if (locator != null) { - init(locator.getPublicId(), locator.getSystemId(), - locator.getLineNumber(), locator.getColumnNumber()); - } else { - init(null, null, -1, -1); - } + Exception e) { + super(message, e); + if (locator != null) { + init(locator.getPublicId(), locator.getSystemId(), + locator.getLineNumber(), locator.getColumnNumber()); + } else { + init(null, null, -1, -1); + } } - - + + /** * Create a new SAXParseException. * @@ -114,13 +114,13 @@ public class SAXParseException extends SAXException { * cause the error or warning. */ public SAXParseException (String message, String publicId, String systemId, - int lineNumber, int columnNumber) + int lineNumber, int columnNumber) { - super(message); - init(publicId, systemId, lineNumber, columnNumber); + super(message); + init(publicId, systemId, lineNumber, columnNumber); } - - + + /** * Create a new SAXParseException with an embedded exception. * @@ -146,10 +146,10 @@ public class SAXParseException extends SAXException { * @param e Another exception to embed in this one. */ public SAXParseException (String message, String publicId, String systemId, - int lineNumber, int columnNumber, Exception e) + int lineNumber, int columnNumber, Exception e) { - super(message, e); - init(publicId, systemId, lineNumber, columnNumber); + super(message, e); + init(publicId, systemId, lineNumber, columnNumber); } @@ -164,15 +164,15 @@ public class SAXParseException extends SAXException { * @param columnNumber The column number of the error, or -1. */ private void init (String publicId, String systemId, - int lineNumber, int columnNumber) + int lineNumber, int columnNumber) { - this.publicId = publicId; - this.systemId = systemId; - this.lineNumber = lineNumber; - this.columnNumber = columnNumber; + this.publicId = publicId; + this.systemId = systemId; + this.lineNumber = lineNumber; + this.columnNumber = columnNumber; } - - + + /** * Get the public identifier of the entity where the exception occurred. * @@ -182,10 +182,10 @@ public class SAXParseException extends SAXException { */ public String getPublicId () { - return this.publicId; + return this.publicId; } - - + + /** * Get the system identifier of the entity where the exception occurred. * @@ -198,10 +198,10 @@ public class SAXParseException extends SAXException { */ public String getSystemId () { - return this.systemId; + return this.systemId; } - - + + /** * The line number of the end of the text where the exception occurred. * @@ -213,10 +213,10 @@ public class SAXParseException extends SAXException { */ public int getLineNumber () { - return this.lineNumber; + return this.lineNumber; } - - + + /** * The column number of the end of the text where the exception occurred. * @@ -228,10 +228,10 @@ public class SAXParseException extends SAXException { */ public int getColumnNumber () { - return this.columnNumber; + return this.columnNumber; } - - + + ////////////////////////////////////////////////////////////////////// // Internal state. ////////////////////////////////////////////////////////////////////// @@ -240,7 +240,7 @@ public class SAXParseException extends SAXException { /** * @serial The public identifier, or null. * @see #getPublicId - */ + */ private String publicId; @@ -263,7 +263,7 @@ public class SAXParseException extends SAXException { * @see #getColumnNumber */ private int columnNumber; - + } // end of SAXParseException.java diff --git a/libjava/classpath/external/sax/org/xml/sax/XMLReader.java b/libjava/classpath/external/sax/org/xml/sax/XMLReader.java index 92d0a94e3d1..d334f03fbfd 100644 --- a/libjava/classpath/external/sax/org/xml/sax/XMLReader.java +++ b/libjava/classpath/external/sax/org/xml/sax/XMLReader.java @@ -19,9 +19,9 @@ import java.io.IOException; * for further information. * </blockquote> * - * <p><strong>Note:</strong> despite its name, this interface does - * <em>not</em> extend the standard Java {@link java.io.Reader Reader} - * interface, because reading XML is a fundamentally different activity + * <p><strong>Note:</strong> despite its name, this interface does + * <em>not</em> extend the standard Java {@link java.io.Reader Reader} + * interface, because reading XML is a fundamentally different activity * than reading character data.</p> * * <p>XMLReader is the interface that an XML parser's SAX2 driver must @@ -41,7 +41,7 @@ import java.io.IOException; * interface (as well as some minor ones):</p> * * <ol> - * <li>it adds a standard way to query and set features and + * <li>it adds a standard way to query and set features and * properties; and</li> * <li>it adds Namespace support, which is required for many * higher-level XML standards.</li> @@ -55,12 +55,12 @@ import java.io.IOException; * @version 2.0.1+ (sax2r3pre1) * @see org.xml.sax.XMLFilter * @see org.xml.sax.helpers.ParserAdapter - * @see org.xml.sax.helpers.XMLReaderAdapter + * @see org.xml.sax.helpers.XMLReaderAdapter */ public interface XMLReader { - + //////////////////////////////////////////////////////////////////// // Configuration. //////////////////////////////////////////////////////////////////// @@ -93,7 +93,7 @@ public interface XMLReader * try { * r.setFeature("http://xml.org/sax/features/validation", true); * } catch (SAXException e) { - * System.err.println("Cannot activate validation."); + * System.err.println("Cannot activate validation."); * } * * // register event handlers @@ -118,7 +118,7 @@ public interface XMLReader * @exception org.xml.sax.SAXNotRecognizedException If the feature * value can't be assigned or retrieved. * @exception org.xml.sax.SAXNotSupportedException When the - * XMLReader recognizes the feature name but + * XMLReader recognizes the feature name but * cannot determine its value at this time. * @see #setFeature */ @@ -132,8 +132,8 @@ public interface XMLReader * <p>The feature name is any fully-qualified URI. It is * possible for an XMLReader to expose a feature value but * to be unable to change the current value. - * Some feature values may be immutable or mutable only - * in specific contexts, such as before, during, or after + * Some feature values may be immutable or mutable only + * in specific contexts, such as before, during, or after * a parse.</p> * * <p>All XMLReaders are required to support setting @@ -145,12 +145,12 @@ public interface XMLReader * @exception org.xml.sax.SAXNotRecognizedException If the feature * value can't be assigned or retrieved. * @exception org.xml.sax.SAXNotSupportedException When the - * XMLReader recognizes the feature name but + * XMLReader recognizes the feature name but * cannot set the requested value. * @see #getFeature */ public void setFeature (String name, boolean value) - throws SAXNotRecognizedException, SAXNotSupportedException; + throws SAXNotRecognizedException, SAXNotSupportedException; /** @@ -174,12 +174,12 @@ public interface XMLReader * @exception org.xml.sax.SAXNotRecognizedException If the property * value can't be assigned or retrieved. * @exception org.xml.sax.SAXNotSupportedException When the - * XMLReader recognizes the property name but + * XMLReader recognizes the property name but * cannot determine its value at this time. * @see #setProperty */ public Object getProperty (String name) - throws SAXNotRecognizedException, SAXNotSupportedException; + throws SAXNotRecognizedException, SAXNotSupportedException; /** @@ -188,12 +188,12 @@ public interface XMLReader * <p>The property name is any fully-qualified URI. It is * possible for an XMLReader to recognize a property name but * to be unable to change the current value. - * Some property values may be immutable or mutable only - * in specific contexts, such as before, during, or after + * Some property values may be immutable or mutable only + * in specific contexts, such as before, during, or after * a parse.</p> * * <p>XMLReaders are not required to recognize setting - * any specific property names, though a core set is defined by + * any specific property names, though a core set is defined by * SAX2.</p> * * <p>This method is also the standard mechanism for setting @@ -204,14 +204,14 @@ public interface XMLReader * @exception org.xml.sax.SAXNotRecognizedException If the property * value can't be assigned or retrieved. * @exception org.xml.sax.SAXNotSupportedException When the - * XMLReader recognizes the property name but + * XMLReader recognizes the property name but * cannot set the requested value. */ public void setProperty (String name, Object value) - throws SAXNotRecognizedException, SAXNotSupportedException; + throws SAXNotRecognizedException, SAXNotSupportedException; + - //////////////////////////////////////////////////////////////////// // Event handlers. //////////////////////////////////////////////////////////////////// @@ -325,7 +325,7 @@ public interface XMLReader public ErrorHandler getErrorHandler (); - + //////////////////////////////////////////////////////////////////// // Parsing. //////////////////////////////////////////////////////////////////// @@ -355,7 +355,7 @@ public interface XMLReader * handlers.</p> * * <p>This method is synchronous: it will not return until parsing - * has ended. If a client application wants to terminate + * has ended. If a client application wants to terminate * parsing early, it should throw an exception.</p> * * @param input The input source for the top-level of the @@ -370,10 +370,10 @@ public interface XMLReader * @see #setEntityResolver * @see #setDTDHandler * @see #setContentHandler - * @see #setErrorHandler + * @see #setErrorHandler */ public void parse (InputSource input) - throws IOException, SAXException; + throws IOException, SAXException; /** @@ -399,6 +399,6 @@ public interface XMLReader * @see #parse(org.xml.sax.InputSource) */ public void parse (String systemId) - throws IOException, SAXException; + throws IOException, SAXException; } diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java index 5c839bd1acf..a814d9de31b 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2.java @@ -46,7 +46,7 @@ public interface Attributes2 extends Attributes * * @param index The attribute index (zero-based). * @return true if the attribute was declared in the DTD, - * false otherwise. + * false otherwise. * @exception java.lang.ArrayIndexOutOfBoundsException When the * supplied index does not identify an attribute. */ @@ -60,7 +60,7 @@ public interface Attributes2 extends Attributes * * @param qName The XML qualified (prefixed) name. * @return true if the attribute was declared in the DTD, - * false otherwise. + * false otherwise. * @exception java.lang.IllegalArgumentException When the * supplied name does not identify an attribute. */ @@ -81,7 +81,7 @@ public interface Attributes2 extends Attributes * the name has no Namespace URI. * @param localName The attribute's local name. * @return true if the attribute was declared in the DTD, - * false otherwise. + * false otherwise. * @exception java.lang.IllegalArgumentException When the * supplied names do not identify an attribute. */ @@ -93,7 +93,7 @@ public interface Attributes2 extends Attributes * * @param index The attribute index (zero-based). * @return true if the value was found in the XML text, - * false if the value was provided by DTD defaulting. + * false if the value was provided by DTD defaulting. * @exception java.lang.ArrayIndexOutOfBoundsException When the * supplied index does not identify an attribute. */ @@ -112,7 +112,7 @@ public interface Attributes2 extends Attributes * the name has no Namespace URI. * @param localName The attribute's local name. * @return true if the value was found in the XML text, - * false if the value was provided by DTD defaulting. + * false if the value was provided by DTD defaulting. * @exception java.lang.IllegalArgumentException When the * supplied names do not identify an attribute. */ @@ -124,7 +124,7 @@ public interface Attributes2 extends Attributes * * @param qName The XML qualified (prefixed) name. * @return true if the value was found in the XML text, - * false if the value was provided by DTD defaulting. + * false if the value was provided by DTD defaulting. * @exception java.lang.IllegalArgumentException When the * supplied name does not identify an attribute. */ diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java index 485a5d6ac44..08225593307 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/Attributes2Impl.java @@ -28,7 +28,7 @@ import org.xml.sax.helpers.AttributesImpl; * is false), non-CDATA attributes, or when it is set to true using * {@link #setDeclared}. * If you change an attribute's type by hand, you may need to modify - * its <em>declared</em> flag to match. + * its <em>declared</em> flag to match. * </p> * * @since SAX 2.0 (extensions 1.1 alpha) @@ -37,8 +37,8 @@ import org.xml.sax.helpers.AttributesImpl; */ public class Attributes2Impl extends AttributesImpl implements Attributes2 { - private boolean declared []; - private boolean specified []; + private boolean declared []; + private boolean specified []; /** @@ -63,7 +63,7 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 */ public Attributes2Impl (Attributes atts) { - super (atts); + super (atts); } @@ -78,10 +78,10 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 // javadoc mostly from interface public boolean isDeclared (int index) { - if (index < 0 || index >= getLength ()) - throw new ArrayIndexOutOfBoundsException ( - "No attribute at index: " + index); - return declared [index]; + if (index < 0 || index >= getLength ()) + throw new ArrayIndexOutOfBoundsException ( + "No attribute at index: " + index); + return declared [index]; } @@ -91,13 +91,13 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 // javadoc mostly from interface public boolean isDeclared (String uri, String localName) { - int index = getIndex (uri, localName); + int index = getIndex (uri, localName); - if (index < 0) - throw new IllegalArgumentException ( - "No such attribute: local=" + localName - + ", namespace=" + uri); - return declared [index]; + if (index < 0) + throw new IllegalArgumentException ( + "No such attribute: local=" + localName + + ", namespace=" + uri); + return declared [index]; } @@ -107,12 +107,12 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 // javadoc mostly from interface public boolean isDeclared (String qName) { - int index = getIndex (qName); + int index = getIndex (qName); - if (index < 0) - throw new IllegalArgumentException ( - "No such attribute: " + qName); - return declared [index]; + if (index < 0) + throw new IllegalArgumentException ( + "No such attribute: " + qName); + return declared [index]; } @@ -126,10 +126,10 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 */ public boolean isSpecified (int index) { - if (index < 0 || index >= getLength ()) - throw new ArrayIndexOutOfBoundsException ( - "No attribute at index: " + index); - return specified [index]; + if (index < 0 || index >= getLength ()) + throw new ArrayIndexOutOfBoundsException ( + "No attribute at index: " + index); + return specified [index]; } @@ -145,13 +145,13 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 */ public boolean isSpecified (String uri, String localName) { - int index = getIndex (uri, localName); + int index = getIndex (uri, localName); - if (index < 0) - throw new IllegalArgumentException ( - "No such attribute: local=" + localName - + ", namespace=" + uri); - return specified [index]; + if (index < 0) + throw new IllegalArgumentException ( + "No such attribute: local=" + localName + + ", namespace=" + uri); + return specified [index]; } @@ -165,12 +165,12 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 */ public boolean isSpecified (String qName) { - int index = getIndex (qName); + int index = getIndex (qName); - if (index < 0) - throw new IllegalArgumentException ( - "No such attribute: " + qName); - return specified [index]; + if (index < 0) + throw new IllegalArgumentException ( + "No such attribute: " + qName); + return specified [index]; } @@ -190,24 +190,24 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 */ public void setAttributes (Attributes atts) { - int length = atts.getLength (); - - super.setAttributes (atts); - declared = new boolean [length]; - specified = new boolean [length]; - - if (atts instanceof Attributes2) { - Attributes2 a2 = (Attributes2) atts; - for (int i = 0; i < length; i++) { - declared [i] = a2.isDeclared (i); - specified [i] = a2.isSpecified (i); - } - } else { - for (int i = 0; i < length; i++) { - declared [i] = !"CDATA".equals (atts.getType (i)); - specified [i] = true; - } - } + int length = atts.getLength (); + + super.setAttributes (atts); + declared = new boolean [length]; + specified = new boolean [length]; + + if (atts instanceof Attributes2) { + Attributes2 a2 = (Attributes2) atts; + for (int i = 0; i < length; i++) { + declared [i] = a2.isDeclared (i); + specified [i] = a2.isSpecified (i); + } + } else { + for (int i = 0; i < length; i++) { + declared [i] = !"CDATA".equals (atts.getType (i)); + specified [i] = true; + } + } } @@ -223,41 +223,41 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 * @see AttributesImpl#addAttribute */ public void addAttribute (String uri, String localName, String qName, - String type, String value) + String type, String value) { - super.addAttribute (uri, localName, qName, type, value); + super.addAttribute (uri, localName, qName, type, value); - int length = getLength (); + int length = getLength (); - if (length < specified.length) { - boolean newFlags []; + if (length < specified.length) { + boolean newFlags []; - newFlags = new boolean [length]; - System.arraycopy (declared, 0, newFlags, 0, declared.length); - declared = newFlags; + newFlags = new boolean [length]; + System.arraycopy (declared, 0, newFlags, 0, declared.length); + declared = newFlags; - newFlags = new boolean [length]; - System.arraycopy (specified, 0, newFlags, 0, specified.length); - specified = newFlags; - } + newFlags = new boolean [length]; + System.arraycopy (specified, 0, newFlags, 0, specified.length); + specified = newFlags; + } - specified [length - 1] = true; - declared [length - 1] = !"CDATA".equals (type); + specified [length - 1] = true; + declared [length - 1] = !"CDATA".equals (type); } // javadoc entirely from superclass public void removeAttribute (int index) { - int origMax = getLength () - 1; - - super.removeAttribute (index); - if (index != origMax) { - System.arraycopy (declared, index + 1, declared, index, - origMax - index); - System.arraycopy (specified, index + 1, specified, index, - origMax - index); - } + int origMax = getLength () - 1; + + super.removeAttribute (index); + if (index != origMax) { + System.arraycopy (declared, index + 1, declared, index, + origMax - index); + System.arraycopy (specified, index + 1, specified, index, + origMax - index); + } } @@ -274,10 +274,10 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 */ public void setDeclared (int index, boolean value) { - if (index < 0 || index >= getLength ()) - throw new ArrayIndexOutOfBoundsException ( - "No attribute at index: " + index); - declared [index] = value; + if (index < 0 || index >= getLength ()) + throw new ArrayIndexOutOfBoundsException ( + "No attribute at index: " + index); + declared [index] = value; } @@ -293,9 +293,9 @@ public class Attributes2Impl extends AttributesImpl implements Attributes2 */ public void setSpecified (int index, boolean value) { - if (index < 0 || index >= getLength ()) - throw new ArrayIndexOutOfBoundsException ( - "No attribute at index: " + index); - specified [index] = value; + if (index < 0 || index >= getLength ()) + throw new ArrayIndexOutOfBoundsException ( + "No attribute at index: " + index); + specified [index] = value; } } diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java b/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java index 1bb4dea4a41..42d92269f6f 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/DeclHandler.java @@ -54,9 +54,9 @@ public interface DeclHandler * <p>The content model will consist of the string "EMPTY", the * string "ANY", or a parenthesised group, optionally followed * by an occurrence indicator. The model will be normalized so - * that all parameter entities are fully resolved and all whitespace + * that all parameter entities are fully resolved and all whitespace * is removed,and will include the enclosing parentheses. Other - * normalization (such as removing redundant parentheses or + * normalization (such as removing redundant parentheses or * simplifying occurrence indicators) is at the discretion of the * parser.</p> * @@ -65,7 +65,7 @@ public interface DeclHandler * @exception SAXException The application may raise an exception. */ public abstract void elementDecl (String name, String model) - throws SAXException; + throws SAXException; /** @@ -74,7 +74,7 @@ public interface DeclHandler * <p>Only the effective (first) declaration for an attribute will * be reported. The type will be one of the strings "CDATA", * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", - * "ENTITIES", a parenthesized token group with + * "ENTITIES", a parenthesized token group with * the separator "|" and all whitespace removed, or the word * "NOTATION" followed by a space followed by a parenthesized * token group with all whitespace removed.</p> @@ -94,11 +94,11 @@ public interface DeclHandler * @exception SAXException The application may raise an exception. */ public abstract void attributeDecl (String eName, - String aName, - String type, - String mode, - String value) - throws SAXException; + String aName, + String type, + String mode, + String value) + throws SAXException; /** @@ -116,7 +116,7 @@ public interface DeclHandler * @see org.xml.sax.DTDHandler#unparsedEntityDecl */ public abstract void internalEntityDecl (String name, String value) - throws SAXException; + throws SAXException; /** @@ -138,8 +138,8 @@ public interface DeclHandler * @see org.xml.sax.DTDHandler#unparsedEntityDecl */ public abstract void externalEntityDecl (String name, String publicId, - String systemId) - throws SAXException; + String systemId) + throws SAXException; } diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java b/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java index 2b792e9df24..bf47ea889df 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/DefaultHandler2.java @@ -45,52 +45,52 @@ public class DefaultHandler2 extends DefaultHandler public void startCDATA () throws SAXException - {} + {} public void endCDATA () throws SAXException - {} + {} public void startDTD (String name, String publicId, String systemId) throws SAXException - {} + {} public void endDTD () throws SAXException - {} + {} public void startEntity (String name) throws SAXException - {} + {} public void endEntity (String name) throws SAXException - {} + {} public void comment (char ch [], int start, int length) throws SAXException - { } + { } // SAX2 ext-1.0 DeclHandler public void attributeDecl (String eName, String aName, - String type, String mode, String value) + String type, String mode, String value) throws SAXException - {} + {} public void elementDecl (String name, String model) throws SAXException - {} + {} public void externalEntityDecl (String name, - String publicId, String systemId) + String publicId, String systemId) throws SAXException - {} + {} public void internalEntityDecl (String name, String value) throws SAXException - {} + {} // SAX2 ext-1.1 EntityResolver2 @@ -100,22 +100,22 @@ public class DefaultHandler2 extends DefaultHandler */ public InputSource getExternalSubset (String name, String baseURI) throws SAXException, IOException - { return null; } + { return null; } /** * Tells the parser to resolve the systemId against the baseURI * and read the entity text from that resulting absolute URI. * Note that because the older * {@link DefaultHandler#resolveEntity DefaultHandler.resolveEntity()}, - * method is overridden to call this one, this method may sometimes + * method is overridden to call this one, this method may sometimes * be invoked with null <em>name</em> and <em>baseURI</em>, and * with the <em>systemId</em> already absolutized. */ public InputSource resolveEntity (String name, String publicId, - String baseURI, String systemId) + String baseURI, String systemId) throws SAXException, IOException - { return null; } - + { return null; } + // SAX1 EntityResolver /** @@ -126,5 +126,5 @@ public class DefaultHandler2 extends DefaultHandler */ public InputSource resolveEntity (String publicId, String systemId) throws SAXException, IOException - { return resolveEntity (null, publicId, null, systemId); } + { return resolveEntity (null, publicId, null, systemId); } } diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java b/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java index 1936f7e0421..96dcf6779b7 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/EntityResolver2.java @@ -108,28 +108,28 @@ public interface EntityResolver2 extends EntityResolver * that attributes are handled consistently. * For example, an XPath processor needs to know which attibutes have * type "ID" before it can process a widely used type of reference.</p> - * + * * <p><strong>Warning:</strong> Returning an external subset modifies * the input document. By providing definitions for general entities, * it can make a malformed document appear to be well formed. * </p> * * @param name Identifies the document root element. This name comes - * from a DOCTYPE declaration (where available) or from the actual - * root element. + * from a DOCTYPE declaration (where available) or from the actual + * root element. * @param baseURI The document's base URI, serving as an additional - * hint for selecting the external subset. This is always an absolute - * URI, unless it is null because the XMLReader was given an InputSource - * without one. + * hint for selecting the external subset. This is always an absolute + * URI, unless it is null because the XMLReader was given an InputSource + * without one. * * @return An InputSource object describing the new external subset - * to be used by the parser, or null to indicate that no external - * subset is provided. + * to be used by the parser, or null to indicate that no external + * subset is provided. * * @exception SAXException Any SAX exception, possibly wrapping - * another exception. + * another exception. * @exception IOException Probably indicating a failure to create - * a new InputStream or Reader, or an illegal URL. + * a new InputStream or Reader, or an illegal URL. */ public InputSource getExternalSubset (String name, String baseURI) throws SAXException, IOException; @@ -142,8 +142,8 @@ public interface EntityResolver2 extends EntityResolver * This method provides more flexibility than the {@link EntityResolver} * interface, supporting implementations of more complex catalogue * schemes such as the one defined by the <a href= - "http://www.oasis-open.org/committees/entity/spec-2001-08-06.html" - >OASIS XML Catalogs</a> specification.</p> + "http://www.oasis-open.org/committees/entity/spec-2001-08-06.html" + >OASIS XML Catalogs</a> specification.</p> * * <p>Parsers configured to use this resolver method will call it * to determine the input source to use for any external entity @@ -156,42 +156,42 @@ public interface EntityResolver2 extends EntityResolver * * <p>Note that the entity naming scheme used here is the same one * used in the {@link LexicalHandler}, or in the {@link - org.xml.sax.ContentHandler#skippedEntity - ContentHandler.skippedEntity()} + org.xml.sax.ContentHandler#skippedEntity + ContentHandler.skippedEntity()} * method. </p> * * @param name Identifies the external entity being resolved. - * Either "[dtd]" for the external subset, or a name starting - * with "%" to indicate a parameter entity, or else the name of - * a general entity. This is never null when invoked by a SAX2 - * parser. + * Either "[dtd]" for the external subset, or a name starting + * with "%" to indicate a parameter entity, or else the name of + * a general entity. This is never null when invoked by a SAX2 + * parser. * @param publicId The public identifier of the external entity being - * referenced (normalized as required by the XML specification), or - * null if none was supplied. + * referenced (normalized as required by the XML specification), or + * null if none was supplied. * @param baseURI The URI with respect to which relative systemIDs - * are interpreted. This is always an absolute URI, unless it is - * null (likely because the XMLReader was given an InputSource without + * are interpreted. This is always an absolute URI, unless it is + * null (likely because the XMLReader was given an InputSource without * one). This URI is defined by the XML specification to be the one - * associated with the "<" starting the relevant declaration. + * associated with the "<" starting the relevant declaration. * @param systemId The system identifier of the external entity - * being referenced; either a relative or absolute URI. + * being referenced; either a relative or absolute URI. * This is never null when invoked by a SAX2 parser; only declared - * entities, and any external subset, are resolved by such parsers. + * entities, and any external subset, are resolved by such parsers. * * @return An InputSource object describing the new input source to - * be used by the parser. Returning null directs the parser to - * resolve the system ID against the base URI and open a connection - * to resulting URI. + * be used by the parser. Returning null directs the parser to + * resolve the system ID against the base URI and open a connection + * to resulting URI. * * @exception SAXException Any SAX exception, possibly wrapping - * another exception. + * another exception. * @exception IOException Probably indicating a failure to create - * a new InputStream or Reader, or an illegal URL. + * a new InputStream or Reader, or an illegal URL. */ public InputSource resolveEntity ( - String name, - String publicId, - String baseURI, - String systemId + String name, + String publicId, + String baseURI, + String systemId ) throws SAXException, IOException; } diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java b/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java index 076bdf857c2..376d1c8d005 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/LexicalHandler.java @@ -51,7 +51,7 @@ public interface LexicalHandler * DOCTYPE declaration; if the document has no DOCTYPE declaration, * this method will not be invoked.</p> * - * <p>All declarations reported through + * <p>All declarations reported through * {@link org.xml.sax.DTDHandler DTDHandler} or * {@link org.xml.sax.ext.DeclHandler DeclHandler} events must appear * between the startDTD and {@link #endDTD endDTD} events. @@ -59,14 +59,14 @@ public interface LexicalHandler * unless they appear between {@link #startEntity startEntity} * and {@link #endEntity endEntity} events. Comments and * processing instructions from the DTD should also be reported - * between the startDTD and endDTD events, in their original + * between the startDTD and endDTD events, in their original * order of (logical) occurrence; they are not required to * appear in their correct locations relative to DTDHandler * or DeclHandler events, however.</p> * * <p>Note that the start/endDTD events will appear within * the start/endDocument events from ContentHandler and - * before the first + * before the first * {@link org.xml.sax.ContentHandler#startElement startElement} * event.</p> * @@ -83,8 +83,8 @@ public interface LexicalHandler * @see #startEntity */ public abstract void startDTD (String name, String publicId, - String systemId) - throws SAXException; + String systemId) + throws SAXException; /** @@ -98,7 +98,7 @@ public interface LexicalHandler * @see #startDTD */ public abstract void endDTD () - throws SAXException; + throws SAXException; /** @@ -112,12 +112,12 @@ public interface LexicalHandler * feature to query or control the reporting of parameter entities.</p> * * <p>General entities are reported with their regular names, - * parameter entities have '%' prepended to their names, and + * parameter entities have '%' prepended to their names, and * the external DTD subset has the pseudo-entity name "[dtd]".</p> * - * <p>When a SAX2 driver is providing these events, all other - * events must be properly nested within start/end entity - * events. There is no additional requirement that events from + * <p>When a SAX2 driver is providing these events, all other + * events must be properly nested within start/end entity + * events. There is no additional requirement that events from * {@link org.xml.sax.ext.DeclHandler DeclHandler} or * {@link org.xml.sax.DTDHandler DTDHandler} be properly ordered.</p> * @@ -126,7 +126,7 @@ public interface LexicalHandler * event, which is part of the ContentHandler interface.</p> * * <p>Because of the streaming event model that SAX uses, some - * entity boundaries cannot be reported under any + * entity boundaries cannot be reported under any * circumstances:</p> * * <ul> @@ -148,10 +148,10 @@ public interface LexicalHandler * @exception SAXException The application may raise an exception. * @see #endEntity * @see org.xml.sax.ext.DeclHandler#internalEntityDecl - * @see org.xml.sax.ext.DeclHandler#externalEntityDecl + * @see org.xml.sax.ext.DeclHandler#externalEntityDecl */ public abstract void startEntity (String name) - throws SAXException; + throws SAXException; /** @@ -162,7 +162,7 @@ public interface LexicalHandler * @see #startEntity */ public abstract void endEntity (String name) - throws SAXException; + throws SAXException; /** @@ -177,7 +177,7 @@ public interface LexicalHandler * @see #endCDATA */ public abstract void startCDATA () - throws SAXException; + throws SAXException; /** @@ -187,7 +187,7 @@ public interface LexicalHandler * @see #startCDATA */ public abstract void endCDATA () - throws SAXException; + throws SAXException; /** @@ -205,7 +205,7 @@ public interface LexicalHandler * @exception SAXException The application may raise an exception. */ public abstract void comment (char ch[], int start, int length) - throws SAXException; + throws SAXException; } diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java index 5fe3ba7706a..b186d3a282c 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2.java @@ -9,7 +9,7 @@ import org.xml.sax.Locator; /** - * SAX2 extension to augment the entity information provided + * SAX2 extension to augment the entity information provided * though a {@link Locator}. * If an implementation supports this extension, the Locator * provided in {@link org.xml.sax.ContentHandler#setDocumentLocator diff --git a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java index f0b35459dba..d3c7511144f 100644 --- a/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java +++ b/libjava/classpath/external/sax/org/xml/sax/ext/Locator2Impl.java @@ -26,8 +26,8 @@ import org.xml.sax.helpers.LocatorImpl; */ public class Locator2Impl extends LocatorImpl implements Locator2 { - private String encoding; - private String version; + private String encoding; + private String version; /** @@ -41,32 +41,32 @@ public class Locator2Impl extends LocatorImpl implements Locator2 * Copy an existing Locator or Locator2 object. * If the object implements Locator2, values of the * <em>encoding</em> and <em>version</em>strings are copied, - * otherwise they set to <em>null</em>. + * otherwise they set to <em>null</em>. * * @param locator The existing Locator object. */ public Locator2Impl (Locator locator) { - super (locator); - if (locator instanceof Locator2) { - Locator2 l2 = (Locator2) locator; + super (locator); + if (locator instanceof Locator2) { + Locator2 l2 = (Locator2) locator; - version = l2.getXMLVersion (); - encoding = l2.getEncoding (); - } + version = l2.getXMLVersion (); + encoding = l2.getEncoding (); + } } //////////////////////////////////////////////////////////////////// // Locator2 method implementations //////////////////////////////////////////////////////////////////// - + /** * Returns the current value of the version property. * * @see #setXMLVersion */ public String getXMLVersion () - { return version; } + { return version; } /** * Returns the current value of the encoding property. @@ -74,13 +74,13 @@ public class Locator2Impl extends LocatorImpl implements Locator2 * @see #setEncoding */ public String getEncoding () - { return encoding; } + { return encoding; } //////////////////////////////////////////////////////////////////// - // Setters + // Setters //////////////////////////////////////////////////////////////////// - + /** * Assigns the current value of the version property. * @@ -88,7 +88,7 @@ public class Locator2Impl extends LocatorImpl implements Locator2 * @see #getXMLVersion */ public void setXMLVersion (String version) - { this.version = version; } + { this.version = version; } /** * Assigns the current value of the encoding property. @@ -97,5 +97,5 @@ public class Locator2Impl extends LocatorImpl implements Locator2 * @see #getEncoding */ public void setEncoding (String encoding) - { this.encoding = encoding; } + { this.encoding = encoding; } } diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java index ca859fb1450..decf3abc199 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributeListImpl.java @@ -26,10 +26,10 @@ import java.util.Vector; * AttributesImpl} interface.</p> * * <p>This class provides a convenience implementation of the SAX - * {@link org.xml.sax.AttributeList AttributeList} interface. This - * implementation is useful both for SAX parser writers, who can use - * it to provide attributes to the application, and for SAX application - * writers, who can use it to create a persistent copy of an element's + * {@link org.xml.sax.AttributeList AttributeList} interface. This + * implementation is useful both for SAX parser writers, who can use + * it to provide attributes to the application, and for SAX application + * writers, who can use it to create a persistent copy of an element's * attribute specifications:</p> * * <pre> @@ -46,7 +46,7 @@ import java.util.Vector; * * <p>Please note that SAX parsers are not required to use this * class to provide an implementation of AttributeList; it is - * supplied only as an optional convenience. In particular, + * supplied only as an optional convenience. In particular, * parser writers are encouraged to invent more efficient * implementations.</p> * @@ -55,17 +55,17 @@ import java.util.Vector; * that interface has been replaced by * {@link org.xml.sax.Attributes Attributes}, * which is implemented in the - * {@link org.xml.sax.helpers.AttributesImpl + * {@link org.xml.sax.helpers.AttributesImpl * AttributesImpl} helper class. * @since SAX 1.0 * @author David Megginson * @version 2.0.1 (sax2r2) * @see org.xml.sax.AttributeList - * @see org.xml.sax.DocumentHandler#startElement + * @see org.xml.sax.DocumentHandler#startElement */ public class AttributeListImpl implements AttributeList { - + /** * Create an empty attribute list. * @@ -79,8 +79,8 @@ public class AttributeListImpl implements AttributeList public AttributeListImpl () { } - - + + /** * Construct a persistent copy of an existing attribute list. * @@ -93,16 +93,16 @@ public class AttributeListImpl implements AttributeList */ public AttributeListImpl (AttributeList atts) { - setAttributeList(atts); + setAttributeList(atts); } - - - + + + //////////////////////////////////////////////////////////////////// // Methods specific to this class. //////////////////////////////////////////////////////////////////// - - + + /** * Set the attribute list, discarding previous contents. * @@ -113,16 +113,16 @@ public class AttributeListImpl implements AttributeList */ public void setAttributeList (AttributeList atts) { - int count = atts.getLength(); - - clear(); - - for (int i = 0; i < count; i++) { - addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i)); - } + int count = atts.getLength(); + + clear(); + + for (int i = 0; i < count; i++) { + addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i)); + } } - - + + /** * Add an attribute to an attribute list. * @@ -138,12 +138,12 @@ public class AttributeListImpl implements AttributeList */ public void addAttribute (String name, String type, String value) { - names.addElement(name); - types.addElement(type); - values.addElement(value); + names.addElement(name); + types.addElement(type); + values.addElement(value); } - - + + /** * Remove an attribute from the list. * @@ -160,16 +160,16 @@ public class AttributeListImpl implements AttributeList */ public void removeAttribute (String name) { - int i = names.indexOf(name); - - if (i >= 0) { - names.removeElementAt(i); - types.removeElementAt(i); - values.removeElementAt(i); - } + int i = names.indexOf(name); + + if (i >= 0) { + names.removeElementAt(i); + types.removeElementAt(i); + values.removeElementAt(i); + } } - - + + /** * Clear the attribute list. * @@ -182,18 +182,18 @@ public class AttributeListImpl implements AttributeList */ public void clear () { - names.removeAllElements(); - types.removeAllElements(); - values.removeAllElements(); + names.removeAllElements(); + types.removeAllElements(); + values.removeAllElements(); } - - - + + + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.AttributeList //////////////////////////////////////////////////////////////////// - - + + /** * Return the number of attributes in the list. * @@ -202,10 +202,10 @@ public class AttributeListImpl implements AttributeList */ public int getLength () { - return names.size(); + return names.size(); } - - + + /** * Get the name of an attribute (by position). * @@ -216,17 +216,17 @@ public class AttributeListImpl implements AttributeList */ public String getName (int i) { - if (i < 0) { - return null; - } - try { - return (String)names.elementAt(i); - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } + if (i < 0) { + return null; + } + try { + return (String)names.elementAt(i); + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } } - - + + /** * Get the type of an attribute (by position). * @@ -239,17 +239,17 @@ public class AttributeListImpl implements AttributeList */ public String getType (int i) { - if (i < 0) { - return null; - } - try { - return (String)types.elementAt(i); - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } + if (i < 0) { + return null; + } + try { + return (String)types.elementAt(i); + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } } - - + + /** * Get the value of an attribute (by position). * @@ -260,17 +260,17 @@ public class AttributeListImpl implements AttributeList */ public String getValue (int i) { - if (i < 0) { - return null; - } - try { - return (String)values.elementAt(i); - } catch (ArrayIndexOutOfBoundsException e) { - return null; - } + if (i < 0) { + return null; + } + try { + return (String)values.elementAt(i); + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } } - - + + /** * Get the type of an attribute (by name). * @@ -282,10 +282,10 @@ public class AttributeListImpl implements AttributeList */ public String getType (String name) { - return getType(names.indexOf(name)); + return getType(names.indexOf(name)); } - - + + /** * Get the value of an attribute (by name). * @@ -294,11 +294,11 @@ public class AttributeListImpl implements AttributeList */ public String getValue (String name) { - return getValue(names.indexOf(name)); + return getValue(names.indexOf(name)); } - - - + + + //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java index 8753968ba0a..589b9209fae 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/AttributesImpl.java @@ -20,8 +20,8 @@ import org.xml.sax.Attributes; * </blockquote> * * <p>This class provides a default implementation of the SAX2 - * {@link org.xml.sax.Attributes Attributes} interface, with the - * addition of manipulators so that the list can be modified or + * {@link org.xml.sax.Attributes Attributes} interface, with the + * addition of manipulators so that the list can be modified or * reused.</p> * * <p>There are two typical uses of this class:</p> @@ -32,11 +32,11 @@ import org.xml.sax.Attributes; * <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li> * </ol> * - * <p>This class replaces the now-deprecated SAX1 {@link + * <p>This class replaces the now-deprecated SAX1 {@link * org.xml.sax.helpers.AttributeListImpl AttributeListImpl} * class; in addition to supporting the updated Attributes * interface rather than the deprecated {@link org.xml.sax.AttributeList - * AttributeList} interface, it also includes a much more efficient + * AttributeList} interface, it also includes a much more efficient * implementation using a single array rather than a set of Vectors.</p> * * @since SAX 2.0 @@ -46,7 +46,7 @@ import org.xml.sax.Attributes; public class AttributesImpl implements Attributes { - + //////////////////////////////////////////////////////////////////// // Constructors. //////////////////////////////////////////////////////////////////// @@ -57,8 +57,8 @@ public class AttributesImpl implements Attributes */ public AttributesImpl () { - length = 0; - data = null; + length = 0; + data = null; } @@ -72,11 +72,11 @@ public class AttributesImpl implements Attributes */ public AttributesImpl (Attributes atts) { - setAttributes(atts); + setAttributes(atts); } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.Attributes. //////////////////////////////////////////////////////////////////// @@ -90,7 +90,7 @@ public class AttributesImpl implements Attributes */ public int getLength () { - return length; + return length; } @@ -104,11 +104,11 @@ public class AttributesImpl implements Attributes */ public String getURI (int index) { - if (index >= 0 && index < length) { - return data[index*5]; - } else { - return null; - } + if (index >= 0 && index < length) { + return data[index*5]; + } else { + return null; + } } @@ -116,17 +116,17 @@ public class AttributesImpl implements Attributes * Return an attribute's local name. * * @param index The attribute's index (zero-based). - * @return The attribute's local name, the empty string if + * @return The attribute's local name, the empty string if * none is available, or null if the index if out of range. * @see org.xml.sax.Attributes#getLocalName */ public String getLocalName (int index) { - if (index >= 0 && index < length) { - return data[index*5+1]; - } else { - return null; - } + if (index >= 0 && index < length) { + return data[index*5+1]; + } else { + return null; + } } @@ -134,17 +134,17 @@ public class AttributesImpl implements Attributes * Return an attribute's qualified (prefixed) name. * * @param index The attribute's index (zero-based). - * @return The attribute's qualified name, the empty string if + * @return The attribute's qualified name, the empty string if * none is available, or null if the index is out of bounds. * @see org.xml.sax.Attributes#getQName */ public String getQName (int index) { - if (index >= 0 && index < length) { - return data[index*5+2]; - } else { - return null; - } + if (index >= 0 && index < length) { + return data[index*5+2]; + } else { + return null; + } } @@ -158,11 +158,11 @@ public class AttributesImpl implements Attributes */ public String getType (int index) { - if (index >= 0 && index < length) { - return data[index*5+3]; - } else { - return null; - } + if (index >= 0 && index < length) { + return data[index*5+3]; + } else { + return null; + } } @@ -175,11 +175,11 @@ public class AttributesImpl implements Attributes */ public String getValue (int index) { - if (index >= 0 && index < length) { - return data[index*5+4]; - } else { - return null; - } + if (index >= 0 && index < length) { + return data[index*5+4]; + } else { + return null; + } } @@ -198,13 +198,13 @@ public class AttributesImpl implements Attributes */ public int getIndex (String uri, String localName) { - int max = length * 5; - for (int i = 0; i < max; i += 5) { - if (data[i].equals(uri) && data[i+1].equals(localName)) { - return i / 5; - } - } - return -1; + int max = length * 5; + for (int i = 0; i < max; i += 5) { + if (data[i].equals(uri) && data[i+1].equals(localName)) { + return i / 5; + } + } + return -1; } @@ -217,13 +217,13 @@ public class AttributesImpl implements Attributes */ public int getIndex (String qName) { - int max = length * 5; - for (int i = 0; i < max; i += 5) { - if (data[i+2].equals(qName)) { - return i / 5; - } - } - return -1; + int max = length * 5; + for (int i = 0; i < max; i += 5) { + if (data[i+2].equals(qName)) { + return i / 5; + } + } + return -1; } @@ -239,13 +239,13 @@ public class AttributesImpl implements Attributes */ public String getType (String uri, String localName) { - int max = length * 5; - for (int i = 0; i < max; i += 5) { - if (data[i].equals(uri) && data[i+1].equals(localName)) { - return data[i+3]; - } - } - return null; + int max = length * 5; + for (int i = 0; i < max; i += 5) { + if (data[i].equals(uri) && data[i+1].equals(localName)) { + return data[i+3]; + } + } + return null; } @@ -259,13 +259,13 @@ public class AttributesImpl implements Attributes */ public String getType (String qName) { - int max = length * 5; - for (int i = 0; i < max; i += 5) { - if (data[i+2].equals(qName)) { - return data[i+3]; - } - } - return null; + int max = length * 5; + for (int i = 0; i < max; i += 5) { + if (data[i+2].equals(qName)) { + return data[i+3]; + } + } + return null; } @@ -281,13 +281,13 @@ public class AttributesImpl implements Attributes */ public String getValue (String uri, String localName) { - int max = length * 5; - for (int i = 0; i < max; i += 5) { - if (data[i].equals(uri) && data[i+1].equals(localName)) { - return data[i+4]; - } - } - return null; + int max = length * 5; + for (int i = 0; i < max; i += 5) { + if (data[i].equals(uri) && data[i+1].equals(localName)) { + return data[i+4]; + } + } + return null; } @@ -301,17 +301,17 @@ public class AttributesImpl implements Attributes */ public String getValue (String qName) { - int max = length * 5; - for (int i = 0; i < max; i += 5) { - if (data[i+2].equals(qName)) { - return data[i+4]; - } - } - return null; + int max = length * 5; + for (int i = 0; i < max; i += 5) { + if (data[i+2].equals(qName)) { + return data[i+4]; + } + } + return null; } - + //////////////////////////////////////////////////////////////////// // Manipulators. //////////////////////////////////////////////////////////////////// @@ -321,16 +321,16 @@ public class AttributesImpl implements Attributes * Clear the attribute list for reuse. * * <p>Note that little memory is freed by this call: - * the current array is kept so it can be + * the current array is kept so it can be * reused.</p> */ public void clear () { - if (data != null) { - for (int i = 0; i < (length * 5); i++) - data [i] = null; - } - length = 0; + if (data != null) { + for (int i = 0; i < (length * 5); i++) + data [i] = null; + } + length = 0; } @@ -339,7 +339,7 @@ public class AttributesImpl implements Attributes * * <p>It may be more efficient to reuse an existing object * rather than constantly allocating new ones.</p> - * + * * @param atts The attributes to copy. */ public void setAttributes (Attributes atts) @@ -355,7 +355,7 @@ public class AttributesImpl implements Attributes data[i*5+3] = atts.getType(i); data[i*5+4] = atts.getValue(i); } - } + } } @@ -377,15 +377,15 @@ public class AttributesImpl implements Attributes * @param value The attribute value. */ public void addAttribute (String uri, String localName, String qName, - String type, String value) + String type, String value) { - ensureCapacity(length+1); - data[length*5] = uri; - data[length*5+1] = localName; - data[length*5+2] = qName; - data[length*5+3] = type; - data[length*5+4] = value; - length++; + ensureCapacity(length+1); + data[length*5] = uri; + data[length*5+1] = localName; + data[length*5+2] = qName; + data[length*5+3] = type; + data[length*5+4] = value; + length++; } @@ -411,17 +411,17 @@ public class AttributesImpl implements Attributes * in the list. */ public void setAttribute (int index, String uri, String localName, - String qName, String type, String value) + String qName, String type, String value) { - if (index >= 0 && index < length) { - data[index*5] = uri; - data[index*5+1] = localName; - data[index*5+2] = qName; - data[index*5+3] = type; - data[index*5+4] = value; - } else { - badIndex(index); - } + if (index >= 0 && index < length) { + data[index*5] = uri; + data[index*5+1] = localName; + data[index*5+2] = qName; + data[index*5+3] = type; + data[index*5+4] = value; + } else { + badIndex(index); + } } @@ -435,21 +435,21 @@ public class AttributesImpl implements Attributes */ public void removeAttribute (int index) { - if (index >= 0 && index < length) { - if (index < length - 1) { - System.arraycopy(data, (index+1)*5, data, index*5, - (length-index-1)*5); - } - index = (length - 1) * 5; - data [index++] = null; - data [index++] = null; - data [index++] = null; - data [index++] = null; - data [index] = null; - length--; - } else { - badIndex(index); - } + if (index >= 0 && index < length) { + if (index < length - 1) { + System.arraycopy(data, (index+1)*5, data, index*5, + (length-index-1)*5); + } + index = (length - 1) * 5; + data [index++] = null; + data [index++] = null; + data [index++] = null; + data [index++] = null; + data [index] = null; + length--; + } else { + badIndex(index); + } } @@ -465,11 +465,11 @@ public class AttributesImpl implements Attributes */ public void setURI (int index, String uri) { - if (index >= 0 && index < length) { - data[index*5] = uri; - } else { - badIndex(index); - } + if (index >= 0 && index < length) { + data[index*5] = uri; + } else { + badIndex(index); + } } @@ -485,11 +485,11 @@ public class AttributesImpl implements Attributes */ public void setLocalName (int index, String localName) { - if (index >= 0 && index < length) { - data[index*5+1] = localName; - } else { - badIndex(index); - } + if (index >= 0 && index < length) { + data[index*5+1] = localName; + } else { + badIndex(index); + } } @@ -505,11 +505,11 @@ public class AttributesImpl implements Attributes */ public void setQName (int index, String qName) { - if (index >= 0 && index < length) { - data[index*5+2] = qName; - } else { - badIndex(index); - } + if (index >= 0 && index < length) { + data[index*5+2] = qName; + } else { + badIndex(index); + } } @@ -524,11 +524,11 @@ public class AttributesImpl implements Attributes */ public void setType (int index, String type) { - if (index >= 0 && index < length) { - data[index*5+3] = type; - } else { - badIndex(index); - } + if (index >= 0 && index < length) { + data[index*5+3] = type; + } else { + badIndex(index); + } } @@ -543,15 +543,15 @@ public class AttributesImpl implements Attributes */ public void setValue (int index, String value) { - if (index >= 0 && index < length) { - data[index*5+4] = value; - } else { - badIndex(index); - } + if (index >= 0 && index < length) { + data[index*5+4] = value; + } else { + badIndex(index); + } } - + //////////////////////////////////////////////////////////////////// // Internal methods. //////////////////////////////////////////////////////////////////// @@ -596,15 +596,15 @@ public class AttributesImpl implements Attributes * @exception java.lang.ArrayIndexOutOfBoundsException Always. */ private void badIndex (int index) - throws ArrayIndexOutOfBoundsException + throws ArrayIndexOutOfBoundsException { - String msg = - "Attempt to modify attribute at illegal index: " + index; - throw new ArrayIndexOutOfBoundsException(msg); + String msg = + "Attempt to modify attribute at illegal index: " + index; + throw new ArrayIndexOutOfBoundsException(msg); } - + //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// @@ -615,4 +615,3 @@ public class AttributesImpl implements Attributes } // end of AttributesImpl.java - diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java b/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java index e01c3be403d..f3d6eae44c6 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/DefaultHandler.java @@ -59,12 +59,12 @@ import org.xml.sax.SAXParseException; public class DefaultHandler implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler { - - + + //////////////////////////////////////////////////////////////////// // Default implementation of the EntityResolver interface. //////////////////////////////////////////////////////////////////// - + /** * Resolve an external entity. * @@ -76,7 +76,7 @@ public class DefaultHandler * * @param publicId The public identifer, or null if none is * available. - * @param systemId The system identifier provided in the XML + * @param systemId The system identifier provided in the XML * document. * @return The new input source, or null to require the * default behaviour. @@ -87,18 +87,18 @@ public class DefaultHandler * @see org.xml.sax.EntityResolver#resolveEntity */ public InputSource resolveEntity (String publicId, String systemId) - throws IOException, SAXException + throws IOException, SAXException { - return null; + return null; } - - - + + + //////////////////////////////////////////////////////////////////// // Default implementation of DTDHandler interface. //////////////////////////////////////////////////////////////////// - - + + /** * Receive notification of a notation declaration. * @@ -115,12 +115,12 @@ public class DefaultHandler * @see org.xml.sax.DTDHandler#notationDecl */ public void notationDecl (String name, String publicId, String systemId) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of an unparsed entity declaration. * @@ -138,19 +138,19 @@ public class DefaultHandler * @see org.xml.sax.DTDHandler#unparsedEntityDecl */ public void unparsedEntityDecl (String name, String publicId, - String systemId, String notationName) - throws SAXException + String systemId, String notationName) + throws SAXException { - // no op + // no op } - - - + + + //////////////////////////////////////////////////////////////////// // Default implementation of ContentHandler interface. //////////////////////////////////////////////////////////////////// - - + + /** * Receive a Locator object for document events. * @@ -164,10 +164,10 @@ public class DefaultHandler */ public void setDocumentLocator (Locator locator) { - // no op + // no op } - - + + /** * Receive notification of the beginning of the document. * @@ -181,12 +181,12 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#startDocument */ public void startDocument () - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of the end of the document. * @@ -200,9 +200,9 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#endDocument */ public void endDocument () - throws SAXException + throws SAXException { - // no op + // no op } @@ -220,9 +220,9 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#startPrefixMapping */ public void startPrefixMapping (String prefix, String uri) - throws SAXException + throws SAXException { - // no op + // no op } @@ -239,12 +239,12 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#endPrefixMapping */ public void endPrefixMapping (String prefix) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of the start of an element. * @@ -269,13 +269,13 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#startElement */ public void startElement (String uri, String localName, - String qName, Attributes attributes) - throws SAXException + String qName, Attributes attributes) + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of the end of an element. * @@ -297,12 +297,12 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#endElement */ public void endElement (String uri, String localName, String qName) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of character data inside an element. * @@ -320,12 +320,12 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#characters */ public void characters (char ch[], int start, int length) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of ignorable whitespace in element content. * @@ -343,12 +343,12 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#ignorableWhitespace */ public void ignorableWhitespace (char ch[], int start, int length) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of a processing instruction. * @@ -365,9 +365,9 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#processingInstruction */ public void processingInstruction (String target, String data) - throws SAXException + throws SAXException { - // no op + // no op } @@ -385,18 +385,18 @@ public class DefaultHandler * @see org.xml.sax.ContentHandler#processingInstruction */ public void skippedEntity (String name) - throws SAXException + throws SAXException { - // no op + // no op } - - - + + + //////////////////////////////////////////////////////////////////// // Default implementation of the ErrorHandler interface. //////////////////////////////////////////////////////////////////// - - + + /** * Receive notification of a parser warning. * @@ -412,12 +412,12 @@ public class DefaultHandler * @see org.xml.sax.SAXParseException */ public void warning (SAXParseException e) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Receive notification of a recoverable parser error. * @@ -433,12 +433,12 @@ public class DefaultHandler * @see org.xml.sax.SAXParseException */ public void error (SAXParseException e) - throws SAXException + throws SAXException { - // no op + // no op } - - + + /** * Report a fatal XML parsing error. * @@ -457,11 +457,11 @@ public class DefaultHandler * @see org.xml.sax.SAXParseException */ public void fatalError (SAXParseException e) - throws SAXException + throws SAXException { - throw e; + throw e; } - + } // end of DefaultHandler.java diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java index 6fa4857277c..d45813e5b00 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/LocatorImpl.java @@ -51,8 +51,8 @@ import org.xml.sax.Locator; */ public class LocatorImpl implements Locator { - - + + /** * Zero-argument constructor. * @@ -62,8 +62,8 @@ public class LocatorImpl implements Locator public LocatorImpl () { } - - + + /** * Copy constructor. * @@ -76,19 +76,19 @@ public class LocatorImpl implements Locator */ public LocatorImpl (Locator locator) { - setPublicId(locator.getPublicId()); - setSystemId(locator.getSystemId()); - setLineNumber(locator.getLineNumber()); - setColumnNumber(locator.getColumnNumber()); + setPublicId(locator.getPublicId()); + setSystemId(locator.getSystemId()); + setLineNumber(locator.getLineNumber()); + setColumnNumber(locator.getColumnNumber()); } - - - + + + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.Locator //////////////////////////////////////////////////////////////////// - - + + /** * Return the saved public identifier. * @@ -99,10 +99,10 @@ public class LocatorImpl implements Locator */ public String getPublicId () { - return publicId; + return publicId; } - - + + /** * Return the saved system identifier. * @@ -113,10 +113,10 @@ public class LocatorImpl implements Locator */ public String getSystemId () { - return systemId; + return systemId; } - - + + /** * Return the saved line number (1-based). * @@ -126,10 +126,10 @@ public class LocatorImpl implements Locator */ public int getLineNumber () { - return lineNumber; + return lineNumber; } - - + + /** * Return the saved column number (1-based). * @@ -139,42 +139,42 @@ public class LocatorImpl implements Locator */ public int getColumnNumber () { - return columnNumber; + return columnNumber; } - - - + + + //////////////////////////////////////////////////////////////////// // Setters for the properties (not in org.xml.sax.Locator) //////////////////////////////////////////////////////////////////// - - + + /** * Set the public identifier for this locator. * - * @param publicId The new public identifier, or null + * @param publicId The new public identifier, or null * if none is available. * @see #getPublicId */ public void setPublicId (String publicId) { - this.publicId = publicId; + this.publicId = publicId; } - - + + /** * Set the system identifier for this locator. * - * @param systemId The new system identifier, or null + * @param systemId The new system identifier, or null * if none is available. * @see #getSystemId */ public void setSystemId (String systemId) { - this.systemId = systemId; + this.systemId = systemId; } - - + + /** * Set the line number for this locator (1-based). * @@ -183,10 +183,10 @@ public class LocatorImpl implements Locator */ public void setLineNumber (int lineNumber) { - this.lineNumber = lineNumber; + this.lineNumber = lineNumber; } - - + + /** * Set the column number for this locator (1-based). * @@ -195,20 +195,20 @@ public class LocatorImpl implements Locator */ public void setColumnNumber (int columnNumber) { - this.columnNumber = columnNumber; + this.columnNumber = columnNumber; } - - - + + + //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// - + private String publicId; private String systemId; private int lineNumber; private int columnNumber; - + } // end of LocatorImpl.java diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java b/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java index 01e11faf83e..d1e74639ac4 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/NamespaceSupport.java @@ -72,7 +72,7 @@ import java.util.Vector; public class NamespaceSupport { - + //////////////////////////////////////////////////////////////////// // Constants. //////////////////////////////////////////////////////////////////// @@ -87,16 +87,16 @@ public class NamespaceSupport * to the "xml" prefix.</p> */ public final static String XMLNS = - "http://www.w3.org/XML/1998/namespace"; + "http://www.w3.org/XML/1998/namespace"; /** * The namespace declaration URI as a constant. * The value is <code>http://www.w3.org/xmlns/2000/</code>, as defined * in a backwards-incompatible erratum to the "Namespaces in XML" - * recommendation. Because that erratum postdated SAX2, SAX2 defaults + * recommendation. Because that erratum postdated SAX2, SAX2 defaults * to the original recommendation, and does not normally use this URI. - * + * * * <p>This is the Namespace URI that is optionally applied to * <em>xmlns</em> and <em>xmlns:*</em> attributes, which are used to @@ -107,16 +107,16 @@ public class NamespaceSupport * @see #isNamespaceDeclUris */ public final static String NSDECL = - "http://www.w3.org/xmlns/2000/"; + "http://www.w3.org/xmlns/2000/"; /** * An empty enumeration. */ private final static Enumeration EMPTY_ENUMERATION = - new Vector().elements(); + new Vector().elements(); + - //////////////////////////////////////////////////////////////////// // Constructor. //////////////////////////////////////////////////////////////////// @@ -127,11 +127,11 @@ public class NamespaceSupport */ public NamespaceSupport () { - reset(); + reset(); } - + //////////////////////////////////////////////////////////////////// // Context management. //////////////////////////////////////////////////////////////////// @@ -150,11 +150,11 @@ public class NamespaceSupport */ public void reset () { - contexts = new Context[32]; - namespaceDeclUris = false; - contextPos = 0; - contexts[contextPos] = currentContext = new Context(); - currentContext.declarePrefix("xml", XMLNS); + contexts = new Context[32]; + namespaceDeclUris = false; + contextPos = 0; + contexts[contextPos] = currentContext = new Context(); + currentContext.declarePrefix("xml", XMLNS); } @@ -196,29 +196,29 @@ public class NamespaceSupport */ public void pushContext () { - int max = contexts.length; - - contexts [contextPos].declsOK = false; - contextPos++; - - // Extend the array if necessary - if (contextPos >= max) { - Context newContexts[] = new Context[max*2]; - System.arraycopy(contexts, 0, newContexts, 0, max); - max *= 2; - contexts = newContexts; - } - - // Allocate the context if necessary. - currentContext = contexts[contextPos]; - if (currentContext == null) { - contexts[contextPos] = currentContext = new Context(); - } - - // Set the parent, if any. - if (contextPos > 0) { - currentContext.setParent(contexts[contextPos - 1]); - } + int max = contexts.length; + + contexts [contextPos].declsOK = false; + contextPos++; + + // Extend the array if necessary + if (contextPos >= max) { + Context newContexts[] = new Context[max*2]; + System.arraycopy(contexts, 0, newContexts, 0, max); + max *= 2; + contexts = newContexts; + } + + // Allocate the context if necessary. + currentContext = contexts[contextPos]; + if (currentContext == null) { + contexts[contextPos] = currentContext = new Context(); + } + + // Set the parent, if any. + if (contextPos > 0) { + currentContext.setParent(contexts[contextPos - 1]); + } } @@ -237,16 +237,16 @@ public class NamespaceSupport */ public void popContext () { - contexts[contextPos].clear(); - contextPos--; - if (contextPos < 0) { - throw new EmptyStackException(); - } - currentContext = contexts[contextPos]; + contexts[contextPos].clear(); + contextPos--; + if (contextPos < 0) { + throw new EmptyStackException(); + } + currentContext = contexts[contextPos]; } - + //////////////////////////////////////////////////////////////////// // Operations within a context. //////////////////////////////////////////////////////////////////// @@ -281,8 +281,8 @@ public class NamespaceSupport * for attribute names, where the default prefix is not allowed.</p> * * @param prefix The prefix to declare, or the empty string to - * indicate the default element namespace. This may never have - * the value "xml" or "xmlns". + * indicate the default element namespace. This may never have + * the value "xml" or "xmlns". * @param uri The Namespace URI to associate with the prefix. * @return true if the prefix was legal, false otherwise * @@ -292,12 +292,12 @@ public class NamespaceSupport */ public boolean declarePrefix (String prefix, String uri) { - if (prefix.equals("xml") || prefix.equals("xmlns")) { - return false; - } else { - currentContext.declarePrefix(prefix, uri); - return true; - } + if (prefix.equals("xml") || prefix.equals("xmlns")) { + return false; + } else { + currentContext.declarePrefix(prefix, uri); + return true; + } } @@ -335,24 +335,24 @@ public class NamespaceSupport * holding at least three members. * @param isAttribute A flag indicating whether this is an * attribute name (true) or an element name (false). - * @return The supplied array holding three internalized strings + * @return The supplied array holding three internalized strings * representing the Namespace URI (or empty string), the * local name, and the XML qualified name; or null if there * is an undeclared prefix. * @see #declarePrefix * @see java.lang.String#intern */ public String [] processName (String qName, String parts[], - boolean isAttribute) + boolean isAttribute) { - String myParts[] = currentContext.processName(qName, isAttribute); - if (myParts == null) { - return null; - } else { - parts[0] = myParts[0]; - parts[1] = myParts[1]; - parts[2] = myParts[2]; - return parts; - } + String myParts[] = currentContext.processName(qName, isAttribute); + if (myParts == null) { + return null; + } else { + parts[0] = myParts[0]; + parts[1] = myParts[1]; + parts[2] = myParts[2]; + return parts; + } } @@ -370,7 +370,7 @@ public class NamespaceSupport */ public String getURI (String prefix) { - return currentContext.getURI(prefix); + return currentContext.getURI(prefix); } @@ -390,7 +390,7 @@ public class NamespaceSupport */ public Enumeration getPrefixes () { - return currentContext.getPrefixes(); + return currentContext.getPrefixes(); } @@ -415,7 +415,7 @@ public class NamespaceSupport */ public String getPrefix (String uri) { - return currentContext.getPrefix(uri); + return currentContext.getPrefix(uri); } @@ -427,7 +427,7 @@ public class NamespaceSupport * * <p>This method returns prefixes mapped to a specific Namespace * URI. The xml: prefix will be included. If you want only one - * prefix that's mapped to the Namespace URI, and you don't care + * prefix that's mapped to the Namespace URI, and you don't care * which one you get, use the {@link #getPrefix getPrefix} * method instead.</p> * @@ -444,22 +444,22 @@ public class NamespaceSupport */ public Enumeration getPrefixes (String uri) { - Vector prefixes = new Vector(); - Enumeration allPrefixes = getPrefixes(); - while (allPrefixes.hasMoreElements()) { - String prefix = (String)allPrefixes.nextElement(); - if (uri.equals(getURI(prefix))) { - prefixes.addElement(prefix); - } - } - return prefixes.elements(); + Vector prefixes = new Vector(); + Enumeration allPrefixes = getPrefixes(); + while (allPrefixes.hasMoreElements()) { + String prefix = (String)allPrefixes.nextElement(); + if (uri.equals(getURI(prefix))) { + prefixes.addElement(prefix); + } + } + return prefixes.elements(); } /** * Return an enumeration of all prefixes declared in this context. * - * <p>The empty (default) prefix will be included in this + * <p>The empty (default) prefix will be included in this * enumeration; note that this behaviour differs from that of * {@link #getPrefix} and {@link #getPrefixes}.</p> * @@ -470,7 +470,7 @@ public class NamespaceSupport */ public Enumeration getDeclaredPrefixes () { - return currentContext.getDeclaredPrefixes(); + return currentContext.getDeclaredPrefixes(); } /** @@ -482,21 +482,21 @@ public class NamespaceSupport * @since SAX 2.1alpha * * @exception IllegalStateException when attempting to set this - * after any context has been pushed. + * after any context has been pushed. */ public void setNamespaceDeclUris (boolean value) { - if (contextPos != 0) - throw new IllegalStateException (); - if (value == namespaceDeclUris) - return; - namespaceDeclUris = value; - if (value) - currentContext.declarePrefix ("xmlns", NSDECL); - else { - contexts[contextPos] = currentContext = new Context(); - currentContext.declarePrefix("xml", XMLNS); - } + if (contextPos != 0) + throw new IllegalStateException (); + if (value == namespaceDeclUris) + return; + namespaceDeclUris = value; + if (value) + currentContext.declarePrefix ("xmlns", NSDECL); + else { + contexts[contextPos] = currentContext = new Context(); + currentContext.declarePrefix("xml", XMLNS); + } } /** @@ -506,10 +506,10 @@ public class NamespaceSupport * @since SAX 2.1alpha */ public boolean isNamespaceDeclUris () - { return namespaceDeclUris; } + { return namespaceDeclUris; } + - //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// @@ -519,7 +519,7 @@ public class NamespaceSupport private int contextPos; private boolean namespaceDeclUris; - + //////////////////////////////////////////////////////////////////// // Internal classes. //////////////////////////////////////////////////////////////////// @@ -538,297 +538,297 @@ public class NamespaceSupport */ final class Context { - /** - * Create the root-level Namespace context. - */ - Context () - { - copyTables(); - } - - - /** - * (Re)set the parent of this Namespace context. - * The context must either have been freshly constructed, - * or must have been cleared. - * - * @param context The parent Namespace context object. - */ - void setParent (Context parent) - { - this.parent = parent; - declarations = null; - prefixTable = parent.prefixTable; - uriTable = parent.uriTable; - elementNameTable = parent.elementNameTable; - attributeNameTable = parent.attributeNameTable; - defaultNS = parent.defaultNS; - declSeen = false; - declsOK = true; - } - - /** - * Makes associated state become collectible, - * invalidating this context. - * {@link #setParent} must be called before - * this context may be used again. - */ - void clear () - { - parent = null; - prefixTable = null; - uriTable = null; - elementNameTable = null; - attributeNameTable = null; - defaultNS = null; - } - - - /** - * Declare a Namespace prefix for this context. - * - * @param prefix The prefix to declare. - * @param uri The associated Namespace URI. - * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix - */ - void declarePrefix (String prefix, String uri) - { - // Lazy processing... - if (!declsOK) - throw new IllegalStateException ( - "can't declare any more prefixes in this context"); - if (!declSeen) { - copyTables(); - } - if (declarations == null) { - declarations = new Vector(); - } - - prefix = prefix.intern(); - uri = uri.intern(); - if ("".equals(prefix)) { - if ("".equals(uri)) { - defaultNS = null; - } else { - defaultNS = uri; - } - } else { - prefixTable.put(prefix, uri); - uriTable.put(uri, prefix); // may wipe out another prefix - } - declarations.addElement(prefix); - } - - - /** - * Process an XML qualified name in this context. - * - * @param qName The XML qualified name. - * @param isAttribute true if this is an attribute name. - * @return An array of three strings containing the - * URI part (or empty string), the local part, - * and the raw name, all internalized, or null - * if there is an undeclared prefix. - * @see org.xml.sax.helpers.NamespaceSupport#processName - */ - String [] processName (String qName, boolean isAttribute) - { - String name[]; - Hashtable table; - - // detect errors in call sequence - declsOK = false; - - // Select the appropriate table. - if (isAttribute) { - table = attributeNameTable; - } else { - table = elementNameTable; - } - - // Start by looking in the cache, and - // return immediately if the name - // is already known in this content - name = (String[])table.get(qName); - if (name != null) { - return name; - } - - // We haven't seen this name in this - // context before. Maybe in the parent - // context, but we can't assume prefix - // bindings are the same. - name = new String[3]; - name[2] = qName.intern(); - int index = qName.indexOf(':'); - - - // No prefix. - if (index == -1) { - if (isAttribute) { - if (qName == "xmlns" && namespaceDeclUris) - name[0] = NSDECL; - else - name[0] = ""; - } else if (defaultNS == null) { - name[0] = ""; - } else { - name[0] = defaultNS; - } - name[1] = name[2]; - } - - // Prefix - else { - String prefix = qName.substring(0, index); - String local = qName.substring(index+1); - String uri; - if ("".equals(prefix)) { - uri = defaultNS; - } else { - uri = (String)prefixTable.get(prefix); - } - if (uri == null - || (!isAttribute && "xmlns".equals (prefix))) { - return null; - } - name[0] = uri; - name[1] = local.intern(); - } - - // Save in the cache for future use. - // (Could be shared with parent context...) - table.put(name[2], name); - return name; - } - - - /** - * Look up the URI associated with a prefix in this context. - * - * @param prefix The prefix to look up. - * @return The associated Namespace URI, or null if none is - * declared. - * @see org.xml.sax.helpers.NamespaceSupport#getURI - */ - String getURI (String prefix) - { - if ("".equals(prefix)) { - return defaultNS; - } else if (prefixTable == null) { - return null; - } else { - return (String)prefixTable.get(prefix); - } - } - - - /** - * Look up one of the prefixes associated with a URI in this context. - * - * <p>Since many prefixes may be mapped to the same URI, - * the return value may be unreliable.</p> - * - * @param uri The URI to look up. - * @return The associated prefix, or null if none is declared. - * @see org.xml.sax.helpers.NamespaceSupport#getPrefix - */ - String getPrefix (String uri) - { - if (uriTable == null) { - return null; - } else { - return (String)uriTable.get(uri); - } - } - - - /** - * Return an enumeration of prefixes declared in this context. - * - * @return An enumeration of prefixes (possibly empty). - * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes - */ - Enumeration getDeclaredPrefixes () - { - if (declarations == null) { - return EMPTY_ENUMERATION; - } else { - return declarations.elements(); - } - } - - - /** - * Return an enumeration of all prefixes currently in force. - * - * <p>The default prefix, if in force, is <em>not</em> - * returned, and will have to be checked for separately.</p> - * - * @return An enumeration of prefixes (never empty). - * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes - */ - Enumeration getPrefixes () - { - if (prefixTable == null) { - return EMPTY_ENUMERATION; - } else { - return prefixTable.keys(); - } - } - - - - //////////////////////////////////////////////////////////////// - // Internal methods. - //////////////////////////////////////////////////////////////// - - - /** - * Copy on write for the internal tables in this context. - * - * <p>This class is optimized for the normal case where most - * elements do not contain Namespace declarations.</p> - */ - private void copyTables () - { - if (prefixTable != null) { - prefixTable = (Hashtable)prefixTable.clone(); - } else { - prefixTable = new Hashtable(); - } - if (uriTable != null) { - uriTable = (Hashtable)uriTable.clone(); - } else { - uriTable = new Hashtable(); - } - elementNameTable = new Hashtable(); - attributeNameTable = new Hashtable(); - declSeen = true; - } - - - - //////////////////////////////////////////////////////////////// - // Protected state. - //////////////////////////////////////////////////////////////// - - Hashtable prefixTable; - Hashtable uriTable; - Hashtable elementNameTable; - Hashtable attributeNameTable; - String defaultNS = null; - boolean declsOK = true; - - - - //////////////////////////////////////////////////////////////// - // Internal state. - //////////////////////////////////////////////////////////////// - - private Vector declarations = null; - private boolean declSeen = false; - private Context parent = null; + /** + * Create the root-level Namespace context. + */ + Context () + { + copyTables(); + } + + + /** + * (Re)set the parent of this Namespace context. + * The context must either have been freshly constructed, + * or must have been cleared. + * + * @param context The parent Namespace context object. + */ + void setParent (Context parent) + { + this.parent = parent; + declarations = null; + prefixTable = parent.prefixTable; + uriTable = parent.uriTable; + elementNameTable = parent.elementNameTable; + attributeNameTable = parent.attributeNameTable; + defaultNS = parent.defaultNS; + declSeen = false; + declsOK = true; + } + + /** + * Makes associated state become collectible, + * invalidating this context. + * {@link #setParent} must be called before + * this context may be used again. + */ + void clear () + { + parent = null; + prefixTable = null; + uriTable = null; + elementNameTable = null; + attributeNameTable = null; + defaultNS = null; + } + + + /** + * Declare a Namespace prefix for this context. + * + * @param prefix The prefix to declare. + * @param uri The associated Namespace URI. + * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix + */ + void declarePrefix (String prefix, String uri) + { + // Lazy processing... + if (!declsOK) + throw new IllegalStateException ( + "can't declare any more prefixes in this context"); + if (!declSeen) { + copyTables(); + } + if (declarations == null) { + declarations = new Vector(); + } + + prefix = prefix.intern(); + uri = uri.intern(); + if ("".equals(prefix)) { + if ("".equals(uri)) { + defaultNS = null; + } else { + defaultNS = uri; + } + } else { + prefixTable.put(prefix, uri); + uriTable.put(uri, prefix); // may wipe out another prefix + } + declarations.addElement(prefix); + } + + + /** + * Process an XML qualified name in this context. + * + * @param qName The XML qualified name. + * @param isAttribute true if this is an attribute name. + * @return An array of three strings containing the + * URI part (or empty string), the local part, + * and the raw name, all internalized, or null + * if there is an undeclared prefix. + * @see org.xml.sax.helpers.NamespaceSupport#processName + */ + String [] processName (String qName, boolean isAttribute) + { + String name[]; + Hashtable table; + + // detect errors in call sequence + declsOK = false; + + // Select the appropriate table. + if (isAttribute) { + table = attributeNameTable; + } else { + table = elementNameTable; + } + + // Start by looking in the cache, and + // return immediately if the name + // is already known in this content + name = (String[])table.get(qName); + if (name != null) { + return name; + } + + // We haven't seen this name in this + // context before. Maybe in the parent + // context, but we can't assume prefix + // bindings are the same. + name = new String[3]; + name[2] = qName.intern(); + int index = qName.indexOf(':'); + + + // No prefix. + if (index == -1) { + if (isAttribute) { + if (qName == "xmlns" && namespaceDeclUris) + name[0] = NSDECL; + else + name[0] = ""; + } else if (defaultNS == null) { + name[0] = ""; + } else { + name[0] = defaultNS; + } + name[1] = name[2]; + } + + // Prefix + else { + String prefix = qName.substring(0, index); + String local = qName.substring(index+1); + String uri; + if ("".equals(prefix)) { + uri = defaultNS; + } else { + uri = (String)prefixTable.get(prefix); + } + if (uri == null + || (!isAttribute && "xmlns".equals (prefix))) { + return null; + } + name[0] = uri; + name[1] = local.intern(); + } + + // Save in the cache for future use. + // (Could be shared with parent context...) + table.put(name[2], name); + return name; + } + + + /** + * Look up the URI associated with a prefix in this context. + * + * @param prefix The prefix to look up. + * @return The associated Namespace URI, or null if none is + * declared. + * @see org.xml.sax.helpers.NamespaceSupport#getURI + */ + String getURI (String prefix) + { + if ("".equals(prefix)) { + return defaultNS; + } else if (prefixTable == null) { + return null; + } else { + return (String)prefixTable.get(prefix); + } + } + + + /** + * Look up one of the prefixes associated with a URI in this context. + * + * <p>Since many prefixes may be mapped to the same URI, + * the return value may be unreliable.</p> + * + * @param uri The URI to look up. + * @return The associated prefix, or null if none is declared. + * @see org.xml.sax.helpers.NamespaceSupport#getPrefix + */ + String getPrefix (String uri) + { + if (uriTable == null) { + return null; + } else { + return (String)uriTable.get(uri); + } + } + + + /** + * Return an enumeration of prefixes declared in this context. + * + * @return An enumeration of prefixes (possibly empty). + * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes + */ + Enumeration getDeclaredPrefixes () + { + if (declarations == null) { + return EMPTY_ENUMERATION; + } else { + return declarations.elements(); + } + } + + + /** + * Return an enumeration of all prefixes currently in force. + * + * <p>The default prefix, if in force, is <em>not</em> + * returned, and will have to be checked for separately.</p> + * + * @return An enumeration of prefixes (never empty). + * @see org.xml.sax.helpers.NamespaceSupport#getPrefixes + */ + Enumeration getPrefixes () + { + if (prefixTable == null) { + return EMPTY_ENUMERATION; + } else { + return prefixTable.keys(); + } + } + + + + //////////////////////////////////////////////////////////////// + // Internal methods. + //////////////////////////////////////////////////////////////// + + + /** + * Copy on write for the internal tables in this context. + * + * <p>This class is optimized for the normal case where most + * elements do not contain Namespace declarations.</p> + */ + private void copyTables () + { + if (prefixTable != null) { + prefixTable = (Hashtable)prefixTable.clone(); + } else { + prefixTable = new Hashtable(); + } + if (uriTable != null) { + uriTable = (Hashtable)uriTable.clone(); + } else { + uriTable = new Hashtable(); + } + elementNameTable = new Hashtable(); + attributeNameTable = new Hashtable(); + declSeen = true; + } + + + + //////////////////////////////////////////////////////////////// + // Protected state. + //////////////////////////////////////////////////////////////// + + Hashtable prefixTable; + Hashtable uriTable; + Hashtable elementNameTable; + Hashtable attributeNameTable; + String defaultNS = null; + boolean declsOK = true; + + + + //////////////////////////////////////////////////////////////// + // Internal state. + //////////////////////////////////////////////////////////////// + + private Vector declarations = null; + private boolean declSeen = false; + private Context parent = null; } } diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java b/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java index 70c043eb42f..211f47f1c0b 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/NewInstance.java @@ -54,7 +54,7 @@ class NewInstance { /** * Figure out which ClassLoader to use. For JDK 1.2 and later use * the context ClassLoader. - */ + */ static ClassLoader getClassLoader () { Method m = null; diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java index 748ad1c8499..cc0695d2727 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserAdapter.java @@ -10,7 +10,7 @@ import java.io.IOException; import java.util.Enumeration; import java.util.Vector; -import org.xml.sax.Parser; // deprecated +import org.xml.sax.Parser; // deprecated import org.xml.sax.InputSource; import org.xml.sax.Locator; import org.xml.sax.AttributeList; // deprecated @@ -57,7 +57,7 @@ import org.xml.sax.SAXNotSupportedException; public class ParserAdapter implements XMLReader, DocumentHandler { - + //////////////////////////////////////////////////////////////////// // Constructors. //////////////////////////////////////////////////////////////////// @@ -76,35 +76,35 @@ public class ParserAdapter implements XMLReader, DocumentHandler public ParserAdapter () throws SAXException { - super(); - - String driver = System.getProperty("org.xml.sax.parser"); - - try { - setup(ParserFactory.makeParser()); - } catch (ClassNotFoundException e1) { - throw new - SAXException("Cannot find SAX1 driver class " + - driver, e1); - } catch (IllegalAccessException e2) { - throw new - SAXException("SAX1 driver class " + - driver + - " found but cannot be loaded", e2); - } catch (InstantiationException e3) { - throw new - SAXException("SAX1 driver class " + - driver + - " loaded but cannot be instantiated", e3); - } catch (ClassCastException e4) { - throw new - SAXException("SAX1 driver class " + - driver + - " does not implement org.xml.sax.Parser"); - } catch (NullPointerException e5) { - throw new - SAXException("System property org.xml.sax.parser not specified"); - } + super(); + + String driver = System.getProperty("org.xml.sax.parser"); + + try { + setup(ParserFactory.makeParser()); + } catch (ClassNotFoundException e1) { + throw new + SAXException("Cannot find SAX1 driver class " + + driver, e1); + } catch (IllegalAccessException e2) { + throw new + SAXException("SAX1 driver class " + + driver + + " found but cannot be loaded", e2); + } catch (InstantiationException e3) { + throw new + SAXException("SAX1 driver class " + + driver + + " loaded but cannot be instantiated", e3); + } catch (ClassCastException e4) { + throw new + SAXException("SAX1 driver class " + + driver + + " does not implement org.xml.sax.Parser"); + } catch (NullPointerException e5) { + throw new + SAXException("System property org.xml.sax.parser not specified"); + } } @@ -121,8 +121,8 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public ParserAdapter (Parser parser) { - super(); - setup(parser); + super(); + setup(parser); } @@ -135,18 +135,18 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ private void setup (Parser parser) { - if (parser == null) { - throw new - NullPointerException("Parser argument must not be null"); - } - this.parser = parser; - atts = new AttributesImpl(); - nsSupport = new NamespaceSupport(); - attAdapter = new AttributeListAdapter(); + if (parser == null) { + throw new + NullPointerException("Parser argument must not be null"); + } + this.parser = parser; + atts = new AttributesImpl(); + nsSupport = new NamespaceSupport(); + attAdapter = new AttributeListAdapter(); } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.XMLReader. //////////////////////////////////////////////////////////////////// @@ -164,7 +164,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler /** * Set a feature flag for the parser. * - * <p>The only features recognized are namespaces and + * <p>The only features recognized are namespaces and * namespace-prefixes.</p> * * @param name The feature name, as a complete URI. @@ -176,33 +176,33 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.XMLReader#setFeature */ public void setFeature (String name, boolean value) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - if (name.equals(NAMESPACES)) { - checkNotParsing("feature", name); - namespaces = value; - if (!namespaces && !prefixes) { - prefixes = true; - } - } else if (name.equals(NAMESPACE_PREFIXES)) { - checkNotParsing("feature", name); - prefixes = value; - if (!prefixes && !namespaces) { - namespaces = true; - } - } else if (name.equals(XMLNS_URIs)) { - checkNotParsing("feature", name); - uris = value; - } else { - throw new SAXNotRecognizedException("Feature: " + name); - } + if (name.equals(NAMESPACES)) { + checkNotParsing("feature", name); + namespaces = value; + if (!namespaces && !prefixes) { + prefixes = true; + } + } else if (name.equals(NAMESPACE_PREFIXES)) { + checkNotParsing("feature", name); + prefixes = value; + if (!prefixes && !namespaces) { + namespaces = true; + } + } else if (name.equals(XMLNS_URIs)) { + checkNotParsing("feature", name); + uris = value; + } else { + throw new SAXNotRecognizedException("Feature: " + name); + } } /** * Check a parser feature flag. * - * <p>The only features recognized are namespaces and + * <p>The only features recognized are namespaces and * namespace-prefixes.</p> * * @param name The feature name, as a complete URI. @@ -214,17 +214,17 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.XMLReader#setFeature */ public boolean getFeature (String name) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - if (name.equals(NAMESPACES)) { - return namespaces; - } else if (name.equals(NAMESPACE_PREFIXES)) { - return prefixes; - } else if (name.equals(XMLNS_URIs)) { - return uris; - } else { - throw new SAXNotRecognizedException("Feature: " + name); - } + if (name.equals(NAMESPACES)) { + return namespaces; + } else if (name.equals(NAMESPACE_PREFIXES)) { + return prefixes; + } else if (name.equals(XMLNS_URIs)) { + return uris; + } else { + throw new SAXNotRecognizedException("Feature: " + name); + } } @@ -242,9 +242,9 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.XMLReader#setProperty */ public void setProperty (String name, Object value) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - throw new SAXNotRecognizedException("Property: " + name); + throw new SAXNotRecognizedException("Property: " + name); } @@ -262,9 +262,9 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.XMLReader#getProperty */ public Object getProperty (String name) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - throw new SAXNotRecognizedException("Property: " + name); + throw new SAXNotRecognizedException("Property: " + name); } @@ -276,7 +276,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public void setEntityResolver (EntityResolver resolver) { - entityResolver = resolver; + entityResolver = resolver; } @@ -288,7 +288,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public EntityResolver getEntityResolver () { - return entityResolver; + return entityResolver; } @@ -300,7 +300,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public void setDTDHandler (DTDHandler handler) { - dtdHandler = handler; + dtdHandler = handler; } @@ -312,7 +312,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public DTDHandler getDTDHandler () { - return dtdHandler; + return dtdHandler; } @@ -324,7 +324,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public void setContentHandler (ContentHandler handler) { - contentHandler = handler; + contentHandler = handler; } @@ -336,7 +336,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public ContentHandler getContentHandler () { - return contentHandler; + return contentHandler; } @@ -348,7 +348,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public void setErrorHandler (ErrorHandler handler) { - errorHandler = handler; + errorHandler = handler; } @@ -360,7 +360,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public ErrorHandler getErrorHandler () { - return errorHandler; + return errorHandler; } @@ -376,9 +376,9 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.Parser#parse(java.lang.String) */ public void parse (String systemId) - throws IOException, SAXException + throws IOException, SAXException { - parse(new InputSource(systemId)); + parse(new InputSource(systemId)); } @@ -394,19 +394,19 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource) */ public void parse (InputSource input) - throws IOException, SAXException + throws IOException, SAXException { - if (parsing) { - throw new SAXException("Parser is already in use"); - } - setupParser(); - parsing = true; - try { - parser.parse(input); - } finally { - parsing = false; - } - parsing = false; + if (parsing) { + throw new SAXException("Parser is already in use"); + } + setupParser(); + parsing = true; + try { + parser.parse(input); + } finally { + parsing = false; + } + parsing = false; } @@ -425,10 +425,10 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ public void setDocumentLocator (Locator locator) { - this.locator = locator; - if (contentHandler != null) { - contentHandler.setDocumentLocator(locator); - } + this.locator = locator; + if (contentHandler != null) { + contentHandler.setDocumentLocator(locator); + } } @@ -441,11 +441,11 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.DocumentHandler#startDocument */ public void startDocument () - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.startDocument(); - } + if (contentHandler != null) { + contentHandler.startDocument(); + } } @@ -458,11 +458,11 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.DocumentHandler#endDocument */ public void endDocument () - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.endDocument(); - } + if (contentHandler != null) { + contentHandler.endDocument(); + } } @@ -478,124 +478,124 @@ public class ParserAdapter implements XMLReader, DocumentHandler * processing exception. */ public void startElement (String qName, AttributeList qAtts) - throws SAXException + throws SAXException { - // These are exceptions from the - // first pass; they should be - // ignored if there's a second pass, - // but reported otherwise. - Vector exceptions = null; - - // If we're not doing Namespace - // processing, dispatch this quickly. - if (!namespaces) { - if (contentHandler != null) { - attAdapter.setAttributeList(qAtts); - contentHandler.startElement("", "", qName.intern(), - attAdapter); - } - return; - } - - - // OK, we're doing Namespace processing. - nsSupport.pushContext(); - int length = qAtts.getLength(); - - // First pass: handle NS decls - for (int i = 0; i < length; i++) { - String attQName = qAtts.getName(i); - - if (!attQName.startsWith("xmlns")) - continue; - // Could be a declaration... - String prefix; - int n = attQName.indexOf(':'); - - // xmlns=... - if (n == -1 && attQName.length () == 5) { - prefix = ""; - } else if (n != 5) { - // XML namespaces spec doesn't discuss "xmlnsf:oo" - // (and similarly named) attributes ... at most, warn - continue; - } else // xmlns:foo=... - prefix = attQName.substring(n+1); - - String value = qAtts.getValue(i); - if (!nsSupport.declarePrefix(prefix, value)) { - reportError("Illegal Namespace prefix: " + prefix); - continue; - } - if (contentHandler != null) - contentHandler.startPrefixMapping(prefix, value); - } - - // Second pass: copy all relevant - // attributes into the SAX2 AttributeList - // using updated prefix bindings - atts.clear(); - for (int i = 0; i < length; i++) { - String attQName = qAtts.getName(i); - String type = qAtts.getType(i); - String value = qAtts.getValue(i); - - // Declaration? - if (attQName.startsWith("xmlns")) { - String prefix; - int n = attQName.indexOf(':'); - - if (n == -1 && attQName.length () == 5) { - prefix = ""; - } else if (n != 5) { - // XML namespaces spec doesn't discuss "xmlnsf:oo" - // (and similarly named) attributes ... ignore - prefix = null; - } else { - prefix = attQName.substring(6); - } - // Yes, decl: report or prune - if (prefix != null) { - if (prefixes) { - if (uris) - // note funky case: localname can be null - // when declaring the default prefix, and - // yet the uri isn't null. - atts.addAttribute (nsSupport.XMLNS, prefix, - attQName.intern(), type, value); - else - atts.addAttribute ("", "", - attQName.intern(), type, value); - } - continue; - } - } - - // Not a declaration -- report - try { - String attName[] = processName(attQName, true, true); - atts.addAttribute(attName[0], attName[1], attName[2], - type, value); - } catch (SAXException e) { - if (exceptions == null) - exceptions = new Vector(); - exceptions.addElement(e); - atts.addAttribute("", attQName, attQName, type, value); - } - } - - // now handle the deferred exception reports - if (exceptions != null && errorHandler != null) { - for (int i = 0; i < exceptions.size(); i++) - errorHandler.error((SAXParseException) - (exceptions.elementAt(i))); - } - - // OK, finally report the event. - if (contentHandler != null) { - String name[] = processName(qName, false, false); - contentHandler.startElement(name[0], name[1], name[2], atts); - } + // These are exceptions from the + // first pass; they should be + // ignored if there's a second pass, + // but reported otherwise. + Vector exceptions = null; + + // If we're not doing Namespace + // processing, dispatch this quickly. + if (!namespaces) { + if (contentHandler != null) { + attAdapter.setAttributeList(qAtts); + contentHandler.startElement("", "", qName.intern(), + attAdapter); + } + return; + } + + + // OK, we're doing Namespace processing. + nsSupport.pushContext(); + int length = qAtts.getLength(); + + // First pass: handle NS decls + for (int i = 0; i < length; i++) { + String attQName = qAtts.getName(i); + + if (!attQName.startsWith("xmlns")) + continue; + // Could be a declaration... + String prefix; + int n = attQName.indexOf(':'); + + // xmlns=... + if (n == -1 && attQName.length () == 5) { + prefix = ""; + } else if (n != 5) { + // XML namespaces spec doesn't discuss "xmlnsf:oo" + // (and similarly named) attributes ... at most, warn + continue; + } else // xmlns:foo=... + prefix = attQName.substring(n+1); + + String value = qAtts.getValue(i); + if (!nsSupport.declarePrefix(prefix, value)) { + reportError("Illegal Namespace prefix: " + prefix); + continue; + } + if (contentHandler != null) + contentHandler.startPrefixMapping(prefix, value); + } + + // Second pass: copy all relevant + // attributes into the SAX2 AttributeList + // using updated prefix bindings + atts.clear(); + for (int i = 0; i < length; i++) { + String attQName = qAtts.getName(i); + String type = qAtts.getType(i); + String value = qAtts.getValue(i); + + // Declaration? + if (attQName.startsWith("xmlns")) { + String prefix; + int n = attQName.indexOf(':'); + + if (n == -1 && attQName.length () == 5) { + prefix = ""; + } else if (n != 5) { + // XML namespaces spec doesn't discuss "xmlnsf:oo" + // (and similarly named) attributes ... ignore + prefix = null; + } else { + prefix = attQName.substring(6); + } + // Yes, decl: report or prune + if (prefix != null) { + if (prefixes) { + if (uris) + // note funky case: localname can be null + // when declaring the default prefix, and + // yet the uri isn't null. + atts.addAttribute (nsSupport.XMLNS, prefix, + attQName.intern(), type, value); + else + atts.addAttribute ("", "", + attQName.intern(), type, value); + } + continue; + } + } + + // Not a declaration -- report + try { + String attName[] = processName(attQName, true, true); + atts.addAttribute(attName[0], attName[1], attName[2], + type, value); + } catch (SAXException e) { + if (exceptions == null) + exceptions = new Vector(); + exceptions.addElement(e); + atts.addAttribute("", attQName, attQName, type, value); + } + } + + // now handle the deferred exception reports + if (exceptions != null && errorHandler != null) { + for (int i = 0; i < exceptions.size(); i++) + errorHandler.error((SAXParseException) + (exceptions.elementAt(i))); + } + + // OK, finally report the event. + if (contentHandler != null) { + String name[] = processName(qName, false, false); + contentHandler.startElement(name[0], name[1], name[2], atts); + } } @@ -609,28 +609,28 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.DocumentHandler#endElement */ public void endElement (String qName) - throws SAXException + throws SAXException { - // If we're not doing Namespace - // processing, dispatch this quickly. - if (!namespaces) { - if (contentHandler != null) { - contentHandler.endElement("", "", qName.intern()); - } - return; - } - - // Split the name. - String names[] = processName(qName, false, false); - if (contentHandler != null) { - contentHandler.endElement(names[0], names[1], names[2]); - Enumeration prefixes = nsSupport.getDeclaredPrefixes(); - while (prefixes.hasMoreElements()) { - String prefix = (String)prefixes.nextElement(); - contentHandler.endPrefixMapping(prefix); - } - } - nsSupport.popContext(); + // If we're not doing Namespace + // processing, dispatch this quickly. + if (!namespaces) { + if (contentHandler != null) { + contentHandler.endElement("", "", qName.intern()); + } + return; + } + + // Split the name. + String names[] = processName(qName, false, false); + if (contentHandler != null) { + contentHandler.endElement(names[0], names[1], names[2]); + Enumeration prefixes = nsSupport.getDeclaredPrefixes(); + while (prefixes.hasMoreElements()) { + String prefix = (String)prefixes.nextElement(); + contentHandler.endPrefixMapping(prefix); + } + } + nsSupport.popContext(); } @@ -646,11 +646,11 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.DocumentHandler#characters */ public void characters (char ch[], int start, int length) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.characters(ch, start, length); - } + if (contentHandler != null) { + contentHandler.characters(ch, start, length); + } } @@ -666,11 +666,11 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.DocumentHandler#ignorableWhitespace */ public void ignorableWhitespace (char ch[], int start, int length) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.ignorableWhitespace(ch, start, length); - } + if (contentHandler != null) { + contentHandler.ignorableWhitespace(ch, start, length); + } } @@ -685,15 +685,15 @@ public class ParserAdapter implements XMLReader, DocumentHandler * @see org.xml.sax.DocumentHandler#processingInstruction */ public void processingInstruction (String target, String data) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.processingInstruction(target, data); - } + if (contentHandler != null) { + contentHandler.processingInstruction(target, data); + } } - + //////////////////////////////////////////////////////////////////// // Internal utility methods. //////////////////////////////////////////////////////////////////// @@ -704,25 +704,25 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ private void setupParser () { - // catch an illegal "nonsense" state. - if (!prefixes && !namespaces) - throw new IllegalStateException (); - - nsSupport.reset(); - if (uris) - nsSupport.setNamespaceDeclUris (true); - - if (entityResolver != null) { - parser.setEntityResolver(entityResolver); - } - if (dtdHandler != null) { - parser.setDTDHandler(dtdHandler); - } - if (errorHandler != null) { - parser.setErrorHandler(errorHandler); - } - parser.setDocumentHandler(this); - locator = null; + // catch an illegal "nonsense" state. + if (!prefixes && !namespaces) + throw new IllegalStateException (); + + nsSupport.reset(); + if (uris) + nsSupport.setNamespaceDeclUris (true); + + if (entityResolver != null) { + parser.setEntityResolver(entityResolver); + } + if (dtdHandler != null) { + parser.setDTDHandler(dtdHandler); + } + if (errorHandler != null) { + parser.setErrorHandler(errorHandler); + } + parser.setDocumentHandler(this); + locator = null; } @@ -740,20 +740,20 @@ public class ParserAdapter implements XMLReader, DocumentHandler * an exception if there is an error callback. */ private String [] processName (String qName, boolean isAttribute, - boolean useException) - throws SAXException + boolean useException) + throws SAXException { - String parts[] = nsSupport.processName(qName, nameParts, - isAttribute); - if (parts == null) { - if (useException) - throw makeException("Undeclared prefix: " + qName); - reportError("Undeclared prefix: " + qName); - parts = new String[3]; - parts[0] = parts[1] = ""; - parts[2] = qName.intern(); - } - return parts; + String parts[] = nsSupport.processName(qName, nameParts, + isAttribute); + if (parts == null) { + if (useException) + throw makeException("Undeclared prefix: " + qName); + reportError("Undeclared prefix: " + qName); + parts = new String[3]; + parts[0] = parts[1] = ""; + parts[2] = qName.intern(); + } + return parts; } @@ -765,13 +765,13 @@ public class ParserAdapter implements XMLReader, DocumentHandler * an exception. */ void reportError (String message) - throws SAXException + throws SAXException { - if (errorHandler != null) - errorHandler.error(makeException(message)); + if (errorHandler != null) + errorHandler.error(makeException(message)); } - + /** * Construct an exception for the current context. * @@ -779,11 +779,11 @@ public class ParserAdapter implements XMLReader, DocumentHandler */ private SAXParseException makeException (String message) { - if (locator != null) { - return new SAXParseException(message, locator); - } else { - return new SAXParseException(message, null, null, -1, -1); - } + if (locator != null) { + return new SAXParseException(message, locator); + } else { + return new SAXParseException(message, null, null, -1, -1); + } } @@ -799,18 +799,18 @@ public class ParserAdapter implements XMLReader, DocumentHandler * document is currently being parsed. */ private void checkNotParsing (String type, String name) - throws SAXNotSupportedException + throws SAXNotSupportedException { - if (parsing) { - throw new SAXNotSupportedException("Cannot change " + - type + ' ' + - name + " while parsing"); - - } + if (parsing) { + throw new SAXNotSupportedException("Cannot change " + + type + ' ' + + name + " while parsing"); + + } } - + //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// @@ -825,14 +825,14 @@ public class ParserAdapter implements XMLReader, DocumentHandler private AttributesImpl atts = null; - // Features + // Features private boolean namespaces = true; private boolean prefixes = false; private boolean uris = false; - // Properties + // Properties - // Handlers + // Handlers Locator locator; EntityResolver entityResolver = null; @@ -841,7 +841,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler ErrorHandler errorHandler = null; - + //////////////////////////////////////////////////////////////////// // Inner class to wrap an AttributeList when not doing NS proc. //////////////////////////////////////////////////////////////////// @@ -855,191 +855,191 @@ public class ParserAdapter implements XMLReader, DocumentHandler * * <p>This wrapper class is used only when Namespace support * is disabled -- it provides pretty much a direct mapping - * from SAX1 to SAX2, except that names and types are + * from SAX1 to SAX2, except that names and types are * interned whenever requested.</p> */ final class AttributeListAdapter implements Attributes { - /** - * Construct a new adapter. - */ - AttributeListAdapter () - { - } - - - /** - * Set the embedded AttributeList. - * - * <p>This method must be invoked before any of the others - * can be used.</p> - * - * @param The SAX1 attribute list (with qnames). - */ - void setAttributeList (AttributeList qAtts) - { - this.qAtts = qAtts; - } - - - /** - * Return the length of the attribute list. - * - * @return The number of attributes in the list. - * @see org.xml.sax.Attributes#getLength - */ - public int getLength () - { - return qAtts.getLength(); - } - - - /** - * Return the Namespace URI of the specified attribute. - * - * @param The attribute's index. - * @return Always the empty string. - * @see org.xml.sax.Attributes#getURI - */ - public String getURI (int i) - { - return ""; - } - - - /** - * Return the local name of the specified attribute. - * - * @param The attribute's index. - * @return Always the empty string. - * @see org.xml.sax.Attributes#getLocalName - */ - public String getLocalName (int i) - { - return ""; - } - - - /** - * Return the qualified (prefixed) name of the specified attribute. - * - * @param The attribute's index. - * @return The attribute's qualified name, internalized. - */ - public String getQName (int i) - { - return qAtts.getName(i).intern(); - } - - - /** - * Return the type of the specified attribute. - * - * @param The attribute's index. - * @return The attribute's type as an internalized string. - */ - public String getType (int i) - { - return qAtts.getType(i).intern(); - } - - - /** - * Return the value of the specified attribute. - * - * @param The attribute's index. - * @return The attribute's value. - */ - public String getValue (int i) - { - return qAtts.getValue(i); - } - - - /** - * Look up an attribute index by Namespace name. - * - * @param uri The Namespace URI or the empty string. - * @param localName The local name. - * @return The attributes index, or -1 if none was found. - * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String) - */ - public int getIndex (String uri, String localName) - { - return -1; - } - - - /** - * Look up an attribute index by qualified (prefixed) name. - * - * @param qName The qualified name. - * @return The attributes index, or -1 if none was found. - * @see org.xml.sax.Attributes#getIndex(java.lang.String) - */ - public int getIndex (String qName) - { - int max = atts.getLength(); - for (int i = 0; i < max; i++) { - if (qAtts.getName(i).equals(qName)) { - return i; - } - } - return -1; - } - - - /** - * Look up the type of an attribute by Namespace name. - * - * @param uri The Namespace URI - * @param localName The local name. - * @return The attribute's type as an internalized string. - */ - public String getType (String uri, String localName) - { - return null; - } - - - /** - * Look up the type of an attribute by qualified (prefixed) name. - * - * @param qName The qualified name. - * @return The attribute's type as an internalized string. - */ - public String getType (String qName) - { - return qAtts.getType(qName).intern(); - } - - - /** - * Look up the value of an attribute by Namespace name. - * - * @param uri The Namespace URI - * @param localName The local name. - * @return The attribute's value. - */ - public String getValue (String uri, String localName) - { - return null; - } - - - /** - * Look up the value of an attribute by qualified (prefixed) name. - * - * @param qName The qualified name. - * @return The attribute's value. - */ - public String getValue (String qName) - { - return qAtts.getValue(qName); - } - - private AttributeList qAtts; + /** + * Construct a new adapter. + */ + AttributeListAdapter () + { + } + + + /** + * Set the embedded AttributeList. + * + * <p>This method must be invoked before any of the others + * can be used.</p> + * + * @param The SAX1 attribute list (with qnames). + */ + void setAttributeList (AttributeList qAtts) + { + this.qAtts = qAtts; + } + + + /** + * Return the length of the attribute list. + * + * @return The number of attributes in the list. + * @see org.xml.sax.Attributes#getLength + */ + public int getLength () + { + return qAtts.getLength(); + } + + + /** + * Return the Namespace URI of the specified attribute. + * + * @param The attribute's index. + * @return Always the empty string. + * @see org.xml.sax.Attributes#getURI + */ + public String getURI (int i) + { + return ""; + } + + + /** + * Return the local name of the specified attribute. + * + * @param The attribute's index. + * @return Always the empty string. + * @see org.xml.sax.Attributes#getLocalName + */ + public String getLocalName (int i) + { + return ""; + } + + + /** + * Return the qualified (prefixed) name of the specified attribute. + * + * @param The attribute's index. + * @return The attribute's qualified name, internalized. + */ + public String getQName (int i) + { + return qAtts.getName(i).intern(); + } + + + /** + * Return the type of the specified attribute. + * + * @param The attribute's index. + * @return The attribute's type as an internalized string. + */ + public String getType (int i) + { + return qAtts.getType(i).intern(); + } + + + /** + * Return the value of the specified attribute. + * + * @param The attribute's index. + * @return The attribute's value. + */ + public String getValue (int i) + { + return qAtts.getValue(i); + } + + + /** + * Look up an attribute index by Namespace name. + * + * @param uri The Namespace URI or the empty string. + * @param localName The local name. + * @return The attributes index, or -1 if none was found. + * @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String) + */ + public int getIndex (String uri, String localName) + { + return -1; + } + + + /** + * Look up an attribute index by qualified (prefixed) name. + * + * @param qName The qualified name. + * @return The attributes index, or -1 if none was found. + * @see org.xml.sax.Attributes#getIndex(java.lang.String) + */ + public int getIndex (String qName) + { + int max = atts.getLength(); + for (int i = 0; i < max; i++) { + if (qAtts.getName(i).equals(qName)) { + return i; + } + } + return -1; + } + + + /** + * Look up the type of an attribute by Namespace name. + * + * @param uri The Namespace URI + * @param localName The local name. + * @return The attribute's type as an internalized string. + */ + public String getType (String uri, String localName) + { + return null; + } + + + /** + * Look up the type of an attribute by qualified (prefixed) name. + * + * @param qName The qualified name. + * @return The attribute's type as an internalized string. + */ + public String getType (String qName) + { + return qAtts.getType(qName).intern(); + } + + + /** + * Look up the value of an attribute by Namespace name. + * + * @param uri The Namespace URI + * @param localName The local name. + * @return The attribute's value. + */ + public String getValue (String uri, String localName) + { + return null; + } + + + /** + * Look up the value of an attribute by qualified (prefixed) name. + * + * @param qName The qualified name. + * @return The attribute's value. + */ + public String getValue (String qName) + { + return qAtts.getValue(qName); + } + + private AttributeList qAtts; } } diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java index 23139981088..ec822b540cc 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/ParserFactory.java @@ -47,16 +47,16 @@ import org.xml.sax.Parser; * @version 2.0.1 (sax2r2) */ public class ParserFactory { - - + + /** * Private null constructor. */ private ParserFactory () { } - - + + /** * Create a new SAX parser using the `org.xml.sax.parser' system property. * @@ -79,21 +79,21 @@ public class ParserFactory { * @see org.xml.sax.Parser */ public static Parser makeParser () - throws ClassNotFoundException, - IllegalAccessException, - InstantiationException, - NullPointerException, - ClassCastException + throws ClassNotFoundException, + IllegalAccessException, + InstantiationException, + NullPointerException, + ClassCastException { - String className = System.getProperty("org.xml.sax.parser"); - if (className == null) { - throw new NullPointerException("No value for sax.parser property"); - } else { - return makeParser(className); - } + String className = System.getProperty("org.xml.sax.parser"); + if (className == null) { + throw new NullPointerException("No value for sax.parser property"); + } else { + return makeParser(className); + } } - - + + /** * Create a new SAX parser object using the class name provided. * @@ -116,14 +116,13 @@ public class ParserFactory { * @see org.xml.sax.Parser */ public static Parser makeParser (String className) - throws ClassNotFoundException, - IllegalAccessException, - InstantiationException, - ClassCastException + throws ClassNotFoundException, + IllegalAccessException, + InstantiationException, + ClassCastException { - return (Parser) NewInstance.newInstance ( - NewInstance.getClassLoader (), className); + return (Parser) NewInstance.newInstance ( + NewInstance.getClassLoader (), className); } - -} +} diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java index 64ff0a4cf88..4b4aba092b3 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLFilterImpl.java @@ -54,7 +54,7 @@ public class XMLFilterImpl implements XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler { - + //////////////////////////////////////////////////////////////////// // Constructors. //////////////////////////////////////////////////////////////////// @@ -74,7 +74,7 @@ public class XMLFilterImpl */ public XMLFilterImpl () { - super(); + super(); } @@ -87,11 +87,11 @@ public class XMLFilterImpl public XMLFilterImpl (XMLReader parent) { super(); - setParent(parent); + setParent(parent); } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.XMLFilter. //////////////////////////////////////////////////////////////////// @@ -100,8 +100,8 @@ public class XMLFilterImpl /** * Set the parent reader. * - * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which - * this filter will obtain its events and to which it will pass its + * <p>This is the {@link org.xml.sax.XMLReader XMLReader} from which + * this filter will obtain its events and to which it will pass its * configuration requests. The parent may itself be another filter.</p> * * <p>If there is no parent reader set, any attempt to parse @@ -112,7 +112,7 @@ public class XMLFilterImpl */ public void setParent (XMLReader parent) { - this.parent = parent; + this.parent = parent; } @@ -124,11 +124,11 @@ public class XMLFilterImpl */ public XMLReader getParent () { - return parent; + return parent; } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.XMLReader. //////////////////////////////////////////////////////////////////// @@ -144,17 +144,17 @@ public class XMLFilterImpl * @exception org.xml.sax.SAXNotRecognizedException If the feature * value can't be assigned or retrieved from the parent. * @exception org.xml.sax.SAXNotSupportedException When the - * parent recognizes the feature name but + * parent recognizes the feature name but * cannot set the requested value. */ public void setFeature (String name, boolean value) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - if (parent != null) { - parent.setFeature(name, value); - } else { - throw new SAXNotRecognizedException("Feature: " + name); - } + if (parent != null) { + parent.setFeature(name, value); + } else { + throw new SAXNotRecognizedException("Feature: " + name); + } } @@ -168,17 +168,17 @@ public class XMLFilterImpl * @exception org.xml.sax.SAXNotRecognizedException If the feature * value can't be assigned or retrieved from the parent. * @exception org.xml.sax.SAXNotSupportedException When the - * parent recognizes the feature name but + * parent recognizes the feature name but * cannot determine its value at this time. */ public boolean getFeature (String name) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - if (parent != null) { - return parent.getFeature(name); - } else { - throw new SAXNotRecognizedException("Feature: " + name); - } + if (parent != null) { + return parent.getFeature(name); + } else { + throw new SAXNotRecognizedException("Feature: " + name); + } } @@ -192,17 +192,17 @@ public class XMLFilterImpl * @exception org.xml.sax.SAXNotRecognizedException If the property * value can't be assigned or retrieved from the parent. * @exception org.xml.sax.SAXNotSupportedException When the - * parent recognizes the property name but + * parent recognizes the property name but * cannot set the requested value. */ public void setProperty (String name, Object value) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - if (parent != null) { - parent.setProperty(name, value); - } else { - throw new SAXNotRecognizedException("Property: " + name); - } + if (parent != null) { + parent.setProperty(name, value); + } else { + throw new SAXNotRecognizedException("Property: " + name); + } } @@ -214,17 +214,17 @@ public class XMLFilterImpl * @exception org.xml.sax.SAXNotRecognizedException If the property * value can't be assigned or retrieved from the parent. * @exception org.xml.sax.SAXNotSupportedException When the - * parent recognizes the property name but + * parent recognizes the property name but * cannot determine its value at this time. */ public Object getProperty (String name) - throws SAXNotRecognizedException, SAXNotSupportedException + throws SAXNotRecognizedException, SAXNotSupportedException { - if (parent != null) { - return parent.getProperty(name); - } else { - throw new SAXNotRecognizedException("Property: " + name); - } + if (parent != null) { + return parent.getProperty(name); + } else { + throw new SAXNotRecognizedException("Property: " + name); + } } @@ -235,7 +235,7 @@ public class XMLFilterImpl */ public void setEntityResolver (EntityResolver resolver) { - entityResolver = resolver; + entityResolver = resolver; } @@ -246,7 +246,7 @@ public class XMLFilterImpl */ public EntityResolver getEntityResolver () { - return entityResolver; + return entityResolver; } @@ -257,7 +257,7 @@ public class XMLFilterImpl */ public void setDTDHandler (DTDHandler handler) { - dtdHandler = handler; + dtdHandler = handler; } @@ -268,7 +268,7 @@ public class XMLFilterImpl */ public DTDHandler getDTDHandler () { - return dtdHandler; + return dtdHandler; } @@ -279,7 +279,7 @@ public class XMLFilterImpl */ public void setContentHandler (ContentHandler handler) { - contentHandler = handler; + contentHandler = handler; } @@ -290,7 +290,7 @@ public class XMLFilterImpl */ public ContentHandler getContentHandler () { - return contentHandler; + return contentHandler; } @@ -301,7 +301,7 @@ public class XMLFilterImpl */ public void setErrorHandler (ErrorHandler handler) { - errorHandler = handler; + errorHandler = handler; } @@ -312,7 +312,7 @@ public class XMLFilterImpl */ public ErrorHandler getErrorHandler () { - return errorHandler; + return errorHandler; } @@ -327,10 +327,10 @@ public class XMLFilterImpl * supplied by the application. */ public void parse (InputSource input) - throws SAXException, IOException + throws SAXException, IOException { - setupParse(); - parent.parse(input); + setupParse(); + parent.parse(input); } @@ -345,13 +345,13 @@ public class XMLFilterImpl * supplied by the application. */ public void parse (String systemId) - throws SAXException, IOException + throws SAXException, IOException { - parse(new InputSource(systemId)); + parse(new InputSource(systemId)); } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.EntityResolver. //////////////////////////////////////////////////////////////////// @@ -370,22 +370,22 @@ public class XMLFilterImpl * new InputSource. */ public InputSource resolveEntity (String publicId, String systemId) - throws SAXException, IOException + throws SAXException, IOException { - if (entityResolver != null) { - return entityResolver.resolveEntity(publicId, systemId); - } else { - return null; - } + if (entityResolver != null) { + return entityResolver.resolveEntity(publicId, systemId); + } else { + return null; + } } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.DTDHandler. //////////////////////////////////////////////////////////////////// - + /** * Filter a notation declaration event. * @@ -396,14 +396,14 @@ public class XMLFilterImpl * an exception during processing. */ public void notationDecl (String name, String publicId, String systemId) - throws SAXException + throws SAXException { - if (dtdHandler != null) { - dtdHandler.notationDecl(name, publicId, systemId); - } + if (dtdHandler != null) { + dtdHandler.notationDecl(name, publicId, systemId); + } } - + /** * Filter an unparsed entity declaration event. * @@ -415,17 +415,17 @@ public class XMLFilterImpl * an exception during processing. */ public void unparsedEntityDecl (String name, String publicId, - String systemId, String notationName) - throws SAXException + String systemId, String notationName) + throws SAXException { - if (dtdHandler != null) { - dtdHandler.unparsedEntityDecl(name, publicId, systemId, - notationName); - } + if (dtdHandler != null) { + dtdHandler.unparsedEntityDecl(name, publicId, systemId, + notationName); + } } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.ContentHandler. //////////////////////////////////////////////////////////////////// @@ -438,10 +438,10 @@ public class XMLFilterImpl */ public void setDocumentLocator (Locator locator) { - this.locator = locator; - if (contentHandler != null) { - contentHandler.setDocumentLocator(locator); - } + this.locator = locator; + if (contentHandler != null) { + contentHandler.setDocumentLocator(locator); + } } @@ -452,11 +452,11 @@ public class XMLFilterImpl * an exception during processing. */ public void startDocument () - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.startDocument(); - } + if (contentHandler != null) { + contentHandler.startDocument(); + } } @@ -467,11 +467,11 @@ public class XMLFilterImpl * an exception during processing. */ public void endDocument () - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.endDocument(); - } + if (contentHandler != null) { + contentHandler.endDocument(); + } } @@ -484,11 +484,11 @@ public class XMLFilterImpl * an exception during processing. */ public void startPrefixMapping (String prefix, String uri) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.startPrefixMapping(prefix, uri); - } + if (contentHandler != null) { + contentHandler.startPrefixMapping(prefix, uri); + } } @@ -500,11 +500,11 @@ public class XMLFilterImpl * an exception during processing. */ public void endPrefixMapping (String prefix) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.endPrefixMapping(prefix); - } + if (contentHandler != null) { + contentHandler.endPrefixMapping(prefix); + } } @@ -520,12 +520,12 @@ public class XMLFilterImpl * an exception during processing. */ public void startElement (String uri, String localName, String qName, - Attributes atts) - throws SAXException + Attributes atts) + throws SAXException { - if (contentHandler != null) { - contentHandler.startElement(uri, localName, qName, atts); - } + if (contentHandler != null) { + contentHandler.startElement(uri, localName, qName, atts); + } } @@ -540,11 +540,11 @@ public class XMLFilterImpl * an exception during processing. */ public void endElement (String uri, String localName, String qName) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.endElement(uri, localName, qName); - } + if (contentHandler != null) { + contentHandler.endElement(uri, localName, qName); + } } @@ -558,11 +558,11 @@ public class XMLFilterImpl * an exception during processing. */ public void characters (char ch[], int start, int length) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.characters(ch, start, length); - } + if (contentHandler != null) { + contentHandler.characters(ch, start, length); + } } @@ -576,11 +576,11 @@ public class XMLFilterImpl * an exception during processing. */ public void ignorableWhitespace (char ch[], int start, int length) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.ignorableWhitespace(ch, start, length); - } + if (contentHandler != null) { + contentHandler.ignorableWhitespace(ch, start, length); + } } @@ -593,11 +593,11 @@ public class XMLFilterImpl * an exception during processing. */ public void processingInstruction (String target, String data) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.processingInstruction(target, data); - } + if (contentHandler != null) { + contentHandler.processingInstruction(target, data); + } } @@ -609,15 +609,15 @@ public class XMLFilterImpl * an exception during processing. */ public void skippedEntity (String name) - throws SAXException + throws SAXException { - if (contentHandler != null) { - contentHandler.skippedEntity(name); - } + if (contentHandler != null) { + contentHandler.skippedEntity(name); + } } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.ErrorHandler. //////////////////////////////////////////////////////////////////// @@ -631,11 +631,11 @@ public class XMLFilterImpl * an exception during processing. */ public void warning (SAXParseException e) - throws SAXException + throws SAXException { - if (errorHandler != null) { - errorHandler.warning(e); - } + if (errorHandler != null) { + errorHandler.warning(e); + } } @@ -647,11 +647,11 @@ public class XMLFilterImpl * an exception during processing. */ public void error (SAXParseException e) - throws SAXException + throws SAXException { - if (errorHandler != null) { - errorHandler.error(e); - } + if (errorHandler != null) { + errorHandler.error(e); + } } @@ -663,15 +663,15 @@ public class XMLFilterImpl * an exception during processing. */ public void fatalError (SAXParseException e) - throws SAXException + throws SAXException { - if (errorHandler != null) { - errorHandler.fatalError(e); - } + if (errorHandler != null) { + errorHandler.fatalError(e); + } } - + //////////////////////////////////////////////////////////////////// // Internal methods. //////////////////////////////////////////////////////////////////// @@ -681,22 +681,22 @@ public class XMLFilterImpl * Set up before a parse. * * <p>Before every parse, check whether the parent is - * non-null, and re-register the filter for all of the + * non-null, and re-register the filter for all of the * events.</p> */ private void setupParse () { - if (parent == null) { - throw new NullPointerException("No parent for filter"); - } - parent.setEntityResolver(this); - parent.setDTDHandler(this); - parent.setContentHandler(this); - parent.setErrorHandler(this); + if (parent == null) { + throw new NullPointerException("No parent for filter"); + } + parent.setEntityResolver(this); + parent.setDTDHandler(this); + parent.setContentHandler(this); + parent.setErrorHandler(this); } - + //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java index d2214747d74..8ab909a7754 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderAdapter.java @@ -9,7 +9,7 @@ package org.xml.sax.helpers; import java.io.IOException; import java.util.Locale; -import org.xml.sax.Parser; // deprecated +import org.xml.sax.Parser; // deprecated import org.xml.sax.Locator; import org.xml.sax.InputSource; import org.xml.sax.AttributeList; // deprecated @@ -36,11 +36,11 @@ import org.xml.sax.SAXNotSupportedException; * </blockquote> * * <p>This class wraps a SAX2 {@link org.xml.sax.XMLReader XMLReader} - * and makes it act as a SAX1 {@link org.xml.sax.Parser Parser}. The XMLReader - * must support a true value for the + * and makes it act as a SAX1 {@link org.xml.sax.Parser Parser}. The XMLReader + * must support a true value for the * http://xml.org/sax/features/namespace-prefixes property or parsing will fail - * with a {@link org.xml.sax.SAXException SAXException}; if the XMLReader - * supports a false value for the http://xml.org/sax/features/namespaces + * with a {@link org.xml.sax.SAXException SAXException}; if the XMLReader + * supports a false value for the http://xml.org/sax/features/namespaces * property, that will also be used to improve efficiency.</p> * * @since SAX 2.0 @@ -52,7 +52,7 @@ import org.xml.sax.SAXNotSupportedException; public class XMLReaderAdapter implements Parser, ContentHandler { - + //////////////////////////////////////////////////////////////////// // Constructor. //////////////////////////////////////////////////////////////////// @@ -71,7 +71,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler public XMLReaderAdapter () throws SAXException { - setup(XMLReaderFactory.createXMLReader()); + setup(XMLReaderFactory.createXMLReader()); } @@ -87,7 +87,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ public XMLReaderAdapter (XMLReader xmlReader) { - setup(xmlReader); + setup(xmlReader); } @@ -99,11 +99,11 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ private void setup (XMLReader xmlReader) { - if (xmlReader == null) { - throw new NullPointerException("XMLReader must not be null"); - } - this.xmlReader = xmlReader; - qAtts = new AttributesAdapter(); + if (xmlReader == null) { + throw new NullPointerException("XMLReader must not be null"); + } + this.xmlReader = xmlReader; + qAtts = new AttributesAdapter(); } @@ -124,9 +124,9 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @exception org.xml.sax.SAXException Thrown unless overridden. */ public void setLocale (Locale locale) - throws SAXException + throws SAXException { - throw new SAXNotSupportedException("setLocale not supported"); + throw new SAXNotSupportedException("setLocale not supported"); } @@ -138,7 +138,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ public void setEntityResolver (EntityResolver resolver) { - xmlReader.setEntityResolver(resolver); + xmlReader.setEntityResolver(resolver); } @@ -150,7 +150,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ public void setDTDHandler (DTDHandler handler) { - xmlReader.setDTDHandler(handler); + xmlReader.setDTDHandler(handler); } @@ -165,7 +165,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ public void setDocumentHandler (DocumentHandler handler) { - documentHandler = handler; + documentHandler = handler; } @@ -177,7 +177,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ public void setErrorHandler (ErrorHandler handler) { - xmlReader.setErrorHandler(handler); + xmlReader.setErrorHandler(handler); } @@ -185,7 +185,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler * Parse the document. * * <p>This method will throw an exception if the embedded - * XMLReader does not support the + * XMLReader does not support the * http://xml.org/sax/features/namespace-prefixes property.</p> * * @param systemId The absolute URL of the document. @@ -197,9 +197,9 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.Parser#parse(java.lang.String) */ public void parse (String systemId) - throws IOException, SAXException + throws IOException, SAXException { - parse(new InputSource(systemId)); + parse(new InputSource(systemId)); } @@ -207,7 +207,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler * Parse the document. * * <p>This method will throw an exception if the embedded - * XMLReader does not support the + * XMLReader does not support the * http://xml.org/sax/features/namespace-prefixes property.</p> * * @param input An input source for the document. @@ -219,10 +219,10 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.Parser#parse(org.xml.sax.InputSource) */ public void parse (InputSource input) - throws IOException, SAXException + throws IOException, SAXException { - setupXMLReader(); - xmlReader.parse(input); + setupXMLReader(); + xmlReader.parse(input); } @@ -230,20 +230,20 @@ public class XMLReaderAdapter implements Parser, ContentHandler * Set up the XML reader. */ private void setupXMLReader () - throws SAXException + throws SAXException { - xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); - try { - xmlReader.setFeature("http://xml.org/sax/features/namespaces", - false); - } catch (SAXException e) { - // NO OP: it's just extra information, and we can ignore it - } - xmlReader.setContentHandler(this); + xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); + try { + xmlReader.setFeature("http://xml.org/sax/features/namespaces", + false); + } catch (SAXException e) { + // NO OP: it's just extra information, and we can ignore it + } + xmlReader.setContentHandler(this); } - + //////////////////////////////////////////////////////////////////// // Implementation of org.xml.sax.ContentHandler. //////////////////////////////////////////////////////////////////// @@ -257,8 +257,8 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ public void setDocumentLocator (Locator locator) { - if (documentHandler != null) - documentHandler.setDocumentLocator(locator); + if (documentHandler != null) + documentHandler.setDocumentLocator(locator); } @@ -270,10 +270,10 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.ContentHandler#startDocument */ public void startDocument () - throws SAXException + throws SAXException { - if (documentHandler != null) - documentHandler.startDocument(); + if (documentHandler != null) + documentHandler.startDocument(); } @@ -285,10 +285,10 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.ContentHandler#endDocument */ public void endDocument () - throws SAXException + throws SAXException { - if (documentHandler != null) - documentHandler.endDocument(); + if (documentHandler != null) + documentHandler.endDocument(); } @@ -327,13 +327,13 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.ContentHandler#endDocument */ public void startElement (String uri, String localName, - String qName, Attributes atts) - throws SAXException + String qName, Attributes atts) + throws SAXException { - if (documentHandler != null) { - qAtts.setAttributes(atts); - documentHandler.startElement(qName, qAtts); - } + if (documentHandler != null) { + qAtts.setAttributes(atts); + documentHandler.startElement(qName, qAtts); + } } @@ -348,11 +348,11 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.ContentHandler#endElement */ public void endElement (String uri, String localName, - String qName) - throws SAXException + String qName) + throws SAXException { - if (documentHandler != null) - documentHandler.endElement(qName); + if (documentHandler != null) + documentHandler.endElement(qName); } @@ -367,10 +367,10 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.ContentHandler#characters */ public void characters (char ch[], int start, int length) - throws SAXException + throws SAXException { - if (documentHandler != null) - documentHandler.characters(ch, start, length); + if (documentHandler != null) + documentHandler.characters(ch, start, length); } @@ -385,10 +385,10 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.ContentHandler#ignorableWhitespace */ public void ignorableWhitespace (char ch[], int start, int length) - throws SAXException + throws SAXException { - if (documentHandler != null) - documentHandler.ignorableWhitespace(ch, start, length); + if (documentHandler != null) + documentHandler.ignorableWhitespace(ch, start, length); } @@ -402,10 +402,10 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @see org.xml.sax.ContentHandler#processingInstruction */ public void processingInstruction (String target, String data) - throws SAXException + throws SAXException { - if (documentHandler != null) - documentHandler.processingInstruction(target, data); + if (documentHandler != null) + documentHandler.processingInstruction(target, data); } @@ -417,12 +417,12 @@ public class XMLReaderAdapter implements Parser, ContentHandler * @exception org.xml.sax.SAXException Throwable by subclasses. */ public void skippedEntity (String name) - throws SAXException + throws SAXException { } - + //////////////////////////////////////////////////////////////////// // Internal state. //////////////////////////////////////////////////////////////////// @@ -432,7 +432,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler AttributesAdapter qAtts; - + //////////////////////////////////////////////////////////////////// // Internal class. //////////////////////////////////////////////////////////////////// @@ -443,94 +443,94 @@ public class XMLReaderAdapter implements Parser, ContentHandler */ final class AttributesAdapter implements AttributeList { - AttributesAdapter () - { - } - - - /** - * Set the embedded Attributes object. - * - * @param The embedded SAX2 Attributes. - */ - void setAttributes (Attributes attributes) - { - this.attributes = attributes; - } - - - /** - * Return the number of attributes. - * - * @return The length of the attribute list. - * @see org.xml.sax.AttributeList#getLength - */ - public int getLength () - { - return attributes.getLength(); - } - - - /** - * Return the qualified (prefixed) name of an attribute by position. - * - * @return The qualified name. - * @see org.xml.sax.AttributeList#getName - */ - public String getName (int i) - { - return attributes.getQName(i); - } - - - /** - * Return the type of an attribute by position. - * - * @return The type. - * @see org.xml.sax.AttributeList#getType(int) - */ - public String getType (int i) - { - return attributes.getType(i); - } - - - /** - * Return the value of an attribute by position. - * - * @return The value. - * @see org.xml.sax.AttributeList#getValue(int) - */ - public String getValue (int i) - { - return attributes.getValue(i); - } - - - /** - * Return the type of an attribute by qualified (prefixed) name. - * - * @return The type. - * @see org.xml.sax.AttributeList#getType(java.lang.String) - */ - public String getType (String qName) - { - return attributes.getType(qName); - } - - - /** - * Return the value of an attribute by qualified (prefixed) name. - * - * @return The value. - * @see org.xml.sax.AttributeList#getValue(java.lang.String) - */ - public String getValue (String qName) - { - return attributes.getValue(qName); - } - - private Attributes attributes; + AttributesAdapter () + { + } + + + /** + * Set the embedded Attributes object. + * + * @param The embedded SAX2 Attributes. + */ + void setAttributes (Attributes attributes) + { + this.attributes = attributes; + } + + + /** + * Return the number of attributes. + * + * @return The length of the attribute list. + * @see org.xml.sax.AttributeList#getLength + */ + public int getLength () + { + return attributes.getLength(); + } + + + /** + * Return the qualified (prefixed) name of an attribute by position. + * + * @return The qualified name. + * @see org.xml.sax.AttributeList#getName + */ + public String getName (int i) + { + return attributes.getQName(i); + } + + + /** + * Return the type of an attribute by position. + * + * @return The type. + * @see org.xml.sax.AttributeList#getType(int) + */ + public String getType (int i) + { + return attributes.getType(i); + } + + + /** + * Return the value of an attribute by position. + * + * @return The value. + * @see org.xml.sax.AttributeList#getValue(int) + */ + public String getValue (int i) + { + return attributes.getValue(i); + } + + + /** + * Return the type of an attribute by qualified (prefixed) name. + * + * @return The type. + * @see org.xml.sax.AttributeList#getType(java.lang.String) + */ + public String getType (String qName) + { + return attributes.getType(qName); + } + + + /** + * Return the value of an attribute by qualified (prefixed) name. + * + * @return The value. + * @see org.xml.sax.AttributeList#getValue(java.lang.String) + */ + public String getValue (String qName) + { + return attributes.getValue(qName); + } + + private Attributes attributes; } } diff --git a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java index 304f750b9cc..9a04f9b0dda 100644 --- a/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java +++ b/libjava/classpath/external/sax/org/xml/sax/helpers/XMLReaderFactory.java @@ -102,64 +102,64 @@ final public class XMLReaderFactory * @see #createXMLReader(java.lang.String) */ public static XMLReader createXMLReader () - throws SAXException + throws SAXException { - String className = null; - ClassLoader loader = NewInstance.getClassLoader (); - - // 1. try the JVM-instance-wide system property - try { className = System.getProperty (property); } - catch (RuntimeException e) { /* normally fails for applets */ } - - // 2. if that fails, try META-INF/services/ - if (className == null) { - try { - String service = "META-INF/services/" + property; - InputStream in; - BufferedReader reader; - - if (loader == null) - in = ClassLoader.getSystemResourceAsStream (service); - else - in = loader.getResourceAsStream (service); - - if (in != null) { - reader = new BufferedReader ( - new InputStreamReader (in, "UTF8")); - className = reader.readLine (); - in.close (); - } - } catch (Exception e) { - } - } - - // 3. Distro-specific fallback - if (className == null) { + String className = null; + ClassLoader loader = NewInstance.getClassLoader (); + + // 1. try the JVM-instance-wide system property + try { className = System.getProperty (property); } + catch (RuntimeException e) { /* normally fails for applets */ } + + // 2. if that fails, try META-INF/services/ + if (className == null) { + try { + String service = "META-INF/services/" + property; + InputStream in; + BufferedReader reader; + + if (loader == null) + in = ClassLoader.getSystemResourceAsStream (service); + else + in = loader.getResourceAsStream (service); + + if (in != null) { + reader = new BufferedReader ( + new InputStreamReader (in, "UTF8")); + className = reader.readLine (); + in.close (); + } + } catch (Exception e) { + } + } + + // 3. Distro-specific fallback + if (className == null) { // BEGIN DISTRIBUTION-SPECIFIC - // CLASSPATH LOCAL: have to code in the backup. - // Among other things, see PR 31303, and this thread: - // http://gcc.gnu.org/ml/java-patches/2007-q1/msg00661.html - className = "gnu.xml.stream.SAXParser"; + // CLASSPATH LOCAL: have to code in the backup. + // Among other things, see PR 31303, and this thread: + // http://gcc.gnu.org/ml/java-patches/2007-q1/msg00661.html + className = "gnu.xml.stream.SAXParser"; - // EXAMPLE: - // className = "com.example.sax.XmlReader"; - // or a $JAVA_HOME/jre/lib/*properties setting... + // EXAMPLE: + // className = "com.example.sax.XmlReader"; + // or a $JAVA_HOME/jre/lib/*properties setting... // END DISTRIBUTION-SPECIFIC - } - - // do we know the XMLReader implementation class yet? - if (className != null) - return loadClass (loader, className); - - // 4. panic -- adapt any SAX1 parser - try { - return new ParserAdapter (ParserFactory.makeParser ()); - } catch (Exception e) { - throw new SAXException ("Can't create default XMLReader; " - + "is system property org.xml.sax.driver set?"); - } + } + + // do we know the XMLReader implementation class yet? + if (className != null) + return loadClass (loader, className); + + // 4. panic -- adapt any SAX1 parser + try { + return new ParserAdapter (ParserFactory.makeParser ()); + } catch (Exception e) { + throw new SAXException ("Can't create default XMLReader; " + + "is system property org.xml.sax.driver set?"); + } } @@ -179,29 +179,29 @@ final public class XMLReaderFactory * @see #createXMLReader() */ public static XMLReader createXMLReader (String className) - throws SAXException + throws SAXException { - return loadClass (NewInstance.getClassLoader (), className); + return loadClass (NewInstance.getClassLoader (), className); } private static XMLReader loadClass (ClassLoader loader, String className) throws SAXException { - try { - return (XMLReader) NewInstance.newInstance (loader, className); - } catch (ClassNotFoundException e1) { - throw new SAXException("SAX2 driver class " + className + - " not found", e1); - } catch (IllegalAccessException e2) { - throw new SAXException("SAX2 driver class " + className + - " found but cannot be loaded", e2); - } catch (InstantiationException e3) { - throw new SAXException("SAX2 driver class " + className + - " loaded but cannot be instantiated (no empty public constructor?)", - e3); - } catch (ClassCastException e4) { - throw new SAXException("SAX2 driver class " + className + - " does not implement XMLReader", e4); - } + try { + return (XMLReader) NewInstance.newInstance (loader, className); + } catch (ClassNotFoundException e1) { + throw new SAXException("SAX2 driver class " + className + + " not found", e1); + } catch (IllegalAccessException e2) { + throw new SAXException("SAX2 driver class " + className + + " found but cannot be loaded", e2); + } catch (InstantiationException e3) { + throw new SAXException("SAX2 driver class " + className + + " loaded but cannot be instantiated (no empty public constructor?)", + e3); + } catch (ClassCastException e4) { + throw new SAXException("SAX2 driver class " + className + + " does not implement XMLReader", e4); + } } } |