|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.acmsl.contractchecker.ContractCheckerUtils
Provides some general-purpose methods needed by ContractChecker.
Field Summary | |
static org.apache.tools.ant.types.FileSet[] |
EMPTY_FILESET_ARRAY
Empty fileset array. |
Constructor Summary | |
protected |
ContractCheckerUtils()
Protected constructor to avoid accidental instantiation. |
Method Summary | |
static ContractCheckerUtils |
getInstance()
Retrieves a ContractCheckerUtils instance. |
protected static java.lang.ref.WeakReference |
getReference()
Retrieves the weak reference. |
java.lang.String |
packageToFilePath(java.lang.String packageName)
Translates given package name to a relative file path. |
java.lang.String |
removeExceptions(java.lang.String methodSignature)
Removes the exception declaration from given method signature. |
java.lang.String |
removeReturn(java.lang.String methodSignature)
Removes the return declaration from given method signature. |
java.io.File |
retrieveAspectFolder(java.io.File parentFolder,
java.lang.String packageName)
Retrieves the folder for the aspects associated to given package. |
java.lang.String |
retrieveAspectPackage(java.lang.String packageName)
Retrieves the package name of the aspects associated to given package. |
protected static void |
setReference(ContractCheckerUtils utils)
Specifies a new weak reference. |
org.apache.tools.ant.types.FileSet |
toFileSet(java.lang.String location,
org.apache.tools.ant.Project project)
BUilds a FileSet for given location. |
org.apache.tools.ant.types.FileSet[] |
toFileSets(org.apache.tools.ant.types.Path path)
Translates given path to a collection of filesets. |
void |
writeFile(java.io.File file,
java.lang.String contents)
Writes a file with given contents. |
void |
writeFile(java.lang.String filePath,
java.lang.String contents)
Writes a file referred by given path, with given contents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final org.apache.tools.ant.types.FileSet[] EMPTY_FILESET_ARRAY
Constructor Detail |
protected ContractCheckerUtils()
Method Detail |
protected static void setReference(ContractCheckerUtils utils)
utils
- the utils instance to use.protected static java.lang.ref.WeakReference getReference()
public static ContractCheckerUtils getInstance()
public void writeFile(java.lang.String filePath, java.lang.String contents) throws java.io.FileNotFoundException, java.lang.SecurityException, java.io.IOException
filePath
- the path of the file.contents
- the text to write.
java.io.FileNotFoundException
- if the file is not found.
java.lang.SecurityException
- if the security manager forbids this
operation.
java.io.IOException
- if any other I/O error occurs.public void writeFile(java.io.File file, java.lang.String contents) throws java.io.FileNotFoundException, java.lang.SecurityException, java.io.IOException
file
- the file to write.contents
- the text to write.
java.io.FileNotFoundException
- if the file is not found.
java.lang.SecurityException
- if the security manager forbids this
operation.
java.io.IOException
- if any other I/O error occurs.public java.lang.String retrieveAspectPackage(java.lang.String packageName)
packageName
- the original package.
public java.io.File retrieveAspectFolder(java.io.File parentFolder, java.lang.String packageName)
parentFolder
- the parent folder.packageName
- the original package.
public java.lang.String packageToFilePath(java.lang.String packageName)
packageName
- the pacjage name.
public java.lang.String removeExceptions(java.lang.String methodSignature)
methodSignature
- the method signature.
public java.lang.String removeReturn(java.lang.String methodSignature)
methodSignature
- the method signature.
public org.apache.tools.ant.types.FileSet[] toFileSets(org.apache.tools.ant.types.Path path)
path
- the path to translate.
public org.apache.tools.ant.types.FileSet toFileSet(java.lang.String location, org.apache.tools.ant.Project project)
location
- the location.project
- the project.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |