FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba.generic
Class GenericUtilities

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.generic.GenericUtilities

public class GenericUtilities
extends java.lang.Object

Utilities for adding support for generics. Most of these methods can be applied to generic and non generic type information.

Author:
Nat Ayewah

Nested Class Summary
static class GenericUtilities.TypeCategory
           
 
Constructor Summary
GenericUtilities()
           
 
Method Summary
static java.lang.String getString(org.apache.bcel.generic.Type type)
          Get String representation of a Type including Generic information
static org.apache.bcel.generic.Type getType(java.lang.String signature)
          This method is analogous to Type.getType(String), except that it also accepts signatures with generic information.
static GenericObjectType getType(java.lang.String className, java.util.List<? extends org.apache.bcel.generic.ReferenceType> parameters)
           
static GenericUtilities.TypeCategory getTypeCategory(org.apache.bcel.generic.Type type)
          Get the TypeCategory that represents this Object
static java.util.List<org.apache.bcel.generic.ReferenceType> getTypes(java.lang.String signature)
          Parse a bytecode signature that has 1 or more (possibly generic) types and return a list of the Types.
static boolean isPlainObject(org.apache.bcel.generic.Type type)
           
static int lastMatchedLeftAngleBracket(java.lang.String s)
           
static org.apache.bcel.generic.ObjectType merge(GenericObjectType t1, org.apache.bcel.generic.ObjectType t2)
           
static org.apache.bcel.generic.ObjectType merge(org.apache.bcel.generic.Type t1, org.apache.bcel.generic.ObjectType t2)
           
static int nextUnmatchedRightAngleBracket(java.lang.String s, int startingAt)
           
static java.lang.String removeMatchedAngleBrackets(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericUtilities

public GenericUtilities()
Method Detail

getTypeCategory

public static final GenericUtilities.TypeCategory getTypeCategory(org.apache.bcel.generic.Type type)
Get the TypeCategory that represents this Object

See Also:
GenericUtilities.TypeCategory

isPlainObject

public static final boolean isPlainObject(org.apache.bcel.generic.Type type)

getString

public static final java.lang.String getString(org.apache.bcel.generic.Type type)
Get String representation of a Type including Generic information


getType

public static GenericObjectType getType(java.lang.String className,
                                        java.util.List<? extends org.apache.bcel.generic.ReferenceType> parameters)

getType

public static org.apache.bcel.generic.Type getType(java.lang.String signature)
This method is analogous to Type.getType(String), except that it also accepts signatures with generic information. e.g. Ljava/util/ArrayList<TT;>;

The signature should only contain one type. Use GenericSignatureParser to break up a signature with many types or call createTypes(String) to return a list of types


merge

public static org.apache.bcel.generic.ObjectType merge(org.apache.bcel.generic.Type t1,
                                                       org.apache.bcel.generic.ObjectType t2)

merge

public static org.apache.bcel.generic.ObjectType merge(GenericObjectType t1,
                                                       org.apache.bcel.generic.ObjectType t2)

removeMatchedAngleBrackets

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

nextUnmatchedRightAngleBracket

public static int nextUnmatchedRightAngleBracket(java.lang.String s,
                                                 int startingAt)

lastMatchedLeftAngleBracket

public static int lastMatchedLeftAngleBracket(java.lang.String s)

getTypes

public static final java.util.List<org.apache.bcel.generic.ReferenceType> getTypes(java.lang.String signature)
Parse a bytecode signature that has 1 or more (possibly generic) types and return a list of the Types.

Parameters:
signature - bytecode signature e.g. e.g. Ljava/util/ArrayList<Ljava/lang/String;>;Ljava/util/ArrayList<TT;>;Ljava/util/ArrayList<*>;

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.