public abstract class TransformationTemplate extends Object
Constructor and Description |
---|
TransformationTemplate() |
Modifier and Type | Method and Description |
---|---|
String |
add(TransformationUtility utility)
Adds a new transformation utility to the end of the list.
|
String |
add(TransformationUtility utility,
String utilityName)
Adds a new transformation utility to the end of the list.
|
String |
addMultiple(TransformationOperation templateOperation,
String... attributes)
Adds a special transformation utility to perform multiple transformation operations against
multiple files specified as a list, held as a transformation context attribute
|
void |
debug(String debugMessage)
Adds a new
Log TU to the list,
setting its log level to DEBUG |
void |
debug(String debugMessage,
String... attributeNames)
Adds a new
Log TU to the list,
setting its log level to DEBUG. |
String |
getApplicationName()
Returns the name of the transformed application,
Returns null if the application name is unknown.
|
String |
getApplicationType()
Returns the type of the transformed application,
Returns null if the application type is unknown.
|
List<TransformationUtility> |
getChildren()
Return an immutable list of all children
|
abstract String |
getDescription()
Returns the transformation template description
|
abstract Class<? extends Extension> |
getExtensionClass()
Returns the class of the extension this transformation
template belongs to
|
String |
getName()
Return the name of this transformation utility parent
|
List<TransformationUtility> |
getUtilities()
Returns a read-only ordered list of transformation utilities to be executed,
which defines the actual transformation offered by this template
|
void |
info(String infoMessage)
Adds a new
Log TU to the list,
setting its log level to INFO |
void |
info(String infoMessage,
String... attributeNames)
Adds a new
Log TU to the list,
setting its log level to INFO. |
void |
log(org.slf4j.event.Level logLevel,
String logMessage)
Adds a new
Log TU to the list |
void |
log(org.slf4j.event.Level logLevel,
String logMessage,
String... attributeNames)
Adds a new
Log TU to the list. |
void |
log(String logMessage)
Deprecated.
|
void |
log(String logMessage,
String... attributeNames)
Deprecated.
|
String |
loop(TransformationUtility utility,
int iterations)
Execute an utility in a loop a number times specified in
iterations |
String |
loop(TransformationUtility utility,
String attribute)
Execute an utility in a loop while the value in
TransformationContext attribute is true. |
String |
loop(TransformationUtility utility,
UtilityCondition condition)
Execute an utility in a loop while the execution value resulted by
condition is true. |
String |
toString() |
public abstract Class<? extends Extension> getExtensionClass()
public abstract String getDescription()
public final String add(TransformationUtility utility)
utility
- the utility to be addedpublic final String add(TransformationUtility utility, String utilityName)
utility
- the utility to be addedutilityName
- the name to be set to the utility before adding itpublic final String addMultiple(TransformationOperation templateOperation, String... attributes)
templateOperation
- a template of transformation operation to be performed
against all specified filesattributes
- one or more transformation context attributes that hold list
of Files which the transformation operations should perform
againstpublic final String loop(TransformationUtility utility, int iterations)
iterations
utility
- the utility to be executed each iteration of the loop. To execute more than one, use a TransformationUtilityGroup
iterations
- the number of iterations to be executedpublic final String loop(TransformationUtility utility, String attribute)
TransformationContext
attribute is true.
The defined is specified based on its name, specified in attribute
.
If the attribute value is not a boolean, or if non-existent, it will be treated as false.utility
- the utility to be executed each iteration of the loop. To execute more than one, use a TransformationUtilityGroup
attribute
- the name of the transformation context attribute to hold the loop conditionpublic final String loop(TransformationUtility utility, UtilityCondition condition)
condition
is true.
The TransformationUtility
object referenced by condition
won't be saved to the TransformationContext
,
it will be executed exclusively to the scope of this loop execution.
Any result other than a boolean true value, including failures, will be treated as false.utility
- the utility to be executed each iteration of the loop. To execute more than one, use a TransformationUtilityGroup
condition
- the UtilityCondition
object whose execution result will be used as the loop condition@Deprecated public final void log(String logMessage)
info(String)
instead.
Adds a new Log
TU to the listlogMessage
- the message to be loggedpublic final void info(String infoMessage)
Log
TU to the list,
setting its log level to INFOinfoMessage
- the info message to be loggedpublic final void debug(String debugMessage)
Log
TU to the list,
setting its log level to DEBUGdebugMessage
- the debug message to be loggedpublic final void log(org.slf4j.event.Level logLevel, String logMessage)
Log
TU to the listlogLevel
- the log levellogMessage
- the message to be logged@Deprecated public final void log(String logMessage, String... attributeNames)
info(String, String...)
instead.
Adds a new Log
TU to the list.
The log messages may contain placeholders to be replaced by transformation context
attribute values. Use {}
as placeholder marker.logMessage
- the message to be logged, containing {}
placeholders to be replaced by
transformation context attribute valuesattributeNames
- an array of names of transformation context attributes, whose values
are going to be used in the log messagepublic final void info(String infoMessage, String... attributeNames)
Log
TU to the list,
setting its log level to INFO.
The log messages may contain placeholders to be replaced by transformation context
attribute values. Use {}
as placeholder marker.infoMessage
- the info message to be logged, containing {}
placeholders to be replaced by
transformation context attribute valuesattributeNames
- an array of names of transformation context attributes, whose values
are going to be used in the log messagepublic final void debug(String debugMessage, String... attributeNames)
Log
TU to the list,
setting its log level to DEBUG.
The log messages may contain placeholders to be replaced by transformation context
attribute values. Use {}
as placeholder marker.debugMessage
- the debug message to be logged, containing {}
placeholders to be replaced by
transformation context attribute valuesattributeNames
- an array of names of transformation context attributes, whose values
are going to be used in the log messagepublic final void log(org.slf4j.event.Level logLevel, String logMessage, String... attributeNames)
Log
TU to the list.
The log messages may contain placeholders to be replaced by transformation context
attribute values. Use {}
as placeholder marker.logLevel
- the log levellogMessage
- the message to be logged, containing {}
placeholders to be replaced by
transformation context attribute valuesattributeNames
- an array of names of transformation context attributes, whose values
are going to be used in the log messagepublic final List<TransformationUtility> getUtilities()
public List<TransformationUtility> getChildren()
com.paypal.butterfly.extensions.api.TransformationUtilityParent
public final String getName()
com.paypal.butterfly.extensions.api.TransformationUtilityParent
public String getApplicationType()
public String getApplicationName()
Copyright © 2018. All rights reserved.