private static BuilderDirective buildMainDirective( Element element ) throws IOException
private static BuilderDirective buildMainDirective( Element element ) throws Exception
    private static BuilderDirective buildMainDirective( Element element ) throws IOException    {        final String elementName = element.getTagName();        if( !BUILDER_ELEMENT_NAME.equals( elementName ) )        {            final String error =              "Element is not a builder confiuration.";            throw new IllegalArgumentException( error );        }                // get type descriptors, modules and properties                Properties properties = null;        ListenerDirective[] listeners = new ListenerDirective[0];        Element[] children = ElementHelper.getChildren( element );        for( int i=0; i<children.length; i++ )        {            Element child = children[i];            final String tag = child.getTagName();            if( PROPERTIES_ELEMENT_NAME.equals( tag ) )            {                properties = buildProperties( child );            }            else if( LISTENERS_ELEMENT_NAME.equals( tag ) )             {                listeners = buildListenerDirectives( child );            }            else            {                final String error =                   "Illegal element name [" + tag + "] within 'builder' element.";                throw new IllegalArgumentException( error );            }        }        return new BuilderDirective( listeners, properties );    }