@ SuppressWarnings ( "deprecation" ) static void addTransformations ( ModelVersion version , ResourceTransformationDescriptionBuilder builder ) { if ( JGroupsModel . VERSION_5_0_0 . requiresTransformation ( version ) ) { builder . getAttributeBuilder ( ) . setDiscard ( DiscardAttributeChecker . UNDEFINED , Attribute . STATISTICS_ENABLED . getDefinition ( ) ) . addRejectCheck ( RejectAttributeChecker . DEFINED , Attribute . STATISTICS_ENABLED . getDefinition ( ) ) . end ( ) ; } if ( JGroupsModel . VERSION_3_0_0 . requiresTransformation ( version ) ) { AttributeConverter typeConverter = new AttributeConverter . DefaultAttributeConverter ( ) { @ Override protected void convertAttribute ( PathAddress address , String name , ModelNode value , TransformationContext context ) { if ( ! value . isDefined ( ) ) { value . set ( address . getLastElement ( ) . getValue ( ) ) ; } } } ; builder . getAttributeBuilder ( ) . setDiscard ( new DiscardAttributeChecker . DiscardAttributeValueChecker ( Attribute . MODULE . getDefinition ( ) . getDefaultValue ( ) ) , Attribute . MODULE . getDefinition ( ) ) . addRejectCheck ( RejectAttributeChecker . DEFINED , Attribute . MODULE . getDefinition ( ) ) . setValueConverter ( typeConverter , DeprecatedAttribute . TYPE . getDefinition ( ) ) . end ( ) ; builder . addRawOperationTransformationOverride ( MapOperations . MAP_GET_DEFINITION . getName ( ) , new SimpleOperationTransformer ( new LegacyPropertyMapGetOperationTransformer ( ) ) ) ; for ( String opName : Operations . getAllWriteAttributeOperationNames ( ) ) { builder . addOperationTransformationOverride ( opName ) . inheritResourceAttributeDefinitions ( ) . setCustomOperationTransformer ( new LegacyPropertyWriteOperationTransformer ( ) ) ; } } PropertyResourceDefinition . buildTransformation ( version , builder ) ; }
Builds transformations common to both stack protocols and transport .