Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.condition

public Class HasMethod

extends ProjectComponent
implements Condition
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.condition.Condition
Imports
java.lang.reflect.Field, .Method, org.apache.tools.ant.AntClassLoader, .BuildException, .ProjectComponent, org.apache.tools.ant.types.Path, .Reference

test for a method

Field Summary

Modifier and TypeField and Description
private String
private Path
private String
private boolean
private AntClassLoader
private String
Inherited from org.apache.tools.ant.ProjectComponent:
descriptionlocationproject

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Path

Returns:

an empty Path instance to be configured by Ant.
createClasspath
()

Classpath to be used when searching for classes and resources.

public boolean
eval()

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Is this condition true?.
private boolean
isFieldFound(Class<?> clazz)

private boolean
isMethodFound(Class<?> clazz)

private Class<?>
loadClass(String classname)

Check if a given class can be loaded.

public void
setClassname(String
the name of the class to check.
classname
)

Set the classname attribute.

public void
setClasspath(Path
an Ant Path object containing the search path.
classpath
)

Set the classpath to be used when searching for classes and resources.

public void
setClasspathRef(Reference
a Reference to a Path instance to be used as the classpath value.
r
)

Set the classpath by reference.

public void
setField(String
the name of the field to check.
field
)

Set the name of the field.

public void
setIgnoreSystemClasses(boolean
a boolean value.
ignoreSystemClasses
)

Set whether to ignore system classes when looking for the class.

public void
setMethod(String
the name of the method to check.
method
)

Set the name of the method.

Inherited from org.apache.tools.ant.ProjectComponent:
clonegetDescriptiongetLocationgetProjectloglogsetDescriptionsetLocationsetProject

Field Detail

classnameback to summary
private String classname
classpathback to summary
private Path classpath
fieldback to summary
private String field
ignoreSystemClassesback to summary
private boolean ignoreSystemClasses
loaderback to summary
private AntClassLoader loader
methodback to summary
private String method

Constructor Detail

HasMethodback to summary
public HasMethod()

Method Detail

createClasspathback to summary
public Path createClasspath()

Classpath to be used when searching for classes and resources.

Returns:Path

an empty Path instance to be configured by Ant.

evalback to summary
public boolean eval() throws BuildException

Implements org.apache.tools.ant.taskdefs.condition.Condition.eval.

Doc from org.apache.tools.ant.taskdefs.condition.Condition.eval.

Is this condition true?.

Returns:boolean

true if the condition is true

Annotations
@Override
Exceptions
BuildException:
if an error occurs
isFieldFoundback to summary
private boolean isFieldFound(Class<?> clazz)
isMethodFoundback to summary
private boolean isMethodFound(Class<?> clazz)
loadClassback to summary
private Class<?> loadClass(String classname)

Check if a given class can be loaded.

setClassnameback to summary
public void setClassname(String classname)

Set the classname attribute.

Parameters
classname:String

the name of the class to check.

setClasspathback to summary
public void setClasspath(Path classpath)

Set the classpath to be used when searching for classes and resources.

Parameters
classpath:Path

an Ant Path object containing the search path.

setClasspathRefback to summary
public void setClasspathRef(Reference r)

Set the classpath by reference.

Parameters
r:Reference

a Reference to a Path instance to be used as the classpath value.

setFieldback to summary
public void setField(String field)

Set the name of the field.

Parameters
field:String

the name of the field to check.

setIgnoreSystemClassesback to summary
public void setIgnoreSystemClasses(boolean ignoreSystemClasses)

Set whether to ignore system classes when looking for the class.

Parameters
ignoreSystemClasses:boolean

a boolean value.

setMethodback to summary
public void setMethod(String method)

Set the name of the method.

Parameters
method:String

the name of the method to check.