edu.umd.cs.findbugs.ba.generic

Class GenericSignatureParser

public class GenericSignatureParser extends Object

A simple class to parse method signatures that include generic information.

Modified from edu.umd.cs.findbugs.ba.SignatureParser

Author: Nat Ayewah

Constructor Summary
GenericSignatureParser(String signature)
Parses a generic method signature of the form: (argument_signature)return_type_signature
Method Summary
static booleancompareSignatures(String plainSignature, String genericSignature)
Compare a plain method signature to the a generic method Signature and return true if they match
intgetNumParameters()
Get the number of parameters in the signature.
static intgetNumParametersForInvocation(InvokeInstruction inv, ConstantPoolGen cpg)
Get the number of parameters passed to method invocation.
StringgetReturnTypeSignature()
Get the method return type signature.
static voidmain(String[] args)
Iterator<String>parameterSignatureIterator()
Get an Iterator over signatures of the method parameters.

Constructor Detail

GenericSignatureParser

public GenericSignatureParser(String signature)
Parses a generic method signature of the form: (argument_signature)return_type_signature

Parameters: signature the method signature to be parsed

Method Detail

compareSignatures

public static boolean compareSignatures(String plainSignature, String genericSignature)
Compare a plain method signature to the a generic method Signature and return true if they match

getNumParameters

public int getNumParameters()
Get the number of parameters in the signature.

Returns: the number of parameters

getNumParametersForInvocation

public static int getNumParametersForInvocation(InvokeInstruction inv, ConstantPoolGen cpg)
Get the number of parameters passed to method invocation.

Parameters: inv cpg

Returns: int number of parameters

getReturnTypeSignature

public String getReturnTypeSignature()
Get the method return type signature.

Returns: the method return type signature

main

public static void main(String[] args)

parameterSignatureIterator

public Iterator<String> parameterSignatureIterator()
Get an Iterator over signatures of the method parameters.

Returns: Iterator which returns the parameter type signatures in order

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