aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/ContentHandler.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-05-25 11:40:19 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-05-25 11:40:19 +0000
commitc7684ffe55c75b893fe40988dbb8fcea9beae3ba (patch)
tree88ef0760e764ef489e276334b8e20f71e9f96390 /libjava/java/net/ContentHandler.java
parenteceea3010ff9d19a48d650e5dccb7105d66adbd2 (diff)
downloadgcc-c7684ffe55c75b893fe40988dbb8fcea9beae3ba.zip
gcc-c7684ffe55c75b893fe40988dbb8fcea9beae3ba.tar.gz
gcc-c7684ffe55c75b893fe40988dbb8fcea9beae3ba.tar.bz2
PushbackInputStream.java, [...]: Merged new versions from classpath.
2003-05-25 Michael Koch <konqueror@gmx.de> * java/io/PushbackInputStream.java, java/net/Authenticator.java, java/net/ContentHandler.java, java/net/ContentHandlerFactory.java, java/net/DatagramSocket.java, java/net/DatagramSocketImpl.java, java/net/DatagramSocketImplFactory.java, java/net/FileNameMap.java, java/net/SocketImplFactory.java, java/net/SocketOptions.java, java/net/URLStreamHandlerFactory.java: Merged new versions from classpath. From-SVN: r67165
Diffstat (limited to 'libjava/java/net/ContentHandler.java')
-rw-r--r--libjava/java/net/ContentHandler.java126
1 files changed, 65 insertions, 61 deletions
diff --git a/libjava/java/net/ContentHandler.java b/libjava/java/net/ContentHandler.java
index ce8d7ee..ed74698 100644
--- a/libjava/java/net/ContentHandler.java
+++ b/libjava/java/net/ContentHandler.java
@@ -1,5 +1,5 @@
/* ContentHandler.java -- Abstract class for handling content from URL's
- Copyright (C) 1998, 1999 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,65 +59,69 @@ import java.io.IOException;
*/
public abstract class ContentHandler
{
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Default, no-argument constructor.
- */
-public ContentHandler() { }
-
-/*************************************************************************/
-
-/**
- * This method reads from the <code>InputStream</code> of the passed in URL
- * connection and uses the data downloaded to create an <code>Object</code>
- * represening the content. For example, if the URL is pointing to a GIF
- * file, this method might return an <code>Image</code> object. This method
- * must be implemented by subclasses.
- *
- * @param urlc A <code>URLConnection</code> object to read data from.
- *
- * @return An object representing the data read
- *
- * @exception IOException If an error occurs
- */
-public abstract Object getContent(URLConnection urlc) throws IOException;
-
-/*************************************************************************/
-
-/**
- * This method reads from the <code>InputStream</code> of the passed in URL
- * connection and uses the data downloaded to create an <code>Object</code>
- * represening the content. For example, if the URL is pointing to a GIF
- * file, this method might return an <code>Image</code> object. This method
- * must be implemented by subclasses. If the object doesnt match any type in
- * classes it returns null.
- *
- * @param urlc A <code>URLConnection</code> object to read data from.
- *
- * @return An object representing the data read
- *
- * @exception IOException If an error occurs
- *
- * @since 1.3
- */
-public Object getContent(URLConnection urlc, Class[] classes)
- throws IOException
-{
- Object obj = getContent (urlc);
-
- for (int i = 0; i < classes.length; i++)
- {
- if (classes [i].isInstance (obj))
- return obj;
- }
-
- return null;
-}
+ /*
+ * Constructors
+ */
+
+ /**
+ * Default, no-argument constructor.
+ */
+ public ContentHandler()
+ {
+ }
+
+ /*
+ * Instance Methods
+ */
+
+ /**
+ * This method reads from the <code>InputStream</code> of the passed in URL
+ * connection and uses the data downloaded to create an <code>Object</code>
+ * represening the content. For example, if the URL is pointing to a GIF
+ * file, this method might return an <code>Image</code> object. This method
+ * must be implemented by subclasses.
+ *
+ * @param urlc A <code>URLConnection</code> object to read data from.
+ *
+ * @return An object representing the data read
+ *
+ * @exception IOException If an error occurs
+ */
+ public abstract Object getContent(URLConnection urlc)
+ throws IOException;
+
+ /**
+ * This method reads from the <code>InputStream</code> of the passed in URL
+ * connection and uses the data downloaded to create an <code>Object</code>
+ * represening the content. For example, if the URL is pointing to a GIF
+ * file, this method might return an <code>Image</code> object. This method
+ * must be implemented by subclasses. This method uses the list of
+ * supplied classes as candidate types. If the data read doesn't match
+ * any of the supplied type, <code>null</code> is returned.
+ *
+ * @param urlc A <code>URLConnection</code> object to read data from.
+ * @param classes An array of types of objects that are candidate types
+ * for the data to be read.
+ *
+ * @return An object representing the data read, or <code>null</code>
+ * if the data does not match any of the candidate types.
+ *
+ * @exception IOException If an error occurs
+ *
+ * @since 1.3
+ */
+ public Object getContent(URLConnection urlc, Class[] classes)
+ throws IOException
+ {
+ Object obj = getContent (urlc);
+
+ for (int i = 0; i < classes.length; i++)
+ {
+ if (classes [i].isInstance (obj))
+ return obj;
+ }
+
+ return null;
+ }
} // class ContentHandler