Class TextStyleNavigation
- java.lang.Object
-
- org.odftoolkit.odfdom.incubator.search.Navigation<TextSelection>
-
- org.odftoolkit.odfdom.incubator.search.TextStyleNavigation
-
- All Implemented Interfaces:
Iterator<TextSelection>
public class TextStyleNavigation extends Navigation<TextSelection>
A derived Navigation class used for navigate the mText content it is used to search the document and find the matched style properties and would return TextSelection instance
-
-
Constructor Summary
Constructors Constructor Description TextStyleNavigation(Map<OdfStyleProperty,String> props, OdfTextDocument doc)Construct TextStyleNavigation with style properties condition and navigation scope
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OdfElementgetElement()SelectionManagergetSelectionManager()Returns the selectionManager instance.booleanhasNext()Returnstrueif the Document has more matching elements.booleanmatch(Node element)check if the element has the specified style propertiesTextSelectionnext()Returns the next matching element in the document.-
Methods inherited from class org.odftoolkit.odfdom.incubator.search.Navigation
getNextMatchElement, getNextMatchElementInTree
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
TextStyleNavigation
public TextStyleNavigation(Map<OdfStyleProperty,String> props, OdfTextDocument doc)
Construct TextStyleNavigation with style properties condition and navigation scope- Parameters:
props- the matched style properties conditionsdoc- the navigation search scope
-
-
Method Detail
-
getSelectionManager
public SelectionManager getSelectionManager()
Returns the selectionManager instance.- Returns:
-
next
public TextSelection next()
Returns the next matching element in the document.- Specified by:
nextin interfaceIterator<TextSelection>- Specified by:
nextin classNavigation<TextSelection>- Returns:
- the next element
- Throws:
NoSuchElementException- if the iteration has no more matching elements
-
hasNext
public boolean hasNext()
Returnstrueif the Document has more matching elements. (In other words, returnstrueifnext()would return an element rather than throwing an exception.)- Specified by:
hasNextin interfaceIterator<TextSelection>- Specified by:
hasNextin classNavigation<TextSelection>- Returns:
- true if document still has more matched Selection, and vice versa
-
getElement
public OdfElement getElement()
- Specified by:
getElementin classNavigation<TextSelection>
-
match
public boolean match(Node element)
check if the element has the specified style properties- Specified by:
matchin classNavigation<TextSelection>- Parameters:
element- navigate this element- Returns:
- true if this element has the specified style properties false if not match
-
-