org.codehaus.plexus.components.io.filemappers
Class FileExtensionMapper

java.lang.Object
  extended by org.codehaus.plexus.components.io.filemappers.IdentityMapper
      extended by org.codehaus.plexus.components.io.filemappers.FileExtensionMapper
All Implemented Interfaces:
FileMapper

public class FileExtensionMapper
extends IdentityMapper

An implementation of FileMapper, which changes the files extension.


Field Summary
static java.lang.String ROLE_HINT
          The file extension mappers role-hint: "fileExtension".
 
Fields inherited from interface org.codehaus.plexus.components.io.filemappers.FileMapper
DEFAULT_ROLE_HINT, ROLE
 
Constructor Summary
FileExtensionMapper()
           
 
Method Summary
 java.lang.String getMappedFileName(java.lang.String pName)
          Maps the given source name to a target name.
 java.lang.String getTargetExtension()
          Returns the target files extension.
 void setTargetExtension(java.lang.String pTargetExtension)
          Sets the target files extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE_HINT

public static final java.lang.String ROLE_HINT
The file extension mappers role-hint: "fileExtension".

See Also:
Constant Field Values
Constructor Detail

FileExtensionMapper

public FileExtensionMapper()
Method Detail

setTargetExtension

public void setTargetExtension(java.lang.String pTargetExtension)
Sets the target files extension.

Throws:
java.lang.IllegalArgumentException - The target extension is null or empty.

getTargetExtension

public java.lang.String getTargetExtension()
Returns the target files extension.


getMappedFileName

public java.lang.String getMappedFileName(java.lang.String pName)
Description copied from interface: FileMapper
Maps the given source name to a target name.

Specified by:
getMappedFileName in interface FileMapper
Overrides:
getMappedFileName in class IdentityMapper
Parameters:
pName - The source name.
Returns:
The target name.


Copyright © 2001-2007 Codehaus. All Rights Reserved.