@Override public IMethodFilter setFilterData(String filterData) { String[] strPlaces = filterData.split("\\|"); if (strPlaces.length>0){ places = new ArrayList<MethodPlace>(strPlaces.length); for (String strPl : strPlaces) { MethodPlace pl = MethodPlace.valueOf(strPl); if (pl!=null){ places.add(pl); } } } return this; }
@Override public boolean isSupportedMethod(IMethodContext dataObject) { if (places!=null && dataObject.getPlace()!=null){ for (MethodPlace methodPlace : places) { if (methodPlace.equals(dataObject.getPlace())){ return true; } } } return false; }
@Override public IMethod getMethod(IMethodContext dataObject) { try { IMethod newMethod=null; if(MethodPlace.DATA_TABLE.equals(dataObject.getPlace())){ newMethod = getTableIMethodClass().newInstance(); }else{ newMethod = getIMethodClass().newInstance(); } if (newMethod!=null){ newMethod.init(this, dataObject); return newMethod; } } catch (InstantiationException | IllegalAccessException e) { LOG.error("Can't obtain a method", e); } return null; }