jrun.jsp.compiler
Class Utils

java.lang.Object
  |
  +--jrun.jsp.compiler.Utils

public class Utils
extends java.lang.Object


Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String canonicalizeURI(java.lang.String uri)
           
static java.lang.String capitalize(java.lang.String s)
           
static void close(java.io.OutputStream os)
           
static void close(java.io.Reader reader)
           
static void close(java.io.Writer writer)
           
static java.lang.String collapseDotDots(java.lang.String str)
           
static java.lang.Object convertString(java.lang.Class type, java.lang.String value)
          Convert a String to a specific type of object
static java.lang.Object convertStringArray(java.lang.Class type, java.lang.String[] vals)
          Convert a String[] to an array of a specific type converting all the elements with convertString
static java.lang.String convertValueToType(java.lang.String value, java.lang.String type)
           
static java.lang.String expandURI(java.lang.String parent, java.lang.String urlSpec)
           
static java.lang.String getJSTTagName(java.lang.String pagePath)
           
static java.lang.String getJSTURI(java.lang.String pagePath)
           
static java.lang.String getPrefix(SimpleNode node)
           
static java.lang.String getPrefix(java.lang.String tag)
           
static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class clazz, java.lang.String property)
          get a bean property descriptor
static java.lang.String getTagName(SimpleNode n)
           
static java.lang.String getTagName(java.lang.String tag)
           
static boolean hasMultipleSetters(java.lang.Class type, java.lang.String property)
           
static boolean isJar(java.io.InputStream is)
           
static boolean isPrimitive(java.lang.String type)
           
static int occurrences(java.lang.String s, char c)
          count the occurances of a char in a string
static int occurrences(java.lang.String s, java.lang.String c)
          count the occurances of a char in a string
static boolean primitiveEquals(java.lang.Class t1, java.lang.Class t2)
           
static java.lang.String substitute(java.lang.String str, java.lang.String from, java.lang.String to)
          Simple string replace routine, return the same string with all instances of from replaced with to
static java.lang.String trimDuplicateSlashes(java.lang.String path)
          Remove any duplicate slashes in a path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getJSTURI

public static java.lang.String getJSTURI(java.lang.String pagePath)

getJSTTagName

public static java.lang.String getJSTTagName(java.lang.String pagePath)

hasMultipleSetters

public static boolean hasMultipleSetters(java.lang.Class type,
                                         java.lang.String property)

isPrimitive

public static boolean isPrimitive(java.lang.String type)

convertValueToType

public static java.lang.String convertValueToType(java.lang.String value,
                                                  java.lang.String type)

capitalize

public static java.lang.String capitalize(java.lang.String s)

getPrefix

public static java.lang.String getPrefix(SimpleNode node)

getPrefix

public static java.lang.String getPrefix(java.lang.String tag)

getTagName

public static java.lang.String getTagName(SimpleNode n)

getTagName

public static java.lang.String getTagName(java.lang.String tag)

expandURI

public static java.lang.String expandURI(java.lang.String parent,
                                         java.lang.String urlSpec)

getPropertyDescriptor

public static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class clazz,
                                                                  java.lang.String property)
                                                           throws java.beans.IntrospectionException
get a bean property descriptor
Parameters:
clazz - The bean type to set the property on
property - The name of the property
Throws:
java.beans.IntrospectionException - If an introspection error occurs trying to get property descriptor
NoSuchPropertyException - If the property doesn't exist on this bean

occurrences

public static int occurrences(java.lang.String s,
                              char c)
count the occurances of a char in a string

occurrences

public static int occurrences(java.lang.String s,
                              java.lang.String c)
count the occurances of a char in a string

isJar

public static boolean isJar(java.io.InputStream is)

canonicalizeURI

public static java.lang.String canonicalizeURI(java.lang.String uri)

collapseDotDots

public static java.lang.String collapseDotDots(java.lang.String str)

close

public static void close(java.io.Reader reader)

close

public static void close(java.io.Writer writer)

close

public static void close(java.io.OutputStream os)

substitute

public static java.lang.String substitute(java.lang.String str,
                                          java.lang.String from,
                                          java.lang.String to)
Simple string replace routine, return the same string with all instances of from replaced with to

trimDuplicateSlashes

public static java.lang.String trimDuplicateSlashes(java.lang.String path)
Remove any duplicate slashes in a path.
Parameters:
path - The path to check
Returns:
The path without duplicate slashes

convertStringArray

public static java.lang.Object convertStringArray(java.lang.Class type,
                                                  java.lang.String[] vals)
Convert a String[] to an array of a specific type converting all the elements with convertString
Parameters:
type - The target type
vals - The strings to convert

convertString

public static java.lang.Object convertString(java.lang.Class type,
                                             java.lang.String value)
Convert a String to a specific type of object
Parameters:
type - The target type
value - The string to convert

primitiveEquals

public static boolean primitiveEquals(java.lang.Class t1,
                                      java.lang.Class t2)


Copyright � 2002 Macromedia Corporation. All Rights Reserved.