FileDocCategorySizeDatePackage
Util.javaAPI DocGlassfish v2 API3230Sat May 05 19:17:12 BST 2007org.apache.taglibs.standard.examples.util

Util

public class Util extends Object

Utility class for examples webapp.

author
Pierre Delisle
version
$Revision: 1.3 $ $Date: 2007/05/06 02:17:12 $

Fields Summary
Constructors Summary
Methods Summary
public static java.io.ReadercastToReader(java.lang.Object obj)

        if (obj instanceof InputStream) {
            return new InputStreamReader((InputStream)obj);
        } else if (obj instanceof Reader) {
            return (Reader)obj;
        } else if (obj instanceof String) {
            return new StringReader((String)obj);
        }
        throw new JspException("Invalid type '" + obj.getClass().getName() +
			       "' for castToReader()");
    
public static java.io.WritercastToWriter(java.lang.Object obj)

        if (obj instanceof OutputStream) {
            return new OutputStreamWriter((OutputStream)obj);
        } else if (obj instanceof Writer) {
            return (Writer)obj;
            /*@@@
        } else if (obj instanceof String) {
            return new StringWriter();
             */
        }
        throw new JspException("Invalid type '" + obj.getClass().getName() +
			       "' for castToWriter()");