/** * * @param gconf * @return a filter * @throws SLIB_Ex_Critic */ public static Filter buildFilter(Conf gconf) throws SLIB_Ex_Critic { Filter f = null; String id = (String) gconf.getParam(XmlTags.ID_ATTR); String type = (String) gconf.getParam(XmlTags.TYPE_ATTR); if (id == null) { Util.error("Missing " + XmlTags.ID_ATTR + " in a filter specification"); } if (type == null) { Util.error("Missing " + XmlTags.TYPE_ATTR + " in a filter specification"); } if (!supportType(type)) { Util.error("Unsupported Filter type " + type + " found in filter '" + id + "' specification"); } if (type.equals(FilterGraph_GAF2_cst.TYPE)) { f = new FilterGraph_GAF2(gconf); } else if (type.equals(FilterGraph_Metrics_cst.TYPE)) { f = new FilterGraph_Metrics(gconf); } else // do not pass { throw new UnsupportedOperationException("Sorry, filter is not taking into account, please repor the issue"); } return f; }
/** * * @param gconf * @return a filter * @throws SLIB_Ex_Critic */ public static Filter buildFilter(Conf gconf) throws SLIB_Ex_Critic { Filter f = null; String id = (String) gconf.getParam(XmlTags.ID_ATTR); String type = (String) gconf.getParam(XmlTags.TYPE_ATTR); if (id == null) { Util.error("Missing " + XmlTags.ID_ATTR + " in a filter specification"); } if (type == null) { Util.error("Missing " + XmlTags.TYPE_ATTR + " in a filter specification"); } if (!supportType(type)) { Util.error("Unsupported Filter type " + type + " found in filter '" + id + "' specification"); } if (type.equals(FilterGraph_GAF2_cst.TYPE)) { f = new FilterGraph_GAF2(gconf); } else if (type.equals(FilterGraph_Metrics_cst.TYPE)) { f = new FilterGraph_Metrics(gconf); } else // do not pass { throw new UnsupportedOperationException("Sorry, filter is not taking into account, please repor the issue"); } return f; }