Package aQute.bnd.compatibility
Class Signatures
java.lang.Object
aQute.bnd.compatibility.Signatures
This class can convert a Class, Field, Method or constructor to a generic
signature and it can normalize a signature. Both are methods. Normalized
signatures can be string compared and match even if the type variable names
differ.
- Version:
- $Id: d9bcbd3da7e14f43f4fe3db7e1f6ef4c27ff122c $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSignature
(Class<?> c) Calculate the generic signature of a Class.Calculate the generic signature of a Class,Method,Field, or Constructor.getSignature
(Constructor<?> c) Calculate the generic signature of a Constructor.Calculate the generic signature of a Field.Calculate the generic signature of a Method.Normalize a signature to make sure the name of the variables are always the same.
-
Constructor Details
-
Signatures
public Signatures()
-
-
Method Details
-
getSignature
Calculate the generic signature of a Class,Method,Field, or Constructor.- Throws:
Exception
-
getSignature
Calculate the generic signature of a Class. A Class consists of:class ::= declaration? reference reference*
- Throws:
Exception
-
getSignature
Calculate the generic signature of a Method. A Method consists of:method ::= declaration? '(' reference* ')' reference
- Throws:
Exception
-
getSignature
Calculate the generic signature of a Constructor. A Constructor consists of:constructor ::= declaration? '(' reference* ')V'
- Parameters:
c
-- Throws:
Exception
-
getSignature
Calculate the generic signature of a Field. A Field consists of:constructor ::= reference
- Throws:
Exception
-
normalize
Normalize a signature to make sure the name of the variables are always the same. We change the names of the type variables to _n, where n is an integer. n is incremented for every new name and already used names are replaced with the _n name.- Returns:
- a normalized signature
-