Class TextNavigation
- java.lang.Object
-
- org.odftoolkit.odfdom.incubator.search.Navigation
-
- org.odftoolkit.odfdom.incubator.search.TextNavigation
-
public class TextNavigation extends Navigation
A derived Navigation class used for navigate the text content it is used to search the document and find the matched text and would return TextSelection instance
-
-
Constructor Summary
Constructors Constructor Description TextNavigation(String pattern, OdfTextDocument doc)
Construct TextNavigation with matched condition and navigation scopeTextNavigation(Pattern pattern, OdfTextDocument doc)
Construct TextNavigation with matched condition and navigation scope
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Selection
getCurrentItem()
get the current Selection resultboolean
hasNext()
Return true if document still has more matched Selection when traversing the document(In other words return true if getNextMatchElement() would return an element instance rather than return null)boolean
match(Node element)
check if the text content of element match the specified pattern string-
Methods inherited from class org.odftoolkit.odfdom.incubator.search.Navigation
getNextMatchElement, getNextMatchElementInTree
-
-
-
-
Constructor Detail
-
TextNavigation
public TextNavigation(String pattern, OdfTextDocument doc)
Construct TextNavigation with matched condition and navigation scope- Parameters:
pattern
- the matched pattern Stringdoc
- the navigation scope
-
TextNavigation
public TextNavigation(Pattern pattern, OdfTextDocument doc)
Construct TextNavigation with matched condition and navigation scope- Parameters:
pattern
- the Pattern object to search withdoc
- the navigation scope
-
-
Method Detail
-
getCurrentItem
public Selection getCurrentItem()
Description copied from class:Navigation
get the current Selection result- Specified by:
getCurrentItem
in classNavigation
- Returns:
- the current Selection result
-
hasNext
public boolean hasNext()
Description copied from class:Navigation
Return true if document still has more matched Selection when traversing the document(In other words return true if getNextMatchElement() would return an element instance rather than return null)- Specified by:
hasNext
in classNavigation
- Returns:
- true if document still has more matched Selection, and vice versa
-
match
public boolean match(Node element)
check if the text content of element match the specified pattern string- Specified by:
match
in classNavigation
- Parameters:
element
- navigate this element- Returns:
- true if the text content of this element match this pattern; false if not match
-
-