Apache Tomcat 7.0.37

org.apache.tomcat.util
Class IntrospectionUtils

java.lang.Object
  extended by org.apache.tomcat.util.IntrospectionUtils

public final class IntrospectionUtils
extends Object

Utils for introspection and reflection


Nested Class Summary
static interface IntrospectionUtils.AttributeHolder
          Deprecated. Is used only by deprecated method
static interface IntrospectionUtils.PropertySource
           
 
Field Summary
static String PATH_SEPARATOR
          Deprecated. Used only by deprecated method
 
Constructor Summary
IntrospectionUtils()
           
 
Method Summary
static void addJarsFromClassPath(Vector<URL> jars, String cp)
          Deprecated. Is used only by deprecated method
static void addToClassPath(Vector<URL> cpV, String dir)
          Deprecated. Is used only by deprecated method
static void addToolsJar(Vector<URL> v)
          Deprecated. Is used only by deprecated method
static void callMain(Class<?> c, String[] args)
          Deprecated. Not used
static Object callMethod0(Object target, String methodN)
          Deprecated. Not used, though compliments callMethod1 and callMethodN here
static Object callMethod1(Object target, String methodN, Object param1, String typeParam1, ClassLoader cl)
           
static Object callMethodN(Object target, String methodN, Object[] params, Class<?>[] typeParams)
           
static String capitalize(String name)
          Reverse of Introspector.decapitalize
static String classPathAdd(URL[] urls, String cp)
          Deprecated. Not used
static void clear()
           
static Object convert(String object, Class<?> paramType)
           
static void displayClassPath(String msg, URL[] cp)
          Deprecated. Not used
static void execute(Object proxy, String method)
          Deprecated. Not used
static Method findMethod(Class<?> c, String name, Class<?>[] params)
           
static Method[] findMethods(Class<?> c)
           
static Object getAttribute(Object proxy, String n)
          Deprecated. Not used
static URL[] getClassPath(String dir, String cpath, String cpathProp, boolean addTools)
          Deprecated. Not used
static URL[] getClassPath(Vector<URL> v)
          Deprecated. Is used only by deprecated method
static String[] getFilesByExt(String ld, String ext)
          Deprecated. Is used only by deprecated method
static Object getProperty(Object o, String name)
           
static URL getURL(String base, String file)
          Deprecated. Is used only by deprecated method
static ClassLoader getURLClassLoader(URL[] urls, ClassLoader parent)
          Deprecated. Not used
static String guessInstall(String installSysProp, String homeSysProp, String jarName)
          Deprecated. No longer required. Will be removed in Tomcat 8.0.x.
static String guessInstall(String installSysProp, String homeSysProp, String jarName, String classFile)
          Deprecated. No longer required. Will be removed in Tomcat 8.0.x.
static boolean hasHook(Object obj, String methodN)
          Deprecated. Not used
static String replaceProperties(String value, Hashtable<Object,Object> staticProp, IntrospectionUtils.PropertySource[] dynamicProp)
          Replace ${NAME} with the property value
static void setAttribute(Object proxy, String n, Object v)
          Deprecated. Not used
static void setProperty(Object o, String name)
          Deprecated. Not used
static boolean setProperty(Object o, String name, String value)
          Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).
static boolean setProperty(Object o, String name, String value, boolean invokeSetProperty)
           
static String unCapitalize(String name)
          Deprecated. Not used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_SEPARATOR

@Deprecated
public static final String PATH_SEPARATOR
Deprecated. Used only by deprecated method
Constructor Detail

IntrospectionUtils

public IntrospectionUtils()
Method Detail

execute

@Deprecated
public static void execute(Object proxy,
                                      String method)
                    throws Exception
Deprecated. Not used

Call execute() - any ant-like task should work

Throws:
Exception

setAttribute

@Deprecated
public static void setAttribute(Object proxy,
                                           String n,
                                           Object v)
                         throws Exception
Deprecated. Not used

Call void setAttribute( String ,Object )

Throws:
Exception

getAttribute

@Deprecated
public static Object getAttribute(Object proxy,
                                             String n)
                           throws Exception
Deprecated. Not used

Call void getAttribute( String )

Throws:
Exception

getURLClassLoader

@Deprecated
public static ClassLoader getURLClassLoader(URL[] urls,
                                                       ClassLoader parent)
Deprecated. Not used

Construct a URLClassLoader. Will compile and work in JDK1.1 too.


guessInstall

@Deprecated
public static String guessInstall(String installSysProp,
                                             String homeSysProp,
                                             String jarName)
Deprecated. No longer required. Will be removed in Tomcat 8.0.x.


guessInstall

