Interface BaseAttributeTransformationDescriptionBuilder<T extends BaseAttributeTransformationDescriptionBuilder<?>>
-
- All Known Subinterfaces:
AttributeTransformationDescriptionBuilder,OperationTransformationOverrideBuilder
public interface BaseAttributeTransformationDescriptionBuilder<T extends BaseAttributeTransformationDescriptionBuilder<?>>Builder for the attribute transformer for a resource/operation. The transformer created by this interface executes the following phases in the following order: All attributes are processed in each phase before moving onto the next one. See the individual methods for information about how to add rules for each phase. TheDISCARD- All attributes with aDiscardAttributeCheckerregistered are checked to see if the attribute should be discarded, and gets discarded if that is the outcome. If an attribute is discarded it does not get passed to the next phases.REJECT- All attributes with aRejectAttributeCheckers registered (and which have not been discarded) are checked to see if the attribute should be rejectedCONVERT- All attributes with aAttributeConverterregistered are checked to see if the attribute should be converted. If the attribute does not exist in the original operation/resource theAttributeConvertermay register a new attributeRENAME- All attributes with a rename registered are renamedResourceTransformerwhich may be registered for a resource inResourceTransformationDescriptionBuilder.setCustomResourceTransformer(org.jboss.as.controller.transform.ResourceTransformer)is executed after all the conversions done by this builder.- Author:
- Emanuel Muckenhuber, Kabir Khan
- See Also:
ResourceTransformationDescriptionBuilder.getAttributeBuilder(),ResourceTransformationDescriptionBuilder.setCustomResourceTransformer(org.jboss.as.controller.transform.ResourceTransformer)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TaddRejectCheck(RejectAttributeChecker rejectChecker, String... rejectedAttributes)Adds a RejectAttributeChecker.TaddRejectCheck(RejectAttributeChecker rejectChecker, AttributeDefinition... rejectedAttributes)Adds a RejectAttributeChecker.TaddRejectChecks(List<RejectAttributeChecker> rejectCheckers, String... rejectedAttributes)Adds a list of RejectAttributeCheckers.TaddRejectChecks(List<RejectAttributeChecker> rejectCheckers, AttributeDefinition... rejectedAttributes)Adds a list of RejectAttributeCheckers.TaddRename(String attributeName, String newName)Rename an attribute.TaddRename(AttributeDefinition attributeName, String newName)Rename an attribute.TaddRenames(Map<String,String> renames)Rename attributes.ResourceTransformationDescriptionBuilderend()Finish with this attribute builder and return control to the parent resource transformation builderTsetDiscard(DiscardAttributeChecker discardChecker, String... discardedAttributes)Sets the DiscardChecker to be used to check if an attribute should be discarded.TsetDiscard(DiscardAttributeChecker discardChecker, Collection<AttributeDefinition> discardedAttributes)Sets the DiscardChecker to be used to check if an attribute should be discarded.TsetDiscard(DiscardAttributeChecker discardChecker, AttributeDefinition... discardedAttributes)Sets the DiscardChecker to be used to check if an attribute should be discarded.TsetValueConverter(AttributeConverter attributeConverter, String... convertedAttributes)Use to convert an attribute's value.TsetValueConverter(AttributeConverter attributeConverter, AttributeDefinition... convertedAttributes)Use to convert an attribute's value.
-
-
-
Method Detail
-
addRejectCheck
T addRejectCheck(RejectAttributeChecker rejectChecker, String... rejectedAttributes)
Adds a RejectAttributeChecker. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.Rejection is done in the
REJECTphase.- Parameters:
rejectChecker- the checkerrejectedAttributes- the attributes to check- Returns:
- this builder
-
addRejectCheck
T addRejectCheck(RejectAttributeChecker rejectChecker, AttributeDefinition... rejectedAttributes)
Adds a RejectAttributeChecker. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.Rejection is done in the
REJECTphase.- Parameters:
rejectChecker- the checkerrejectedAttributes- the attributes to check- Returns:
- this builder
-
addRejectChecks
T addRejectChecks(List<RejectAttributeChecker> rejectCheckers, String... rejectedAttributes)
Adds a list of RejectAttributeCheckers. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.Rejection is done in the
REJECTphase.- Parameters:
rejectCheckers- the checkersrejectedAttributes- the attributes to check- Returns:
- this builder
-
addRejectChecks
T addRejectChecks(List<RejectAttributeChecker> rejectCheckers, AttributeDefinition... rejectedAttributes)
Adds a list of RejectAttributeCheckers. More than one reject checker can be used for an attribute, and the RejectAttributeCheckers are processed in the order they are added to the passed in attributes.Rejection is done in the
REJECTphase.- Parameters:
rejectCheckers- the checkersrejectedAttributes- the attributes to check- Returns:
- this builder
-
setDiscard
T setDiscard(DiscardAttributeChecker discardChecker, String... discardedAttributes)
Sets the DiscardChecker to be used to check if an attribute should be discarded. Only one discard checker can be used for an attribute.Discard is done in the
DISCARDphase.- Parameters:
discardChecker- the checkersdiscardedAttributes- the attributes to check- Returns:
- this builder
-
setDiscard
T setDiscard(DiscardAttributeChecker discardChecker, AttributeDefinition... discardedAttributes)
Sets the DiscardChecker to be used to check if an attribute should be discarded. Only one discard checker can be used for an attribute.Discard is done in the
DISCARDphase.- Parameters:
discardChecker- the checkersdiscardedAttributes- the attributes to check- Returns:
- this builder
-
setDiscard
T setDiscard(DiscardAttributeChecker discardChecker, Collection<AttributeDefinition> discardedAttributes)
Sets the DiscardChecker to be used to check if an attribute should be discarded. Only one discard checker can be used for an attribute.Discard is done in the
DISCARDphase.- Parameters:
discardChecker- the checkersdiscardedAttributes- the attributes to check- Returns:
- this builder
-
addRename
T addRename(String attributeName, String newName)
Rename an attribute. An attribute can only be renamed once.Renaming is done in the
RENAMEphase.- Parameters:
attributeName- the attribute's original namenewName- the new name for the attribute- Returns:
- this builder
-
addRename
T addRename(AttributeDefinition attributeName, String newName)
Rename an attribute. An attribute can only be renamed once.Renaming is done in the
RENAMEphase.- Parameters:
attributeName- the attribute's original namenewName- the new name for the attribute- Returns:
- this builder
-
addRenames
T addRenames(Map<String,String> renames)
Rename attributes. Each attribute can only be renamed once.Renaming is done in the
RENAMEphase.- Parameters:
renames- a Map where the keys are the original attribute names, and the values are the new attribute names- Returns:
- this builder
-
setValueConverter
T setValueConverter(AttributeConverter attributeConverter, String... convertedAttributes)
Use to convert an attribute's value. If it is a new attribute that did not exist in the original resource/operation, it is added. Only one AttributeConverter can be added per attribute.Conversion/Adding is done in the
CONVERTphase.- Parameters:
attributeConverter- the attribute converter used to convert the value of each attributeconvertedAttributes- the attributes the attribute converter should be used on- Returns:
- this builder
-
setValueConverter
T setValueConverter(AttributeConverter attributeConverter, AttributeDefinition... convertedAttributes)
Use to convert an attribute's value. If it is a new attribute that did not exist in the original resource/operation, it is added. Only one AttributeConverter can be added per attribute.Conversion/Adding is done in the
CONVERTphase.- Parameters:
attributeConverter- the attribute converter used to convert the value of each attributeconvertedAttributes- the attributes the attribute converter should be used on- Returns:
- this builder
-
end
ResourceTransformationDescriptionBuilder end()
Finish with this attribute builder and return control to the parent resource transformation builder- Returns:
- the parent builder
-
-