org.jboss.weld.util.bytecode
Class DescriptorUtils

java.lang.Object
  extended by org.jboss.weld.util.bytecode.DescriptorUtils

public class DescriptorUtils
extends Object

Utility class for working with method descriptors

Author:
Stuart Douglas

Constructor Summary
DescriptorUtils()
           
 
Method Summary
static String classToStringRepresentation(Class<?> c)
           
static String[] descriptorStringToParameterArray(String methodDescriptor)
          returns an array of String representations of the parameter types.
static String getConstructorDescriptor(Constructor<?> c)
           
static String getMethodDescriptor(Method m)
           
static String getMethodDescriptor(String[] parameters, String returnType)
           
static String[] getParameterTypes(Class<?>[] parameters)
           
static String[] getParameterTypes(Method m)
           
static boolean isPrimitive(String descriptor)
          returns true if the descriptor represents a primitive type
static boolean isWide(Class<?> cls)
          returns true if the class represents a long or a double
static boolean isWide(String descriptor)
          returns true if the descriptor represents a long or a double
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescriptorUtils

public DescriptorUtils()
Method Detail

descriptorStringToParameterArray

public static String[] descriptorStringToParameterArray(String methodDescriptor)
returns an array of String representations of the parameter types. Primitives are returned as their native representations, while clases are returned in the internal descriptor form e.g. Ljava/lang/Integer;


classToStringRepresentation

public static String classToStringRepresentation(Class<?> c)

isPrimitive

public static boolean isPrimitive(String descriptor)
returns true if the descriptor represents a primitive type


isWide

public static boolean isWide(String descriptor)
returns true if the descriptor represents a long or a double


isWide

public static boolean isWide(Class<?> cls)
returns true if the class represents a long or a double


getConstructorDescriptor

public static String getConstructorDescriptor(Constructor<?> c)

getParameterTypes

public static String[] getParameterTypes(Method m)

getParameterTypes

public static String[] getParameterTypes(Class<?>[] parameters)

getMethodDescriptor

public static String getMethodDescriptor(Method m)

getMethodDescriptor

public static String getMethodDescriptor(String[] parameters,
                                         String returnType)


Copyright © 2013 Seam Framework. All Rights Reserved.