Methods Summary |
---|
public void | add(org.apache.tools.ant.util.FileNameMapper fileNameMapper)Add a nested FileNameMapper .
if (isReference()) {
throw noChildrenAllowed();
}
if (container == null) {
if (type == null && classname == null) {
container = new CompositeMapper();
} else {
FileNameMapper m = getImplementation();
if (m instanceof ContainerMapper) {
container = (ContainerMapper) m;
} else {
throw new BuildException(String.valueOf(m)
+ " mapper implementation does not support nested mappers!");
}
}
}
container.add(fileNameMapper);
|
public void | addConfigured(org.apache.tools.ant.util.FileNameMapper fileNameMapper)Cannot mix add and addconfigured in same type, so
provide this to override the add method.
add(fileNameMapper);
|
public void | addConfiguredMapper(org.apache.tools.ant.types.Mapper mapper)Add a Mapper
add(mapper.getImplementation());
|
public Path | createClasspath()Set the classpath to load the FileNameMapper through (nested element).
if (isReference()) {
throw noChildrenAllowed();
}
if (this.classpath == null) {
this.classpath = new Path(getProject());
}
return this.classpath.createPath();
|
public org.apache.tools.ant.util.FileNameMapper | getImplementation()Returns a fully configured FileNameMapper implementation.
if (isReference()) {
return getRef().getImplementation();
}
if (type == null && classname == null && container == null) {
throw new BuildException(
"nested mapper or "
+ "one of the attributes type or classname is required");
}
if (container != null) {
return container;
}
if (type != null && classname != null) {
throw new BuildException(
"must not specify both type and classname attribute");
}
try {
FileNameMapper m
= (FileNameMapper) (getImplementationClass().newInstance());
final Project p = getProject();
if (p != null) {
p.setProjectReference(m);
}
m.setFrom(from);
m.setTo(to);
return m;
} catch (BuildException be) {
throw be;
} catch (Throwable t) {
throw new BuildException(t);
}
|
protected java.lang.Class | getImplementationClass()Gets the Class object associated with the mapper implementation.
String cName = this.classname;
if (type != null) {
cName = type.getImplementation();
}
ClassLoader loader = (classpath == null)
? getClass().getClassLoader()
: getProject().createClassLoader(classpath);
return Class.forName(cName, true, loader);
|
protected org.apache.tools.ant.types.Mapper | getRef()Performs the check for circular references and returns the
referenced Mapper.
return (Mapper) getCheckedRef();
|
public void | setClassname(java.lang.String classname)Set the class name of the FileNameMapper to use.
if (isReference()) {
throw tooManyAttributes();
}
this.classname = classname;
|
public void | setClasspath(Path classpath)Set the classpath to load the FileNameMapper through (attribute).
if (isReference()) {
throw tooManyAttributes();
}
if (this.classpath == null) {
this.classpath = classpath;
} else {
this.classpath.append(classpath);
}
|
public void | setClasspathRef(Reference ref)Set the classpath to load the FileNameMapper through via
reference (attribute).
if (isReference()) {
throw tooManyAttributes();
}
createClasspath().setRefid(ref);
|
public void | setFrom(java.lang.String from)Set the argument to FileNameMapper.setFrom
if (isReference()) {
throw tooManyAttributes();
}
this.from = from;
|
public void | setRefid(Reference r)Make this Mapper instance a reference to another Mapper.
You must not set any other attribute if you make it a
reference.
if (type != null || from != null || to != null) {
throw tooManyAttributes();
}
super.setRefid(r);
|
public void | setTo(java.lang.String to)Set the argument to FileNameMapper.setTo
if (isReference()) {
throw tooManyAttributes();
}
this.to = to;
|
public void | setType(org.apache.tools.ant.types.Mapper$MapperType type)Set the type of FileNameMapper to use.
if (isReference()) {
throw tooManyAttributes();
}
this.type = type;
|