public class InlineCodeFinder extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
TAGTYPE
Type representing an inline code created with this class.
|
| Constructor and Description |
|---|
InlineCodeFinder()
Creates a new InlineCodeFinder object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRule(String pattern)
Adds a new rule to the list.
|
void |
addRules(Collection<String> rules)
Adds a collection of rules to the list.
|
InlineCodeFinder |
clone()
Clones this finder.
|
void |
compile()
Compiles all the rules into a single compiled pattern.
|
void |
fromString(String data)
Sets the options of this finder with the values stored in a given string.
|
ArrayList<String> |
getRules()
Gets a list of all rules.
|
String |
getSample()
Gets the sample text to go with the finder.
|
void |
process(TextFragment fragment)
Applies the rules to a given content and converts all matching sections
into in-line codes.
|
void |
reset()
Resets this finder.
|
void |
setSample(String value)
Sets the sample text that can be used to check the rules
in a regular expression editor.
|
void |
setUseAllRulesWhenTesting(boolean value)
Set the flag that indicates if all rules should be used when testing the patterns
in a regular expression editor.
|
String |
toString()
Gets a string of all the options for this finder.
|
boolean |
useAllRulesWhenTesting()
Indicates if all rules should be used when testing the patterns
in a regular expression editor.
|
public static final String TAGTYPE
public InlineCodeFinder()
public void reset()
public InlineCodeFinder clone()
public void addRule(String pattern)
pattern - The regular expression pattern for the rule.public void addRules(Collection<String> rules)
rules - The collection of rules to addpublic ArrayList<String> getRules()
public String getSample()
public void setSample(String value)
value - The sample text.public boolean useAllRulesWhenTesting()
public void setUseAllRulesWhenTesting(boolean value)
value - True to use all rules, false to use only the current rule.public void compile()
PatternSyntaxException - When there is a syntax error in one of the rules.public void process(TextFragment fragment)
TAGTYPE.
IMPORTANT: Note that the data of the original data in the new inline code may need to be escaped as they are now part of the fragment 'skeleton' and are not escaped back to the original format when merging.
fragment - The fragment where to apply the rules.public String toString()
toString in class ObjectfromString(String)public void fromString(String data)
toString().data - String storing all the options for this finder.toString()Copyright © 2022. All rights reserved.