Updates in javax.xml.{parsers, transform} for JAXP (Reference
Implementation) RI version 1.1.1. Javadoc fixes to SAXParser and SAXParserFactory. Misc bug fixes to javax.xml.transform classes. git-svn-id: https://svn.apache.org/repos/asf/xml/commons/trunk@225916 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
16ef154db4
commit
1a37d8fa1c
5 files changed
+42
-17
No files matched your search
+20
-12
@@ -84,15 +84,6 @@ import org.xml.sax.SAXNotSupportedException;
|
||||
* a variety of input sources. These input sources are InputStreams,
|
||||
* Files, URLs, and SAX InputSources.<p>
|
||||
*
|
||||
* This static method creates a new factory instance based
|
||||
* on a system property setting or uses the platform default
|
||||
* if no property has been defined.<p>
|
||||
*
|
||||
* The system property that controls which Factory implementation
|
||||
* to create is named <code>"javax.xml.parsers.SAXParserFactory"</code>.
|
||||
* This property names a class that is a concrete subclass of this
|
||||
* abstract class. If no property is defined, a platform default
|
||||
* will be used.</p>
|
||||
*
|
||||
* As the content is parsed by the underlying parser, methods of the
|
||||
* given {@link org.xml.sax.HandlerBase} or the
|
||||
@@ -130,6 +121,8 @@ public abstract class SAXParser {
|
||||
* @param hb The SAX HandlerBase to use.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the given InputStream is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
*/
|
||||
|
||||
@@ -155,6 +148,8 @@ public abstract class SAXParser {
|
||||
* @param systemId The systemId which is needed for resolving relative URIs.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the given InputStream is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
* version of this method instead.
|
||||
*/
|
||||
@@ -180,6 +175,8 @@ public abstract class SAXParser {
|
||||
* @param dh The SAX DefaultHandler to use.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the given InputStream is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
*/
|
||||
|
||||
@@ -204,6 +201,8 @@ public abstract class SAXParser {
|
||||
* @param systemId The systemId which is needed for resolving relative URIs.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the given InputStream is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
* version of this method instead.
|
||||
*/
|
||||
@@ -231,6 +230,8 @@ public abstract class SAXParser {
|
||||
* @param hb The SAX HandlerBase to use.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the uri is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
*/
|
||||
|
||||
@@ -254,6 +255,8 @@ public abstract class SAXParser {
|
||||
* @param dh The SAX DefaultHandler to use.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the uri is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
*/
|
||||
|
||||
@@ -279,6 +282,8 @@ public abstract class SAXParser {
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the File object is null.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
*/
|
||||
|
||||
public void parse(File f, HandlerBase hb)
|
||||
@@ -304,6 +309,8 @@ public abstract class SAXParser {
|
||||
* @param dh The SAX DefaultHandler to use.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the File object is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
*/
|
||||
|
||||
@@ -333,6 +340,8 @@ public abstract class SAXParser {
|
||||
* @param hb The SAX HandlerBase to use.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the InputSource is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
*/
|
||||
|
||||
@@ -362,6 +371,8 @@ public abstract class SAXParser {
|
||||
* @param dh The SAX DefaultHandler to use.
|
||||
* @exception IOException If any IO errors occur.
|
||||
* @exception IllegalArgumentException If the InputSource is null.
|
||||
* @exception SAXException If the underlying parser throws a
|
||||
* SAXException while parsing.
|
||||
* @see org.xml.sax.DocumentHandler
|
||||
*/
|
||||
|
||||
@@ -461,7 +472,4 @@ public abstract class SAXParser {
|
||||
*/
|
||||
public abstract Object getProperty(String name)
|
||||
throws SAXNotRecognizedException, SAXNotSupportedException;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -71,6 +71,10 @@ import org.xml.sax.SAXNotSupportedException;
|
||||
* An application can use the same instance of the factory to obtain one or
|
||||
* more instances of the <code>SAXParser</code> provided the instance
|
||||
* of the factory isn't being used in more than one thread at a time.
|
||||
* <p>
|
||||
*
|
||||
* The static <code>newInstance</code> method returns a new concrete
|
||||
* implementation of this class.
|
||||
*
|
||||
* @since JAXP 1.0
|
||||
* @version 1.0
|
||||
|
||||
@@ -336,7 +336,6 @@ public class TransformerException extends Exception {
|
||||
* @param s The writer where the dump will be sent to.
|
||||
*/
|
||||
public void printStackTrace(java.io.PrintWriter s) {
|
||||
|
||||
if (s == null) {
|
||||
s = new java.io.PrintWriter(System.err, true);
|
||||
}
|
||||
@@ -347,7 +346,6 @@ public class TransformerException extends Exception {
|
||||
if (null != locInfo) {
|
||||
s.println(locInfo);
|
||||
}
|
||||
|
||||
super.printStackTrace(s);
|
||||
} catch (Throwable e) {}
|
||||
|
||||
@@ -396,5 +394,6 @@ public class TransformerException extends Exception {
|
||||
exception = null;
|
||||
}
|
||||
}
|
||||
s.flush();
|
||||
}
|
||||
}
|
||||
@@ -188,7 +188,14 @@ public class StreamResult implements Result {
|
||||
* @param f Must a non-null File reference.
|
||||
*/
|
||||
public void setSystemId(File f) {
|
||||
this.systemId = "file:///" + f.getAbsolutePath();
|
||||
String fpath=f.getAbsolutePath();
|
||||
if (File.separatorChar != '/') {
|
||||
fpath = fpath.replace(File.separatorChar, '/');
|
||||
}
|
||||
if( fpath.startsWith("/"))
|
||||
this.systemId= "file://" + fpath;
|
||||
else
|
||||
this.systemId = "file:///" + fpath;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -160,7 +160,7 @@ public class StreamSource implements Source {
|
||||
* @param f Must a non-null File reference.
|
||||
*/
|
||||
public StreamSource(File f) {
|
||||
this.systemId = "file:///" + f.getAbsolutePath();
|
||||
setSystemId(f);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,7 +268,14 @@ public class StreamSource implements Source {
|
||||
* @param f Must a non-null File reference.
|
||||
*/
|
||||
public void setSystemId(File f) {
|
||||
this.systemId = "file:///" + f.toString();
|
||||
String fpath=f.getAbsolutePath();
|
||||
if (File.separatorChar != '/') {
|
||||
fpath = fpath.replace(File.separatorChar, '/');
|
||||
}
|
||||
if( fpath.startsWith("/"))
|
||||
this.systemId= "file://" + fpath;
|
||||
else
|
||||
this.systemId = "file:///" + fpath;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in new issue
Block a user