static Property getProperty ( String propName , ModelNode attrs ) { String [ ] arr = propName . split ( "\\." ) ; ModelNode attrDescr = attrs ; for ( String item : arr ) { // Remove list part. if ( item . endsWith ( "]" ) ) { int i = item . indexOf ( "[" ) ; if ( i < 0 ) { return null ; } item = item . substring ( 0 , i ) ; } ModelNode descr = attrDescr . get ( item ) ; if ( ! descr . isDefined ( ) ) { if ( attrDescr . has ( Util . VALUE_TYPE ) ) { ModelNode vt = attrDescr . get ( Util . VALUE_TYPE ) ; if ( vt . has ( item ) ) { attrDescr = vt . get ( item ) ; continue ; } } return null ; } attrDescr = descr ; } return new Property ( propName , attrDescr ) ; }
package for testing purpose