org.odftoolkit.simple.common.navigation
public class TextNavigation extends Navigation
Navigation
class used to navigate the text content,
which can search the document and find the matched text and return
TextSelection
instance.Constructor and Description |
---|
TextNavigation(String pattern,
Document doc)
Construct
TextNavigation with matched condition and
navigation scope. |
TextNavigation(String pattern,
OdfElement element)
Construct
TextNavigation with matched condition and
navigation scope. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Check if has next
TextSelection with satisfied content
pattern. |
boolean |
match(Node element)
Check if the text content of element match the specified matched
condition, which is stated when the
TextNavigation created. |
Selection |
nextSelection()
Get next
TextSelection . |
getNextMatchElement, getNextMatchElementInTree
public TextNavigation(String pattern, Document doc)
TextNavigation
with matched condition and
navigation scope.pattern
- the matched pattern Stringdoc
- the navigation scopepublic TextNavigation(String pattern, OdfElement element)
TextNavigation
with matched condition and
navigation scope.pattern
- the matched pattern Stringelement
- the ODF element whose content will be navigated.public boolean hasNext()
TextSelection
with satisfied content
pattern.hasNext
in class Navigation
Navigation.hasNext()
public Selection nextSelection()
TextSelection
.nextSelection
in class Navigation
Selection
resultNavigation.nextSelection()
public boolean match(Node element)
TextNavigation
created.match
in class Navigation
element
- navigate this elementCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.