public abstract class DoubleCondition<T extends DoubleCondition> extends UtilityCondition<T>
DoubleUtilityCondition
subclass result type must always
be boolean. The criteria to this type of condition
is based on two files (when comparing if two XML files are equal
for example). For conditions
based on evaluating a single file see SingleCondition
.
For conditions based on multiple files see MultipleConditions
SingleCondition
,
MultipleConditions
UTILITY_NAME_SYNTAX
Constructor and Description |
---|
DoubleCondition()
Condition to determine if a transformation utility
should be executed or not.
|
DoubleCondition(java.lang.String attribute)
Condition to determine if a transformation utility
should be executed or not.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
compare(java.io.File baselineFile,
java.io.File comparisonFile)
Returns true only if the compared files meet the comparison
criteria established and implemented by the subclass
|
protected TUExecutionResult |
execution(java.io.File transformedAppFolder,
TransformationContext transformationContext)
The implementation execution of this transformation utility.
|
java.lang.String |
getAttribute()
Return the name of the transformation context attribute
that refers to the file to be compared against the
baseline file
|
T |
setAttribute(java.lang.String attribute)
Set the name of the transformation context attribute
that refers to the file to be compared against the
baseline file, which is set by regular
TransformationUtility
methods, like TransformationUtility.relative(String) or TransformationUtility.absolute(String) |
abortOnFailure, abortOnFailure, absolute, absolute, applyPropertiesFromContext, checkDependencies, checkForBlankString, checkForEmptyString, checkForNull, clone, copy, dependsOn, equals, executeIf, executeIf, executeUnless, getAbortionMessage, getAbsoluteFile, getContextAttributeName, getDependencies, getDescription, getIfConditionAttributeName, getName, getOrder, getParent, getRelativePath, getRelativePath, getSimpleClassName, getTransformationTemplate, getUnlessConditionAttributeName, hasBeenPerformed, hashCode, hashCode, isAbortOnFailure, isFileSet, isSaveResult, normalizeRelativePathSeparator, perform, relative, set, setContextAttributeName, setName, setParent, setSaveResult, toString, wasFileExplicitlySet
public DoubleCondition()
public DoubleCondition(java.lang.String attribute)
attribute
- the name of the transformation context attribute
that refers to the file to be compared against the baseline filepublic java.lang.String getAttribute()
public T setAttribute(java.lang.String attribute)
TransformationUtility
methods, like TransformationUtility.relative(String)
or TransformationUtility.absolute(String)
attribute
- the name of the transformation context attribute
that refers to the file to be compared against the baseline fileprotected TUExecutionResult execution(java.io.File transformedAppFolder, TransformationContext transformationContext)
TransformationUtility
TransformationUtility.isSaveResult()
returns false.
ExecutionResult
error object.execution
in class TransformationUtility<T extends DoubleCondition>
transformedAppFolder
- the folder where the transformed application code istransformationContext
- the transformation context objectprotected abstract boolean compare(java.io.File baselineFile, java.io.File comparisonFile)
baselineFile
- the baseline file used for comparisoncomparisonFile
- the file to be compared against the baseline file