public final void addFeature ( final String id , final Element elem ) { boolean isFile ; String value = elem . getAttribute ( "file" ) ; if ( ! value . isEmpty ( ) ) { isFile = true ; } else { value = elem . getAttribute ( "value" ) ; isFile = "file" . equals ( elem . getAttribute ( "type" ) ) ; } final StringTokenizer valueTokenizer = new StringTokenizer ( value , Integrator . FEAT_VALUE_SEPARATOR ) ; final List < String > valueBuffer = new ArrayList <> ( ) ; if ( featureTable . containsKey ( id ) ) { valueBuffer . addAll ( featureTable . get ( id ) ) ; } while ( valueTokenizer . hasMoreElements ( ) ) { final String valueElement = valueTokenizer . nextToken ( ) ; if ( valueElement != null && valueElement . trim ( ) . length ( ) != 0 ) { if ( isFile && ! FileUtils . isAbsolutePath ( valueElement ) ) { if ( id . equals ( "ant.import" ) ) { valueBuffer . add ( "${dita.plugin." + this . id + ".dir}" + File . separator + valueElement . trim ( ) ) ; } else { valueBuffer . add ( pluginDir + File . separator + valueElement . trim ( ) ) ; } } else { valueBuffer . add ( valueElement . trim ( ) ) ; } } } featureTable . put ( id , valueBuffer ) ; }
Add feature to the feature table .