public class Iteration extends org.ocpsoft.rewrite.config.DefaultOperationBuilder implements IterationBuilderVar, IterationBuilderOver, IterationBuilderWhen, IterationBuilderPerform, IterationBuilderOtherwise, IterationBuilderComplete, org.ocpsoft.rewrite.config.CompositeOperation, org.ocpsoft.rewrite.param.Parameterized
ConfigurationRuleBuilder.when(Condition) clause in
the current rule.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SINGLE_VARIABLE_STRING |
static String |
DEFAULT_VARIABLE_LIST_STRING |
| Modifier and Type | Method and Description |
|---|---|
IterationBuilderWhen |
all(org.ocpsoft.rewrite.config.Condition... condition) |
IterationBuilderVar |
as(Class<? extends WindupVertexFrame> varType,
String var)
Change the name of the single variable of the given type.
|
IterationBuilderVar |
as(String var)
Change the name of the single variable.
|
IterationBuilderComplete |
endIteration()
Visual end of the iteration.
|
static <FRAMETYPE extends WindupVertexFrame> |
getCurrentPayload(Variables stack,
Class<FRAMETYPE> type,
String name)
Get the
Iteration payload with the given name and type. |
static <FRAMETYPE extends WindupVertexFrame> |
getCurrentPayload(Variables stack,
String name)
Get the
Iteration payload with the given name. |
List<org.ocpsoft.rewrite.config.Operation> |
getOperations() |
IterationPayloadManager |
getPayloadManager() |
static String |
getPayloadVariableName(GraphRewrite event,
org.ocpsoft.rewrite.context.EvaluationContext ctx)
Return the current
Iteration payload variable name. |
Set<String> |
getRequiredParameterNames()
These are really just needed to pass through to the condition, since the visitor system
doesn't expect operations to have conditions and wouldn't otherwise find them.
|
FramesSelector |
getSelectionManager() |
IterationBuilderOtherwise |
otherwise(org.ocpsoft.rewrite.config.Operation operation)
Perform the given
Operation when the conditions set in this Iteration are met. |
static IterationBuilderOver |
over()
|
static IterationBuilderOver |
over(Class<? extends WindupVertexFrame> sourceType)
Begin an
Iteration over the selection of the given type, named with the default name. |
static IterationBuilderOver |
over(Class<? extends WindupVertexFrame> sourceType,
String source)
Begin an
Iteration over the named selection of the given type. |
static IterationBuilderOver |
over(String source)
Begin an
Iteration over the named selection. |
void |
perform(GraphRewrite event,
org.ocpsoft.rewrite.context.EvaluationContext context)
Called internally to actually process the Iteration.
|
IterationBuilderPerform |
perform(org.ocpsoft.rewrite.config.Operation... operations)
Perform the given
Operation instances when the conditions set in this Iteration are met. |
IterationBuilderPerform |
perform(org.ocpsoft.rewrite.config.Operation operation)
Perform the given
Operation when the conditions set in this Iteration are met. |
void |
perform(org.ocpsoft.rewrite.event.Rewrite event,
org.ocpsoft.rewrite.context.EvaluationContext context)
Called internally to actually process the Iteration.
|
static <FRAMETYPE extends WindupVertexFrame> |
removeCurrentPayload(Variables stack,
Class<FRAMETYPE> type,
String name)
Remove the current
Iteration payload. |
static <FRAMETYPE extends WindupVertexFrame> |
removeCurrentPayload(Variables stack,
String name)
Remove the current
Iteration payload. |
static void |
setCurrentPayload(Variables stack,
String name,
WindupVertexFrame frame)
Set the current
Iteration payload. |
void |
setParameterStore(org.ocpsoft.rewrite.param.ParameterStore store)
These are really just needed to pass through to the condition, since the visitor system
doesn't expect operations to have conditions and wouldn't otherwise find them.
|
void |
setPayloadManager(IterationPayloadManager payloadManager) |
static String |
singleVariableIterationName(String selectionName)
Calculates the default name for the single variable in the selection with the given name.
|
String |
toString() |
IterationBuilderWhen |
when(org.ocpsoft.rewrite.config.Condition condition)
A condition which decides for each frame whether
IterationBuilderVar.perform(Operation) or
otherwise(Operation) will be processed. |
public static final String DEFAULT_VARIABLE_LIST_STRING
public static final String DEFAULT_SINGLE_VARIABLE_STRING
public static String singleVariableIterationName(String selectionName)
public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourceType, String source)
Iteration over the named selection of the given type. Also sets the name and type of the variable for this iteration's
"current element". The type serves for automatic type check.public static IterationBuilderOver over(String source)
Iteration over the named selection. Also sets the name of the variable for this iteration's "current element".public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourceType)
Iteration over the selection of the given type, named with the default name. Also sets the name of the variable for this
iteration's "current element" to have the default value.public static IterationBuilderOver over()
public Set<String> getRequiredParameterNames()
getRequiredParameterNames in interface org.ocpsoft.rewrite.param.Parameterizedpublic void setParameterStore(org.ocpsoft.rewrite.param.ParameterStore store)
setParameterStore in interface org.ocpsoft.rewrite.param.Parameterizedpublic IterationBuilderVar as(Class<? extends WindupVertexFrame> varType, String var)
singleVariableIterationName(String) method.as in interface IterationBuilderOverpublic IterationBuilderVar as(String var)
singleVariableIterationName(String) method.as in interface IterationBuilderOverpublic IterationBuilderWhen all(org.ocpsoft.rewrite.config.Condition... condition)
public IterationBuilderWhen when(org.ocpsoft.rewrite.config.Condition condition)
IterationBuilderVarIterationBuilderVar.perform(Operation) or
otherwise(Operation) will be processed.when in interface IterationBuilderVarpublic IterationBuilderPerform perform(org.ocpsoft.rewrite.config.Operation operation)
IterationBuilderVarOperation when the conditions set in this Iteration are met.perform in interface IterationBuilderVarperform in interface IterationBuilderWhenpublic IterationBuilderPerform perform(org.ocpsoft.rewrite.config.Operation... operations)
IterationBuilderVarOperation instances when the conditions set in this Iteration are met.perform in interface IterationBuilderVarpublic IterationBuilderOtherwise otherwise(org.ocpsoft.rewrite.config.Operation operation)
IterationBuilderPerformOperation when the conditions set in this Iteration are met.otherwise in interface IterationBuilderPerformpublic IterationBuilderComplete endIteration()
endIteration in interface IterationBuilderOtherwiseendIteration in interface IterationBuilderPerformpublic void perform(org.ocpsoft.rewrite.event.Rewrite event,
org.ocpsoft.rewrite.context.EvaluationContext context)
perform in interface org.ocpsoft.rewrite.config.Operationpublic void perform(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context)
public List<org.ocpsoft.rewrite.config.Operation> getOperations()
getOperations in interface org.ocpsoft.rewrite.config.CompositeOperationpublic static String getPayloadVariableName(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext ctx) throws IllegalStateException
Iteration payload variable name.IllegalStateException - if there is more than one variable in the Variables stack, and the payload name cannot be determined.public static void setCurrentPayload(Variables stack, String name, WindupVertexFrame frame) throws IllegalArgumentException
Iteration payload.IllegalArgumentExceptionpublic static <FRAMETYPE extends WindupVertexFrame> FRAMETYPE getCurrentPayload(Variables stack, String name) throws IllegalStateException, IllegalArgumentException
Iteration payload with the given name.IllegalArgumentException - if the given variable refers to a non-payload.IllegalStateExceptionpublic static <FRAMETYPE extends WindupVertexFrame> FRAMETYPE getCurrentPayload(Variables stack, Class<FRAMETYPE> type, String name) throws IllegalStateException, IllegalArgumentException
Iteration payload with the given name and type.IllegalArgumentException - if the given variable refers to a non-payload.IllegalStateExceptionpublic static <FRAMETYPE extends WindupVertexFrame> FRAMETYPE removeCurrentPayload(Variables stack, Class<FRAMETYPE> type, String name) throws IllegalStateException, IllegalTypeArgumentException
Iteration payload.public static <FRAMETYPE extends WindupVertexFrame> FRAMETYPE removeCurrentPayload(Variables stack, String name) throws IllegalStateException, IllegalTypeArgumentException
Iteration payload.public void setPayloadManager(IterationPayloadManager payloadManager)
public FramesSelector getSelectionManager()
public IterationPayloadManager getPayloadManager()
Copyright © 2021 JBoss by Red Hat. All rights reserved.