Top Description Inners Fields Constructors Methods
org.apache.tools.ant.types

public Class Mapper

extends DataType
Class Inheritance
Imports
java.util.Properties, org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.util.CompositeMapper, .ContainerMapper, .FileNameMapper

Element to define a FileNameMapper.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Mapper.MapperType

Class as Argument to FileNameMapper.setType.

Field Summary

Modifier and TypeField and Description
protected String
protected Path
private ContainerMapper
protected String
protected String
protected Mapper.MapperType
Inherited from org.apache.tools.ant.types.DataType:
checkedref

Constructor Summary

AccessConstructor and Description
public
Mapper(Project
the owning Ant Project.
p
)

Construct a new Mapper element.

Method Summary

Modifier and TypeMethod and Description
public void
add(FileNameMapper
the FileNameMapper to add.
fileNameMapper
)

Add a nested FileNameMapper.

public void
addConfigured(FileNameMapper
the FileNameMapper to add.
fileNameMapper
)

Cannot mix add and addconfigured in same type, so provide this to override the add method.

public void
addConfiguredMapper(Mapper
the mapper to add
mapper
)

Add a Mapper

public Path

Returns:

a path object to be configured
createClasspath
()

Set the classpath to load the FileNameMapper through (nested element).

public FileNameMapper

Returns:

a FileNameMapper object to be configured
getImplementation
()

Returns a fully configured FileNameMapper implementation.

protected Class<? extends FileNameMapper>

Returns:

Class.
getImplementationClass
()

Gets the Class object associated with the mapper implementation.

protected Mapper

Returns:

the referenced Mapper
getRef
()

Deprecated since Ant 1.7.1 because a mapper might ref a FileNameMapper implementation directly.
Performs the check for circular references and returns the referenced Mapper.
public void
setClassname(String
the name of the class
classname
)

Set the class name of the FileNameMapper to use.

public void
setClasspath(Path
the classpath
classpath
)

Set the classpath to load the FileNameMapper through (attribute).

public void
setClasspathRef(Reference
the reference to the FileNameMapper
ref
)

Set the classpath to load the FileNameMapper through via reference (attribute).

public void
setFrom(String
the from attribute to pass to the FileNameMapper
from
)

Set the argument to FileNameMapper.setFrom

public void
setRefid(Reference
the reference to another mapper
r
)

Overrides org.apache.tools.ant.types.DataType.setRefid.

Make this Mapper instance a reference to another Mapper.
public void
setTo(String
the to attribute to pass to the FileNameMapper
to
)

Set the argument to FileNameMapper.setTo

public void
setType(Mapper.MapperType
the MapperType enumerated attribute.
type
)

Set the type of FileNameMapper to use.

Inherited from org.apache.tools.ant.types.DataType:
checkAttributesAllowedcheckChildrenAllowedcircularReferenceclonedieOnCircularReferencedieOnCircularReferencedieOnCircularReferencegetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetCheckedRefgetDataTypeNamegetRefidinvokeCircularReferenceCheckisCheckedisReferencenoChildrenAllowedpushAndInvokeCircularReferenceChecksetCheckedtooManyAttributestoString

Field Detail

classnameback to summary
protected String classname
classpathback to summary
protected Path classpath
containerback to summary
private ContainerMapper container
fromback to summary
protected String from
toback to summary
protected String to
typeback to summary
protected Mapper.MapperType type

Constructor Detail

Mapperback to summary
public Mapper(Project p)

Construct a new Mapper element.

Parameters
p:Project

the owning Ant Project.

Method Detail

addback to summary
public void add(FileNameMapper fileNameMapper)

Add a nested FileNameMapper.

Parameters
fileNameMapper:FileNameMapper

the FileNameMapper to add.

addConfiguredback to summary
public void addConfigured(FileNameMapper fileNameMapper)

Cannot mix add and addconfigured in same type, so provide this to override the add method.

Parameters
fileNameMapper:FileNameMapper

the FileNameMapper to add.

addConfiguredMapperback to summary
public void addConfiguredMapper(Mapper mapper)

Add a Mapper

Parameters
mapper:Mapper

the mapper to add

createClasspathback to summary
public Path createClasspath()

Set the classpath to load the FileNameMapper through (nested element).

Returns:Path

a path object to be configured

getImplementationback to summary
public FileNameMapper getImplementation() throws BuildException

Returns a fully configured FileNameMapper implementation.

Returns:FileNameMapper

a FileNameMapper object to be configured

Exceptions
BuildException:
on error
getImplementationClassback to summary
protected Class<? extends FileNameMapper> getImplementationClass() throws ClassNotFoundException

Gets the Class object associated with the mapper implementation.

Returns:Class<? extends FileNameMapper>

Class.

Exceptions
ClassNotFoundException:
if the class cannot be found
getRefback to summary
protected Mapper getRef()

Deprecated

since Ant 1.7.1 because a mapper might ref a FileNameMapper implementation directly.

Performs the check for circular references and returns the referenced Mapper.

Returns:Mapper

the referenced Mapper

Annotations
@Deprecated
setClassnameback to summary
public void setClassname(String classname)

Set the class name of the FileNameMapper to use.

Parameters
classname:String

the name of the class

setClasspathback to summary
public void setClasspath(Path classpath)

Set the classpath to load the FileNameMapper through (attribute).

Parameters
classpath:Path

the classpath

setClasspathRefback to summary
public void setClasspathRef(Reference ref)

Set the classpath to load the FileNameMapper through via reference (attribute).

Parameters
ref:Reference

the reference to the FileNameMapper

setFromback to summary
public void setFrom(String from)

Set the argument to FileNameMapper.setFrom

Parameters
from:String

the from attribute to pass to the FileNameMapper

setRefidback to summary
public void setRefid(Reference r) throws BuildException

Overrides org.apache.tools.ant.types.DataType.setRefid.

Make this Mapper instance a reference to another Mapper.

You must not set any other attribute if you make it a reference.

Parameters
r:Reference

the reference to another mapper

Annotations
@Override
Exceptions
BuildException:
if other attributes are set
setToback to summary
public void setTo(String to)

Set the argument to FileNameMapper.setTo

Parameters
to:String

the to attribute to pass to the FileNameMapper

setTypeback to summary
public void setType(Mapper.MapperType type)

Set the type of FileNameMapper to use.

Parameters
type:Mapper.MapperType

the MapperType enumerated attribute.

org.apache.tools.ant.types back to summary

public Class Mapper.MapperType

extends EnumeratedAttribute
Class Inheritance

Class as Argument to FileNameMapper.setType.

Field Summary

Modifier and TypeField and Description
private Properties
Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
value

Constructor Summary

AccessConstructor and Description
public
MapperType()

Constructor for the MapperType enumeration

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the classname for the filenamemapper name
getImplementation
()

public String[]

Returns:

the filenamemapper names
getValues
()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

This is the only method a subclass needs to implement.
Inherited from org.apache.tools.ant.types.EnumeratedAttribute:
containsValuegetIndexgetInstancegetValueindexOfValuesetValuetoString

Field Detail

implementationsback to summary
private Properties implementations

Constructor Detail

MapperTypeback to summary
public MapperType()

Constructor for the MapperType enumeration

Method Detail

getImplementationback to summary
public String getImplementation()
Returns:String

the classname for the filenamemapper name

getValuesback to summary
public String[] getValues()

Implements abstract org.apache.tools.ant.types.EnumeratedAttribute.getValues.

Doc from org.apache.tools.ant.types.EnumeratedAttribute.getValues.

This is the only method a subclass needs to implement.

Returns:String[]

the filenamemapper names

Annotations
@Override