|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.billf.tass.TassChecker
This class is the entry point to the TASS checking module. TASS stands for "Test Application Signature Safety," and it brings you the news about an application's conformance to platform API signature rules.
This tool inspects appliation classes one at a time. For each class, it considers all external references to API elements: classes, methods, fields, etc. For each external reference, it checks if it's in one of the platform packages, that is, if it's in a package or a subpackage of one of the supplied platform package names.. If it isn't, it ignores it; this tool doesn't try to check applictions for appliction bugs like this.
If an external reference is to a platform class, this tool checks it. It checks the referred-to element against the platform class file stubs, provided. If the referred-to element is there, then checking proceeds. If, however, the element isn't present, an error message is (optionally) created, and an error is indicated.
Constructor Summary | |
TassChecker()
Create a new TassChecker. |
Method Summary | |
void |
checkFieldRef(java.lang.String className,
java.lang.String fieldName)
Internal Visitee implementation method |
void |
checkForClass(java.lang.String name)
Internal Visitee implementation method |
void |
checkMethodRef(java.lang.String className,
java.lang.String methodName,
org.apache.bcel.generic.Type[] args)
Internal Visitee implementation method |
void |
checkType(org.apache.bcel.generic.Type t)
Internal Visitee implementation method |
boolean |
classIsOK(java.lang.String fileName)
Check if the .class in the give file is OK. |
int |
getNumErrors()
Return the total number of errors seen |
void |
init(java.lang.String stubsZipFile,
java.lang.String[] platformPackages,
java.lang.String maxClassFileVersion)
Initialize a TassChecker |
void |
reportError(java.lang.String msg)
Internal Visitee implementation method |
void |
setErrorOutput(java.io.PrintStream out)
Supply a place to send error messages. |
boolean |
zipIsOK(java.lang.String fileName)
Check if the .class files in the given archive are OK. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TassChecker()
init(java.lang.String, java.lang.String[], java.lang.String)
Method Detail |
public void init(java.lang.String stubsZipFile, java.lang.String[] platformPackages, java.lang.String maxClassFileVersion) throws java.io.IOException
stubsZipFile
- The name of the .zip file olding the platform
stubsplatformPackages
- The string names of the platform packagesmaxClassFileVersion
- The maximum acceptable class file version
for application classes, e.g.
"47.0" for PBP 1.0.
java.io.IOException
- If on occurs reading the stubs
java.lang.IllegalArgumentException
- if maxClassfileVersion can't be parsedpublic void setErrorOutput(java.io.PrintStream out)
out
- The output streampublic boolean classIsOK(java.lang.String fileName) throws java.io.IOException
fileName
- The name of the .class file
java.io.IOException
setErrorOutput(java.io.PrintStream)
public boolean zipIsOK(java.lang.String fileName) throws java.io.IOException
fileName
- The name of the zip archive containing
.class files
java.io.IOException
setErrorOutput(java.io.PrintStream)
public int getNumErrors()
public void reportError(java.lang.String msg)
reportError
in interface com.sun.billf.tass.Visitee
public void checkForClass(java.lang.String name)
checkForClass
in interface com.sun.billf.tass.Visitee
public void checkType(org.apache.bcel.generic.Type t)
checkType
in interface com.sun.billf.tass.Visitee
Visitee.checkForClass(String)
public void checkFieldRef(java.lang.String className, java.lang.String fieldName)
checkFieldRef
in interface com.sun.billf.tass.Visitee
public void checkMethodRef(java.lang.String className, java.lang.String methodName, org.apache.bcel.generic.Type[] args)
checkMethodRef
in interface com.sun.billf.tass.Visitee
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |