|
ASPOSE home | ||||||||
java.lang.Object
com.aspose.words.Range
public class Range
The document is represented by a tree of nodes and the nodes provide operations
to work with the tree, but some operations are easier to perform if the document
is treated as a contiguous sequence of text. Range is a "facade" interface that provide methods that treat the document
or portions of the document as "flat" text regardless of the fact that the document
nodes are stored in a tree-like object model. Range does not contain any text or nodes, it is merely a view or "window"
over a fragment of a document.
| Property Getters/Setters Summary | ||
|---|---|---|
Bookmarks | getBookmarks() | |
|
Returns a |
||
FormFields | getFormFields() | |
|
Returns a |
||
java.lang.String | getText() | |
| Gets the text of the range. | ||
| Method Summary | ||
|---|---|---|
void | delete() | |
| Deletes all characters of the range. | ||
int | replace(java.lang.String oldValue, java.lang.String newValue, boolean isMatchCase, boolean isMatchWholeWord) | |
| Replaces all occurrences of a specified string with another string. | ||
int | replace(java.util.regex.Pattern pattern, ReplaceEvaluator evaluator, boolean isForward) | |
| Finds all occurrences of a character pattern specified by a regular expression and calls a user defined replace evaluator method. | ||
int | replace(java.util.regex.Pattern pattern, java.lang.String replacement) | |
| Replaces all occurrences of a character pattern specified by a regular expression with another string. | ||
void | updateFields() | |
| Updates the values of document fields in this range. Not all field types are updated. | ||
| Property Getters/Setters Detail |
|---|
getText | |
public java.lang.String getText() | |
The returned string includes all control and special characters as described in
getFormFields | |
public FormFields getFormFields() | |
getBookmarks | |
public Bookmarks getBookmarks() | |
| Method Detail |
|---|
delete | |
public void delete()
throws java.lang.Exception | |
replace | |
public int replace(java.lang.String oldValue, java.lang.String newValue, boolean isMatchCase, boolean isMatchWholeWord)
throws java.lang.Exception | |
An exception is thrown if a captured or replacement string contain one or more special characters: paragraph break, cell break, section break, field start, field separator, field end, inline picture, drawing object, footnote.
oldValue - A string to be replaced.newValue - A string to replace all occurrences of oldValue.isMatchCase - True indicates case-sensitive comparison, false indicates case-insensitive comparision.isMatchWholeWord - True indicates the oldValue must be a standalone word.replace | |
public int replace(java.util.regex.Pattern pattern, java.lang.String replacement)
throws java.lang.Exception | |
Replaces the whole match captured by the regular expression.
An exception is thrown if a captured or replacement string contain one or more special characters: paragraph break, cell break, section break, field start, field separator, field end, inline picture, drawing object, footnote.
pattern - A regular expression pattern used to find matches.replacement - A string to replace all occurrences of oldValue.replace | |
public int replace(java.util.regex.Pattern pattern, ReplaceEvaluator evaluator, boolean isForward) throws java.lang.Exception | |
An exception is thrown if a captured or replacement string contain one or more special characters: paragraph break, cell break, section break, field start, field separator, field end, inline picture, drawing object, footnote.
pattern - A regular expression pattern used to find matches.evaluator - The user-defined method which evaluates replacement at each step.isForward - True to replace from the beginning of the range to the end.updateFields | |
public void updateFields()
throws java.lang.Exception | |
At the moment updates the results of DOCPROPERTY and DOCVARIABLE fields only.
|
ASPOSE home | ||||||||