|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.xml.sax.filter.ElementSelector
com.raritantechnologies.xml.sax.filter.selectors.AncestorElementSelector
This class can be used to cause the selection of an ancestor tag, based on the properties of a decendent tag.
Used in conjunction with the DispatchFilter and
SAXDeleteFilter. It overrides
the processChildElement( ) method to achieve its functionality. This method allows a
parent element to be marked for selection by the SAXDeleteFilter.
The selecter can work either on the decendant tag or on its character data.
| Nested Class Summary |
| Nested classes inherited from class com.raritantechnologies.xml.sax.filter.ElementSelector |
ElementSelector.ElementData |
| Constructor Summary | |
AncestorElementSelector()
|
|
AncestorElementSelector(ElementComparator ancestorComp,
ElementComparator decendantComp)
Constructor: takes a childComp that is used to match decendent Tags that should cause the selection of an ancestor. |
|
AncestorElementSelector(ElementComparator ancestorComp,
ElementComparator decendantComp,
CDataComparator decendantDataComp)
Overloaded version of the constructor that allows a tag to be selected if a decendant tag's character data matches the criteria specified in the CDataComparator. |
|
| Method Summary | |
void |
processCharacters(java.lang.String path,
char[] ch,
int start,
int length)
processes character data if decendant data comparator is set. |
void |
processChildElement(java.lang.String childPath,
ElementSelector.ElementData parentElement,
java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
sets the Element at path to be selected if the element comparator matches input. |
boolean |
shouldSelectElement(int startIndex)
This method is called by SAXDeleteFilter to determine if this ElementSelector
has any Elements that start at the given index and that should be selected. |
| Methods inherited from class com.raritantechnologies.xml.sax.filter.ElementSelector |
couldSelectElement, getEndMark, initialize, processChildElement, reset, selectElement, setEndMark, setSelecting |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AncestorElementSelector()
public AncestorElementSelector(ElementComparator ancestorComp,
ElementComparator decendantComp)
ancestorComp - element comparator used to identify the tag that will be selected
by the selecter (if the decendant's properties are matched)decendantComp - element comparator used to identity decendant tag that can trigger
the selection of its ancestor. selection will occur if a decendant
tag matches the criteria of this element comparator.
public AncestorElementSelector(ElementComparator ancestorComp,
ElementComparator decendantComp,
CDataComparator decendantDataComp)
ancestorComp - element comparator used to identify the tag that will be selected
by the selecter (if the decendant's properties are matched)decendantComp - element comparator used to identity decendant tag that can trigger
the selection of its ancestor. In this case, the selection is deferred
to analysis of the character data section of the tag.| Method Detail |
public void processChildElement(java.lang.String childPath,
ElementSelector.ElementData parentElement,
java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
processChildElement in class ElementSelector
public void processCharacters(java.lang.String path,
char[] ch,
int start,
int length)
processCharacters in class ElementSelectorpublic boolean shouldSelectElement(int startIndex)
ElementSelectorSAXDeleteFilter to determine if this ElementSelector
has any Elements that start at the given index and that should be selected.
Either: we have an element at this index that shouldn't be selected, should be selected
or we don't have an element at this index.
shouldSelectElement in class ElementSelector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||