public static OptionHandler parseElement ( final Element element , final Properties props , final Class expectedClass ) throws Exception { String clazz = subst ( element . getAttribute ( "class" ) , props ) ; Object instance = OptionConverter . instantiateByClassName ( clazz , expectedClass , null ) ; if ( instance instanceof OptionHandler ) { OptionHandler optionHandler = ( OptionHandler ) instance ; PropertySetter propSetter = new PropertySetter ( optionHandler ) ; NodeList children = element . getChildNodes ( ) ; final int length = children . getLength ( ) ; for ( int loop = 0 ; loop < length ; loop ++ ) { Node currentNode = children . item ( loop ) ; if ( currentNode . getNodeType ( ) == Node . ELEMENT_NODE ) { Element currentElement = ( Element ) currentNode ; String tagName = currentElement . getTagName ( ) ; if ( tagName . equals ( "param" ) ) { setParameter ( currentElement , propSetter , props ) ; } else { parseUnrecognizedElement ( instance , currentElement , props ) ; } } } return optionHandler ; } return null ; }
Creates an OptionHandler and processes any nested param elements but does not call activateOptions . If the class also supports UnrecognizedElementParser the parseUnrecognizedElement method will be call for any child elements other than param .