public static RESTParameter fromUNode ( UNode paramNode ) { RESTParameter param = new RESTParameter ( ) ; String name = paramNode . getName ( ) ; Utils . require ( ! Utils . isEmpty ( name ) , "Missing parameter name: " + paramNode ) ; param . setName ( name ) ; for ( UNode childNode : paramNode . getMemberList ( ) ) { switch ( childNode . getName ( ) ) { case "_required" : param . setRequired ( Boolean . parseBoolean ( childNode . getValue ( ) ) ) ; break ; case "_type" : param . setType ( childNode . getValue ( ) ) ; break ; default : // Ignore system properties we don't recognize. if ( childNode . getName ( ) . charAt ( 0 ) != ' ' ) { param . add ( RESTParameter . fromUNode ( childNode ) ) ; } break ; } } return param ; }
Create a new RESTParameter object from the given UNode tree .