@Test public final void testRemoveFromMapByType() { try { ProfileElement element = testInstance.getElement(ELEM_SCOPE_DECIDE_RULES+"/rejectIfTooManyPathSegs"); testInstance.removeFromMapByType(ELEM_SCOPE_DECIDE_RULES, element.getType()); } catch(Exception e) { fail(e.getMessage()); } }
public void removeFromMapByType(String complexElementName, String type) { MapType mt = null; try { ComplexProfileElement ct = (ComplexProfileElement) getElement(complexElementName); mt = (MapType) ct.getValue(); List<ProfileElement> childList = ct.getChildren(true); Iterator<ProfileElement> children = childList.iterator(); while(children.hasNext()) { ProfileElement elem = children.next(); if(elem.getValue().getClass().getName().equals(type)) { mt.removeElement(crawlerSettings, elem.getName()); } } } catch(AttributeNotFoundException ex) { log.error("Could not find map with name " + complexElementName); } }
HeritrixProfile { public void removeFromMapByType(String complexElementName, String type) { MapType mt = null; try { ComplexProfileElement ct = (ComplexProfileElement) getElement(complexElementName); mt = (MapType) ct.getValue(); List<ProfileElement> childList = ct.getChildren(true); Iterator<ProfileElement> children = childList.iterator(); while(children.hasNext()) { ProfileElement elem = children.next(); if(elem.getValue().getClass().getName().equals(type)) { mt.removeElement(crawlerSettings, elem.getName()); } } } catch(AttributeNotFoundException ex) { log.error("Could not find map with name " + complexElementName); } } }
HeritrixProfile { public void removeFromMapByType(String complexElementName, String type) { MapType mt = null; try { ComplexProfileElement ct = (ComplexProfileElement) getElement(complexElementName); mt = (MapType) ct.getValue(); List<ProfileElement> childList = ct.getChildren(true); Iterator<ProfileElement> children = childList.iterator(); while(children.hasNext()) { ProfileElement elem = children.next(); if(elem.getValue().getClass().getName().equals(type)) { mt.removeElement(crawlerSettings, elem.getName()); } } } catch(AttributeNotFoundException ex) { log.error("Could not find map with name " + complexElementName); } } HeritrixProfile(XMLSettingsHandler aSettingsHandler, String aDomain); }
HeritrixProfile { public void removeFromMapByType(String complexElementName, String type) { MapType mt = null; try { ComplexProfileElement ct = (ComplexProfileElement) getElement(complexElementName); mt = (MapType) ct.getValue(); List<ProfileElement> childList = ct.getChildren(true); Iterator<ProfileElement> children = childList.iterator(); while(children.hasNext()) { ProfileElement elem = children.next(); if(elem.getValue().getClass().getName().equals(type)) { mt.removeElement(crawlerSettings, elem.getName()); } } } catch(AttributeNotFoundException ex) { log.error("Could not find map with name " + complexElementName); } } HeritrixProfile(XMLSettingsHandler aSettingsHandler, String aDomain); boolean elementExists(String anAbsoluteName); ProfileElement getElement(String anAbsoluteName); boolean moveMapElementUp(String complexElementName, String simpleElementName); boolean moveMapElementDown(String complexElementName, String simpleElementName); void removeMapElement(String complexElementName, String simpleElementName); void clearMap(String complexElementName); void setToeThreads(int toeThreadCount); void removeFromMapByType(String complexElementName, String type); void addSimpleMapElement(String complexElementName, String key, String value); void addMapElement(String complexElementName, SimpleType child); void addMapElement(String complexElementName, String newElemName, String newElemType); @SuppressWarnings("unchecked") static List<String> getOptionsForType(Class type); void setAllSimpleTypes(HttpServletRequest request, ComplexProfileElement element); void setListType(String elementName, List values); void setListType(ListType aListType, List values); void setAllSimpleTypes(HttpServletRequest request, SimpleProfileElement element); void setSimpleType(String elementPath, Object value); void setScopeClass(String scopeClass); String toString(); static HeritrixProfile create(); static HeritrixProfile create(File f); static HeritrixProfile fromString(String str); }
HeritrixProfile { public void removeFromMapByType(String complexElementName, String type) { MapType mt = null; try { ComplexProfileElement ct = (ComplexProfileElement) getElement(complexElementName); mt = (MapType) ct.getValue(); List<ProfileElement> childList = ct.getChildren(true); Iterator<ProfileElement> children = childList.iterator(); while(children.hasNext()) { ProfileElement elem = children.next(); if(elem.getValue().getClass().getName().equals(type)) { mt.removeElement(crawlerSettings, elem.getName()); } } } catch(AttributeNotFoundException ex) { log.error("Could not find map with name " + complexElementName); } } HeritrixProfile(XMLSettingsHandler aSettingsHandler, String aDomain); boolean elementExists(String anAbsoluteName); ProfileElement getElement(String anAbsoluteName); boolean moveMapElementUp(String complexElementName, String simpleElementName); boolean moveMapElementDown(String complexElementName, String simpleElementName); void removeMapElement(String complexElementName, String simpleElementName); void clearMap(String complexElementName); void setToeThreads(int toeThreadCount); void removeFromMapByType(String complexElementName, String type); void addSimpleMapElement(String complexElementName, String key, String value); void addMapElement(String complexElementName, SimpleType child); void addMapElement(String complexElementName, String newElemName, String newElemType); @SuppressWarnings("unchecked") static List<String> getOptionsForType(Class type); void setAllSimpleTypes(HttpServletRequest request, ComplexProfileElement element); void setListType(String elementName, List values); void setListType(ListType aListType, List values); void setAllSimpleTypes(HttpServletRequest request, SimpleProfileElement element); void setSimpleType(String elementPath, Object value); void setScopeClass(String scopeClass); String toString(); static HeritrixProfile create(); static HeritrixProfile create(File f); static HeritrixProfile fromString(String str);  }