public class MultipleConditions extends UtilityCondition<MultipleConditions>
SingleCondition
template against multiple files,
returning true if at least one file meets the condition (default mode).
There is an alternative mode where all files need to meet the
evaluation condition to result in true. For conditions
based on comparing two files see DoubleCondition
.
For conditions based on evaluating a single file see SingleCondition
setMode(Mode)
,
SingleCondition
,
DoubleCondition
Modifier and Type | Class and Description |
---|---|
static class |
MultipleConditions.Mode
Execution mode for
MultipleConditions . |
UTILITY_NAME_SYNTAX
Constructor and Description |
---|
MultipleConditions(SingleCondition conditionTemplate)
Perform one transformation utility condition against multiple files,
returning true if at least one file meets the condition (default mode).
|
Modifier and Type | Method and Description |
---|---|
protected TUExecutionResult |
execution(java.io.File transformedAppFolder,
TransformationContext transformationContext)
The implementation execution of this transformation utility.
|
SingleCondition |
getConditionTemplate()
Return the condition template
|
java.lang.String |
getDescription()
Returns a short one line, but SPECIFIC, description about the transformation
utility, including mentioning the files and/or folders
to be manipulated.
|
java.lang.String[] |
getFilesAttributes()
A copy of the array of transformation context attributes that hold list of Files
which the condition should perform against.
|
MultipleConditions.Mode |
getMode()
Return the evaluation mode
|
UtilityCondition |
newConditionInstance(java.io.File file)
Creates a new condition instance copying from this current
object, but setting the file it should perform against based
on the input parameters
|
MultipleConditions |
setConditionTemplate(SingleCondition conditionTemplate)
Set the utility condition template used to create conditions
to be evaluated against the list of files
|
MultipleConditions |
setFiles(java.lang.String... filesAttributes)
Sets one or more transformation context attributes that hold list of Files
which the condition should perform against.
|
MultipleConditions |
setMode(MultipleConditions.Mode mode)
Set the evaluation mode.
|
MultipleConditions |
setName(java.lang.String name)
Set this transformation utility instance name.
|
abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getSimpleClassName, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isAbortOnFailure, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setParent, setSaveResult, toString, wasFileExplicitlySet
public MultipleConditions(SingleCondition conditionTemplate)
DoubleCondition
.
For conditions based on evaluating a single file see MultipleConditions
conditionTemplate
- the utility condition template used to create conditions,
used to be evaluated against the list of filespublic MultipleConditions setMode(MultipleConditions.Mode mode)
mode
- the evaluation modepublic MultipleConditions setFiles(java.lang.String... filesAttributes)
filesAttributes
- one or more transformation context attributes that hold list
of Files which the condition should perform
againstpublic MultipleConditions setConditionTemplate(SingleCondition conditionTemplate)
conditionTemplate
- the utility condition template used to create conditions
to be evaluated against the list of filespublic MultipleConditions setName(java.lang.String name)
TransformationUtility
setName
in class TransformationUtility<MultipleConditions>
name
- transformation utility instance namepublic MultipleConditions.Mode getMode()
public java.lang.String[] getFilesAttributes()
public SingleCondition getConditionTemplate()
public java.lang.String getDescription()
TransformationUtility
getDescription
in class TransformationUtility<MultipleConditions>
protected TUExecutionResult execution(java.io.File transformedAppFolder, TransformationContext transformationContext)
TransformationUtility
TransformationUtility.isSaveResult()
returns false.
ExecutionResult
error object.execution
in class TransformationUtility<MultipleConditions>
transformedAppFolder
- the folder where the transformed application code istransformationContext
- the transformation context objectpublic UtilityCondition newConditionInstance(java.io.File file)
file
- the actual file to be performed against