|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--com.thoughtworks.qdox.ant.AbstractQdoxTask | +--org.acmsl.contractchecker.ContractCheckerDoclet
QDox doclet for retrieving methods' pre- and post-conditions.
Field Summary | |
static java.lang.String |
DEFAULT_VIOLATION_EXCEPTION
The default exception. |
protected static ContractCheckerAspectTemplate[] |
EMPTY_ASPECTTEMPLATE_ARRAY
Cached empty contractcheckeraspecttemplate array. |
protected static com.thoughtworks.qdox.model.JavaClass[] |
EMPTY_JAVACLASS_ARRAY
Cached empty javaclass array. |
protected static com.thoughtworks.qdox.model.JavaMethod[] |
EMPTY_JAVAMETHOD_ARRAY
Cached empty javamethod array. |
static java.lang.String |
PRECONDITION_TAG
The precondition tag. |
Fields inherited from class com.thoughtworks.qdox.ant.AbstractQdoxTask |
allClasses, allSources, fileMap |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
ContractCheckerDoclet()
|
Method Summary | |
protected void |
buildFileSets()
Builds the file sets. |
protected ContractCheckerAspectTemplate |
buildTemplate(com.thoughtworks.qdox.model.JavaClass javaClass,
ContractCheckerAspectTemplateFactory factory,
java.lang.String defaultException)
Builds a ContractCheckerAspectTemplate from information provided by given class. |
protected ContractCheckerAspectTemplate |
buildTemplate(java.lang.String name,
java.lang.String qualifiedName,
ContractCheckerAspectTemplateFactory factory,
java.lang.String defaultException,
ContractCheckerUtils contractCheckerUtils)
Builds a ContractCheckerAspectTemplate from information provided by given class. |
protected ContractCheckerAspectTemplate[] |
buildTemplates(java.util.Collection classes,
ContractCheckerAspectTemplateFactory factory,
java.lang.String defaultException)
Builds the templates for given classes. |
void |
execute()
Tag information retrieval starting point. |
protected java.util.Collection |
findGuardedClasses(java.util.Collection classes)
Finds the guarded classes from given collection. |
protected static com.thoughtworks.qdox.model.JavaMethod[] |
findGuardedMethods(com.thoughtworks.qdox.model.JavaMethod[] methods,
boolean stopOnFirst)
Finds the guarded method from given collection. |
org.apache.tools.ant.types.Path |
getInput()
Retrieves the input path. |
java.io.File |
getOutputfolder()
Retrieves the output folder. |
java.lang.String |
getTemplatefactoryclass()
Retrieves the template factory class. |
java.lang.String |
getViolationexception()
Retrieves the contract violation exception. |
protected ContractCheckerAspectTemplateFactory |
instantiateFactory(java.lang.String className)
Creates the factory instance. |
protected void |
processClass(com.thoughtworks.qdox.model.JavaClass javaClass)
Processes given class. |
protected void |
processClasses(com.thoughtworks.qdox.model.JavaClass[] classes)
Processes given classes. |
protected void |
processSource(com.thoughtworks.qdox.model.JavaSource source)
Processes given source. |
protected void |
processSources(com.thoughtworks.qdox.model.JavaSource[] sources)
Processes given sources. |
void |
setInput(org.apache.tools.ant.types.Path input)
Specifies the input path. |
void |
setOutputfolder(java.io.File folder)
Specifies the output folder. |
void |
setTemplatefactoryclass(java.lang.String factoryClass)
Specifies the template factory class. |
void |
setViolationexception(java.lang.String exception)
Specifies the contract violation exception. |
protected boolean |
writeTemplates(ContractCheckerAspectTemplate[] templates,
java.io.File outputFolder)
Writes given templates. |
Methods inherited from class com.thoughtworks.qdox.ant.AbstractQdoxTask |
addFileset, buildFileMap, buildFileMap, createDocletTagFactory, validateAttributes |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PRECONDITION_TAG
public static final java.lang.String DEFAULT_VIOLATION_EXCEPTION
protected static final com.thoughtworks.qdox.model.JavaClass[] EMPTY_JAVACLASS_ARRAY
protected static final com.thoughtworks.qdox.model.JavaMethod[] EMPTY_JAVAMETHOD_ARRAY
protected static final ContractCheckerAspectTemplate[] EMPTY_ASPECTTEMPLATE_ARRAY
Constructor Detail |
public ContractCheckerDoclet()
Method Detail |
public void setOutputfolder(java.io.File folder)
folder
- the output folder.public java.io.File getOutputfolder()
public void setTemplatefactoryclass(java.lang.String factoryClass)
factoryClass
- the factory class.public java.lang.String getTemplatefactoryclass()
public void setInput(org.apache.tools.ant.types.Path input)
input
- the input.public org.apache.tools.ant.types.Path getInput()
public void setViolationexception(java.lang.String exception)
exception
- such exception.public java.lang.String getViolationexception()
protected void buildFileSets()
protected void processSources(com.thoughtworks.qdox.model.JavaSource[] sources)
processSources
in class com.thoughtworks.qdox.ant.AbstractQdoxTask
sources
- the source code to process.protected void processSource(com.thoughtworks.qdox.model.JavaSource source)
source
- the source to process.protected void processClasses(com.thoughtworks.qdox.model.JavaClass[] classes)
processClasses
in class com.thoughtworks.qdox.ant.AbstractQdoxTask
classes
- the classes to process.protected void processClass(com.thoughtworks.qdox.model.JavaClass javaClass)
javaClass
- the class to process.public void execute() throws org.apache.tools.ant.BuildException
execute
in class com.thoughtworks.qdox.ant.AbstractQdoxTask
org.apache.tools.ant.BuildException
- if the source code cannot be processed.protected ContractCheckerAspectTemplateFactory instantiateFactory(java.lang.String className) throws ContractCheckerException
className
- the factory class name.
ContractCheckerException
- if the factory cannot be
instantiated.protected java.util.Collection findGuardedClasses(java.util.Collection classes)
classes
- the complete class set.
protected static com.thoughtworks.qdox.model.JavaMethod[] findGuardedMethods(com.thoughtworks.qdox.model.JavaMethod[] methods, boolean stopOnFirst)
methods
- the complete method set.stopOnFirst
- whether to stop on first guarded method.
Therefore, if it's set to true
the resulting
array will contain 0 or 1 element.
protected ContractCheckerAspectTemplate[] buildTemplates(java.util.Collection classes, ContractCheckerAspectTemplateFactory factory, java.lang.String defaultException)
classes
- the classes.factory
- the template factory.defaultException
- the default exception.
protected ContractCheckerAspectTemplate buildTemplate(com.thoughtworks.qdox.model.JavaClass javaClass, ContractCheckerAspectTemplateFactory factory, java.lang.String defaultException)
javaClass
- the Java class.factory
- the template factory.defaultException
- the default exception.
protected ContractCheckerAspectTemplate buildTemplate(java.lang.String name, java.lang.String qualifiedName, ContractCheckerAspectTemplateFactory factory, java.lang.String defaultException, ContractCheckerUtils contractCheckerUtils)
name
- the Java class' name.qualifiedName
- the Java class' qualified name.factory
- the template factory.defaultException
- the default exception.contractCheckerUtils
- the helper instance.
protected boolean writeTemplates(ContractCheckerAspectTemplate[] templates, java.io.File outputFolder) throws ContractCheckerException
templates
- the templates to write.outputFolder
- the output folder.
true
if the templates are written successfully.
ContractCheckerException
- if the template cannot be written for
any reason.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |