@ Deprecated private static ListAttributeDefinition wrapAsList ( final AttributeDefinition def ) { final ListAttributeDefinition list = new ListAttributeDefinition ( new SimpleListAttributeDefinition . Builder ( def . getName ( ) , def ) . setElementValidator ( def . getValidator ( ) ) ) { @ Override public ModelNode getNoTextDescription ( boolean forOperation ) { final ModelNode model = super . getNoTextDescription ( forOperation ) ; setValueType ( model ) ; return model ; } @ Override protected void addValueTypeDescription ( final ModelNode node , final ResourceBundle bundle ) { setValueType ( node ) ; } @ Override public void marshallAsElement ( final ModelNode resourceModel , final boolean marshalDefault , final XMLStreamWriter writer ) throws XMLStreamException { throw new RuntimeException ( ) ; } @ Override protected void addAttributeValueTypeDescription ( ModelNode node , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { setValueType ( node ) ; } @ Override protected void addOperationParameterValueTypeDescription ( ModelNode node , String operationName , ResourceDescriptionResolver resolver , Locale locale , ResourceBundle bundle ) { setValueType ( node ) ; } private void setValueType ( ModelNode node ) { node . get ( ModelDescriptionConstants . VALUE_TYPE ) . set ( ModelType . STRING ) ; } } ; return list ; }
Wrap a simple attribute def as list .