public final class ImageMatcher
extends java.lang.Object
ImageMatcher
- Looks up occurrences of
Modifier and Type | Method and Description |
---|---|
java.util.regex.Matcher |
appendLiteralReplacement(java.lang.StringBuffer sb,
java.lang.String replacement)
Implements a non-terminal append-and-replace step.
|
java.util.regex.Matcher |
appendReplacement(java.lang.StringBuffer sb,
java.lang.String replacement)
Implements a non-terminal append-and-replace step.
|
java.lang.StringBuffer |
appendTail(java.lang.StringBuffer sb)
Implements a non-terminal append-and-replace step.
|
int |
end()
Gets the end index of the previous match.
|
boolean |
find()
Attempts to find the next subsequence of the input sequence that matches the pattern.
|
java.lang.String |
getImageId()
Gets the image identifier
|
java.lang.String |
getManagedFileId()
Gets the managed file identifier.
|
java.lang.String |
group()
Returns the matching image tag.
|
java.lang.String |
group(int group)
Returns the input subsequence captured by the given group during the previous match operation.
|
int |
groupCount()
Returns the number of capturing groups in this matcher's pattern.
|
static ImageMatcher |
matcher(java.lang.CharSequence content)
Creates a new image matcher from given content.
|
boolean |
matches()
Attempts to match the entire region against the pattern.
|
static void |
setPrefixService(com.openexchange.dispatcher.DispatcherPrefixService prefixService) |
int |
start()
Gets the start index of the previous match.
|
public static ImageMatcher matcher(java.lang.CharSequence content)
content
- The contentpublic static void setPrefixService(com.openexchange.dispatcher.DispatcherPrefixService prefixService)
prefixService
- public java.lang.String group()
java.lang.IllegalStateException
- If no match has yet been attempted, or if the previous match operation failedpublic java.lang.String group(int group)
group
- The index of a capturing group in this matcher's patternjava.lang.IllegalStateException
- If no match has yet been attempted, or if the previous match operation failedjava.lang.IndexOutOfBoundsException
- If there is no capturing group in the pattern with the given indexpublic int groupCount()
Group zero denotes the entire pattern by convention. It is not included in this count.
Any non-negative integer smaller than or equal to the value returned by this method is guaranteed to be a valid group index for this matcher.
public boolean matches()
If the match succeeds then more information can be obtained via the start, end, and group methods.
public boolean find()
This method starts at the beginning of this matcher's region, or, if a previous invocation of the method was successful and the matcher has not since been reset, at the first character not matched by the previous match.
If the match succeeds then more information can be obtained via the start, end, and group methods.
public java.lang.String getManagedFileId()
public java.lang.String getImageId()
public int start()
public int end()
public java.util.regex.Matcher appendReplacement(java.lang.StringBuffer sb, java.lang.String replacement)
public java.util.regex.Matcher appendLiteralReplacement(java.lang.StringBuffer sb, java.lang.String replacement)
public java.lang.StringBuffer appendTail(java.lang.StringBuffer sb)