org.apache.cocoon.stax.navigation
Class FindCorrespondingStartEndElementPairNavigator

java.lang.Object
  extended by org.apache.cocoon.stax.navigation.FindCorrespondingStartEndElementPairNavigator
All Implemented Interfaces:
Navigator

public class FindCorrespondingStartEndElementPairNavigator
extends Object
implements Navigator

This implementation of the Navigator returns true every time a StartElement is entered to Navigator.fulfillsCriteria(XMLEvent) and matches all other conditions entered to the Navigator during its creation. Also true is returned if the corresponding EndElement is found. This Navigator is quite similar to the InSubtreeNavigator with the difference that false is returned for all elements between the found StartElement and EndElement except another StartElement matching all conditions.

  <anyElement> -> false
      <searchedElement> -> true
          <searchedElement> -> true
          <anyElement/> -> false
          </searchedElement> -> true
      </searchedElement> -> true
  </anyElement> -> false
 


Constructor Summary
FindCorrespondingStartEndElementPairNavigator(String name)
           
FindCorrespondingStartEndElementPairNavigator(String name, Attribute... attributes)
           
FindCorrespondingStartEndElementPairNavigator(String name, List<Attribute> attributes)
           
 
Method Summary
 boolean fulfillsCriteria(XMLEvent event)
          Depending on the XMLEvent it is returned if the navigator fulfills the criteria the Navigator is build for.
 boolean isActive()
          Every time the Navigator.fulfillsCriteria(XMLEvent) the value returned by this method is stored internally in the Navigator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindCorrespondingStartEndElementPairNavigator

public FindCorrespondingStartEndElementPairNavigator(String name)

FindCorrespondingStartEndElementPairNavigator

public FindCorrespondingStartEndElementPairNavigator(String name,
                                                     List<Attribute> attributes)

FindCorrespondingStartEndElementPairNavigator

public FindCorrespondingStartEndElementPairNavigator(String name,
                                                     Attribute... attributes)
Method Detail

fulfillsCriteria

public boolean fulfillsCriteria(XMLEvent event)
Depending on the XMLEvent it is returned if the navigator fulfills the criteria the Navigator is build for.

Specified by:
fulfillsCriteria in interface Navigator
Parameters:
event - of the XML analyzed at the moment.
Returns:
if the XMLEvent full fills all criteria of the Navigator.
See Also:
Navigator.fulfillsCriteria(javax.xml.stream.events.XMLEvent)

isActive

public boolean isActive()
Every time the Navigator.fulfillsCriteria(XMLEvent) the value returned by this method is stored internally in the Navigator. As long as the Navigator.fulfillsCriteria(XMLEvent) method is not called again this method returns the last returned value of the Navigator.fulfillsCriteria(XMLEvent) method. As long the Navigator.fulfillsCriteria(XMLEvent) is not called false should be returned.

Specified by:
isActive in interface Navigator
Returns:
the actual value returned by the Navigator.fulfillsCriteria(XMLEvent) method.
See Also:
Navigator.isActive()


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.