public static Map<String, Map<String, String>> loadedFilters() {
    final Map<String, Map<String, String>> filters = 
        new HashMap<String, Map<String, String>>(tagv_filter_map.size());
    for (final Pair<Class<?>, Constructor<? extends TagVFilter>> pair : 
        tagv_filter_map.values()) {
      final Map<String, String> filter_meta = new HashMap<String, String>(1);
      try {
        Method method = pair.getKey().getDeclaredMethod("description");
        filter_meta.put("description", (String)method.invoke(null));
        
        method = pair.getKey().getDeclaredMethod("examples");
        filter_meta.put("examples", (String)method.invoke(null));
        
        final Field filter_name = pair.getKey().getDeclaredField("FILTER_NAME");
        filters.put((String)filter_name.get(null), filter_meta);
      } catch (SecurityException e) {
        throw new RuntimeException("Unexpected security exception", e);
      } catch (NoSuchMethodException e) {
        LOG.error("Filter plugin " + pair.getClass().getCanonicalName() + 
            " did not implement one of the \"description\" or \"examples\" methods");
      } catch (NoSuchFieldException e) {
        LOG.error("Filter plugin " + pair.getClass().getCanonicalName() + 
            " did not have the \"FILTER_NAME\" field");
      } catch (IllegalArgumentException e) {
        throw new RuntimeException("Unexpected exception", e);
      } catch (IllegalAccessException e) {
        throw new RuntimeException("Unexpected security exception", e);
      } catch (InvocationTargetException e) {
        throw new RuntimeException("Unexpected security exception", e);
      }
      
    }
    return filters;
  }
public static Map < String , Map < String , String > > loadedFilters ( ) { final Map < String , Map < String , String > > filters = new HashMap < String , Map < String , String > > ( tagv_filter_map . size ( ) ) ; for ( final Pair < Class < ? > , Constructor < ? extends TagVFilter > > pair : tagv_filter_map . values ( ) ) { final Map < String , String > filter_meta = new HashMap < String , String > ( 1 ) ; try { Method method = pair . getKey ( ) . getDeclaredMethod ( "description" ) ; filter_meta . put ( "description" , ( String ) method . invoke ( null ) ) ; method = pair . getKey ( ) . getDeclaredMethod ( "examples" ) ; filter_meta . put ( "examples" , ( String ) method . invoke ( null ) ) ; final Field filter_name = pair . getKey ( ) . getDeclaredField ( "FILTER_NAME" ) ; filters . put ( ( String ) filter_name . get ( null ) , filter_meta ) ; } catch ( SecurityException e ) { throw new RuntimeException ( "Unexpected security exception" , e ) ; } catch ( NoSuchMethodException e ) { LOG . error ( "Filter plugin " + pair . getClass ( ) . getCanonicalName ( ) + " did not implement one of the \"description\" or \"examples\" methods" ) ; } catch ( NoSuchFieldException e ) { LOG . error ( "Filter plugin " + pair . getClass ( ) . getCanonicalName ( ) + " did not have the \"FILTER_NAME\" field" ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( "Unexpected exception" , e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( "Unexpected security exception" , e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( "Unexpected security exception" , e ) ; } } return filters ; }
Runs through the loaded plugin map and dumps the names, description and
examples into a map to serialize via the API.
@return A map of filter meta data.