|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.schmant.support.AbstractArgumentChecker org.schmant.task.meta.ChangeExtensionTargetStrategy
public class ChangeExtensionTargetStrategy
This target entity strategy can change a processed entity's name's extension. It has a collection of extension translations, i.e. mappings between old and new file name extensions. If an entity does not match any of the translations, it keeps its old extension.
Constructor Summary | |
---|---|
ChangeExtensionTargetStrategy()
Create a case sensitive strategy object. |
|
ChangeExtensionTargetStrategy(boolean cs)
Create a strategy object. |
Method Summary | |
---|---|
Object |
getTarget(ProcessTaskSpec<?> t,
DirectoryView base,
RelativeLocation rel)
Create the target location for the entity being processed. |
ChangeExtensionTargetStrategy |
putExtensionTranslation(String oldE,
String newE)
Add a translation between an old and a new file name extension. |
ChangeExtensionTargetStrategy |
putExtensionTranslations(Map<String,String> m)
Add a map of translation between old and new file name extensions. |
Methods inherited from class org.schmant.support.AbstractArgumentChecker |
---|
check, check, check, check |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChangeExtensionTargetStrategy()
public ChangeExtensionTargetStrategy(boolean cs)
cs
- Should it be case sensitive?Method Detail |
---|
public ChangeExtensionTargetStrategy putExtensionTranslation(String oldE, String newE)
oldE
- The old file name extension.newE
- The new file name extension.
this
putExtensionTranslations(Map)
public ChangeExtensionTargetStrategy putExtensionTranslations(Map<String,String> m)
This method can be called several times to add several maps.
m
- The extension map.
this
putExtensionTranslation(String, String)
public Object getTarget(ProcessTaskSpec<?> t, DirectoryView base, RelativeLocation rel)
TargetStrategy
getTarget
in interface TargetStrategy
t
- The task to get the target for. This method should not set the
task's target
property. (Or any other property, for that matter.)
The source
property is set on the task. If the task factory is a
closure, this parameter will be null
.base
- The base target directory for the process.rel
- The processed entity's location relative to its base
directory.
FutureEntity
. The object that
is returned here is set to the nested task's target
property. See
the task factory documentation for the nested task for the different
kinds of object types that it can handle.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |