public class ClassHash extends java.lang.Object implements XMLWriteable, java.lang.Comparable<ClassHash>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_HASH_ELEMENT_NAME
XML element name for a ClassHash.
|
static java.lang.String |
METHOD_HASH_ELEMENT_NAME
XML element name for a MethodHash.
|
Constructor and Description |
---|
ClassHash()
Constructor.
|
ClassHash(java.lang.String className,
byte[] classHash)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ClassHash other) |
ClassHash |
computeHash(org.apache.bcel.classfile.JavaClass javaClass)
Compute hash for given class and all of its methods.
|
boolean |
equals(java.lang.Object o) |
byte[] |
getClassHash()
Get class hash.
|
java.lang.String |
getClassName() |
MethodHash |
getMethodHash(XMethod method)
Get method hash for given method.
|
int |
hashCode() |
static java.lang.String |
hashToString(byte[] hash)
Convert a hash to a string of hex digits.
|
boolean |
isSameHash(ClassHash other)
Return whether or not this class hash has the same hash value as the one
given.
|
void |
setClassHash(byte[] classHash)
Set class hash.
|
void |
setMethodHash(XMethod method,
byte[] methodHash)
Set method hash for given method.
|
static byte[] |
stringToHash(java.lang.String s)
Convert a string of hex digits to a hash.
|
java.lang.String |
toString() |
void |
writeXML(XMLOutput xmlOutput)
Write this object to given XMLOutput.
|
public static final java.lang.String CLASS_HASH_ELEMENT_NAME
public static final java.lang.String METHOD_HASH_ELEMENT_NAME
public ClassHash()
public ClassHash(java.lang.String className, byte[] classHash)
classHash
- pre-computed class hashpublic void setMethodHash(XMethod method, byte[] methodHash)
method
- the methodmethodHash
- the method hashpublic java.lang.String getClassName()
public byte[] getClassHash()
public void setClassHash(byte[] classHash)
classHash
- the class hash value to setpublic MethodHash getMethodHash(XMethod method)
method
- the methodpublic ClassHash computeHash(org.apache.bcel.classfile.JavaClass javaClass)
javaClass
- the classpublic void writeXML(XMLOutput xmlOutput) throws java.io.IOException
XMLWriteable
writeXML
in interface XMLWriteable
xmlOutput
- the XMLOutput for the documentjava.io.IOException
public static java.lang.String hashToString(byte[] hash)
hash
- the hashpublic static byte[] stringToHash(java.lang.String s)
s
- string of hex digitspublic boolean isSameHash(ClassHash other)
other
- another ClassHashpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(ClassHash other)
compareTo
in interface java.lang.Comparable<ClassHash>
public java.lang.String toString()
toString
in class java.lang.Object
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.