org.apache.tapestry5.ioc.services
Class ClassFabUtils

java.lang.Object
  extended by org.apache.tapestry5.ioc.services.ClassFabUtils

Deprecated. Deprecated in Tapestry 5.3, to be removed in 5.4 with no replacement

public final class ClassFabUtils
extends Object

Handy method useful when creating new classes using ClassFab.


Constructor Summary
ClassFabUtils()
          Deprecated.  
 
Method Summary
static String castReference(String reference, String desiredType)
          Deprecated. Takes a reference and casts it to the desired type.
static String generateClassName(Class interfaceClass)
          Deprecated. Returns a class name derived from the provided interfaceClass.
static String generateClassName(String baseName)
          Deprecated. Generates a unique class name, which will be in the default package.
static String getPathForClass(Class clazz)
          Deprecated. Given a Class instance, convert the name into a path that can be used to locate the underlying class file on the classpath.
static String getPathForClassNamed(String className)
          Deprecated. Given a fully qualified class name, converts to a path on the classpath.
static Class getPrimitiveType(Class wrapperType)
          Deprecated. Given a wrapper type, determines the corresponding primitive type.
static Class getPrimitiveType(String primitiveTypeName)
          Deprecated.  
static String getTypeCode(Class type)
          Deprecated. Converts a Class to a JVM type code (the way class information is expressed in a class file).
static String getUnwrapMethodName(Class primitiveType)
          Deprecated. Given a primitive type, finds the unwrap method of the corresponding wrapper type.
static Class getWrapperType(Class type)
          Deprecated. Returns the wrapper type for an input type; for most types, this is the type.
static boolean isPrimitiveType(String typeName)
          Deprecated. Given a type name, determines if that is the name of a primitive type.
static boolean isToString(Method method)
          Deprecated. Returns true if the method is the standard toString() method.
static String nextUID()
          Deprecated.  
static File toFileFromFileProtocolURL(URL url)
          Deprecated. Converts a URL with protocol "file" to a File instance.
static String toJavaClassName(Class inputClass)
          Deprecated. Javassist needs the class name to be as it appears in source code, even for arrays.
static String toJVMBinaryName(String type)
          Deprecated. Translates types from standard Java format to Java VM format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFabUtils

public ClassFabUtils()
Deprecated. 
Method Detail

nextUID

public static String nextUID()
Deprecated. 

generateClassName

public static String generateClassName(String baseName)
Deprecated. 
Generates a unique class name, which will be in the default package.


generateClassName

public static String generateClassName(Class interfaceClass)
Deprecated. 
Returns a class name derived from the provided interfaceClass. The package part of the interface name is stripped out, and the result passed to generateClassName(String).


toJavaClassName

public static String toJavaClassName(Class inputClass)
Deprecated. 
Javassist needs the class name to be as it appears in source code, even for arrays. Invoking getName() on a Class instance representing an array returns the internal format (i.e, "[...;" or something). This returns it as it would appear in Java code.


isToString

public static boolean isToString(Method method)
Deprecated. 
Returns true if the method is the standard toString() method. Very few interfaces will ever include this method as part of the interface, but we have to be sure.


getPrimitiveType

public static Class getPrimitiveType(String primitiveTypeName)
Deprecated. 

toJVMBinaryName

public static String toJVMBinaryName(String type)
Deprecated. 
Translates types from standard Java format to Java VM format. For example, java.util.Locale remains java.util.Locale, but int[][] is translated to [[I and java.lang.Object[] to [Ljava.lang.Object;


getPrimitiveType

public static Class getPrimitiveType(Class wrapperType)
Deprecated. 
Given a wrapper type, determines the corresponding primitive type.


getWrapperType

public static Class getWrapperType(Class type)
Deprecated. 
Returns the wrapper type for an input type; for most types, this is the type. For primitive types, it is the corresponding wrapper type.

Parameters:
type - type to check
Returns:
type or corresponding wrapper type

castReference

public static String castReference(String reference,
                                   String desiredType)
Deprecated. 
Takes a reference and casts it to the desired type. If the desired type is a primitive type, then the reference is cast to the correct wrapper type and a call to the correct unwrapper method is added. The end result is code that can be assigned to a field or parameter of the desired type (even if desired type is a primitive).

Parameters:
reference - to be cast
desiredType - desired object or primitive type
Returns:
Javassist code to peform the cast

getUnwrapMethodName

public static String getUnwrapMethodName(Class primitiveType)
Deprecated. 
Given a primitive type, finds the unwrap method of the corresponding wrapper type.

Parameters:
primitiveType -
Returns:
method name

isPrimitiveType

public static boolean isPrimitiveType(String typeName)
Deprecated. 
Given a type name, determines if that is the name of a primitive type.


getTypeCode

public static String getTypeCode(Class type)
Deprecated. 
Converts a Class to a JVM type code (the way class information is expressed in a class file).


getPathForClass

public static String getPathForClass(Class clazz)
Deprecated. 
Given a Class instance, convert the name into a path that can be used to locate the underlying class file on the classpath.

Since:
5.2.0

getPathForClassNamed

public static String getPathForClassNamed(String className)
Deprecated. 
Given a fully qualified class name, converts to a path on the classpath.

Since:
5.2.0

toFileFromFileProtocolURL

public static File toFileFromFileProtocolURL(URL url)
Deprecated. 
Converts a URL with protocol "file" to a File instance.

Since:
5.2.0


Copyright © 2003-2012 The Apache Software Foundation.