if (context.isRegisterTransformers()) {
//Note that the 'cache' attribute introduced post 1.2.0 to binding=* is only usable if binding-type=external-context which is not allowed in <=1.2.0
// register 1.1.0 transformer
ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.addChildResource(NamingSubsystemModel.BINDING_PATH)
.getAttributeBuilder()
.addRejectCheck(RejectAttributeChecker.DEFINED, ENVIRONMENT)
.setDiscard(DiscardAttributeChecker.UNDEFINED, ENVIRONMENT, CACHE)
//Since we need to check the binding-type, we cannot have expressions
.addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, BINDING_TYPE)
.addRejectCheck(new BindingType11RejectChecker(), BINDING_TYPE)
.addRejectCheck(new BindingType12RejectChecker(), BINDING_TYPE)
.end();
TransformationDescription.Tools.register(builder.build(), subsystem, VERSION_1_1_0);
// register 1.2.0 and 1.3.0 transformer
builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.addChildResource(NamingSubsystemModel.BINDING_PATH)
.getAttributeBuilder()
.setDiscard(DiscardAttributeChecker.UNDEFINED, CACHE)
//Since we need to check the binding-type, we cannot have expressions
.addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, BINDING_TYPE)
.addRejectCheck(new BindingType12RejectChecker(), BINDING_TYPE)
.end();
TransformationDescription.Tools.register(builder.build(), subsystem, VERSION_1_2_0);
TransformationDescription.Tools.register(builder.build(), subsystem, VERSION_1_3_0);
}
}