@Deprecated
public static String guessInstall(String installSysProp,
                                             String homeSysProp,
                                             String jarName,
                                             String classFile)
Deprecated. No longer required. Will be removed in Tomcat 8.0.x.

Guess a product install/home by analyzing the class path. It works for product using the pattern: lib/executable.jar or if executable.jar is included in classpath by a shell script. ( java -jar also works ) Insures both "install" and "home" System properties are set. If either or both System properties are unset, "install" and "home" will be set to the same value. This value will be the other System property that is set, or the guessed value if neither is set.


displayClassPath

@Deprecated
public static void displayClassPath(String msg,
                                               URL[] cp)
Deprecated. Not used

Debug method, display the classpath


classPathAdd

@Deprecated
public static String classPathAdd(URL[] urls,
                                             String cp)
Deprecated. Not used

Adds classpath entries from a vector of URL's to the "tc_path_add" System property. This System property lists the classpath entries common to web applications. This System property is currently used by Jasper when its JSP servlet compiles the Java file for a JSP.


setProperty

public static boolean setProperty(Object o,
                                  String name,
                                  String value)
Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).


setProperty

public static boolean setProperty(Object o,
                                  String name,
                                  String value,
                                  boolean invokeSetProperty)

getProperty

public static Object getProperty(Object o,
                                 String name)

setProperty

@Deprecated
public static void setProperty(Object o,
                                          String name)
Deprecated. Not used


replaceProperties

public static String replaceProperties(String value,
                                       Hashtable<Object,Object> staticProp,
                                       IntrospectionUtils.PropertySource[] dynamicProp)
Replace ${NAME} with the property value


capitalize

public static String capitalize(String name)
Reverse of Introspector.decapitalize


unCapitalize

@Deprecated
public static String unCapitalize(String name)
Deprecated. Not used


addToClassPath

@Deprecated
public static void addToClassPath(Vector<URL> cpV,
                                             String dir)
Deprecated. Is used only by deprecated method

Add all the jar files in a dir to the classpath, represented as a Vector of URLs.


addToolsJar

@Deprecated
public static void addToolsJar(Vector<URL> v)
Deprecated. Is used only by deprecated method


getFilesByExt

@Deprecated
public static String[] getFilesByExt(String ld,
                                                String ext)
Deprecated. Is used only by deprecated method

Return all files with a given extension in a dir


getURL

@Deprecated
public static URL getURL(String base,
                                    String file)
Deprecated. Is used only by deprecated method

Construct a file url from a file, using a base dir


addJarsFromClassPath

@Deprecated
public static void addJarsFromClassPath(Vector<URL> jars,
                                                   String cp)
                                 throws IOException,
                                        MalformedURLException
Deprecated. Is used only by deprecated method

Add elements from the classpath cp to a Vector jars as file URLs (We use Vector for JDK 1.1 compat).

Parameters:
jars - The jar list
cp - a String classpath of directory or jar file elements separated by path.separator delimiters.
Throws:
IOException - If an I/O error occurs
MalformedURLException - Doh ;)

getClassPath

@Deprecated
public static URL[] getClassPath(Vector<URL> v)
Deprecated. Is used only by deprecated method

Return a URL[] that can be used to construct a class loader


getClassPath

@Deprecated
public static URL[] getClassPath(String dir,
                                            String cpath,
                                            String cpathProp,
                                            boolean addTools)
                          throws IOException,
                                 MalformedURLException
Deprecated. Not used

Construct a URL classpath from files in a directory, a cpath property, and tools.jar.

Throws:
IOException
MalformedURLException

clear

public static void clear()

findMethods

public static Method[] findMethods(Class<?> c)

findMethod

public static Method findMethod(Class<?> c,
                                String name,
                                Class<?>[] params)

hasHook

@Deprecated
public static boolean hasHook(Object obj,
                                         String methodN)
Deprecated. Not used

Test if the object implements a particular method


callMain

@Deprecated
public static void callMain(Class<?> c,
                                       String[] args)
                     throws Exception
Deprecated. Not used

Throws:
Exception

callMethod1

public static Object callMethod1(Object target,
                                 String methodN,
                                 Object param1,
                                 String typeParam1,
                                 ClassLoader cl)
                          throws Exception
Throws:
Exception

callMethod0

@Deprecated
public static Object callMethod0(Object target,
                                            String methodN)
                          throws Exception
Deprecated. Not used, though compliments callMethod1 and callMethodN here

Throws:
Exception

callMethodN

public static Object callMethodN(Object target,
                                 String methodN,
                                 Object[] params,
                                 Class<?>[] typeParams)
                          throws Exception
Throws:
Exception

convert

public static Object convert(String object,
                             Class<?> paramType)

Apache Tomcat 7.0.37

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.