Stay organized with collections
Save and categorize content based on your preferences.
MatchFilter
interface MatchFilter
MatchFilter enables client code to have more control over what is allowed to match and become a link, and what is not. For example: when matching web URLs you would like things like http://www.example.com to match, as well as just example.com itelf. However, you would not want to match against the domain in support@example.com. So, when matching against a web URL pattern you might also include a MatchFilter that disallows the match if it is immediately preceded by an at-sign (@).
Summary
Public methods |
abstract Boolean |
Examines the character span matched by the pattern and determines if the match should be turned into an actionable link.
|
Public methods
acceptMatch
abstract fun acceptMatch(
s: CharSequence!,
start: Int,
end: Int
): Boolean
Examines the character span matched by the pattern and determines if the match should be turned into an actionable link.
Parameters |
s |
CharSequence!: The body of text against which the pattern was matched |
start |
Int: The index of the first character in s that was matched by the pattern - inclusive |
end |
Int: The index of the last character in s that was matched - exclusive |
Return |
Boolean |
Whether this match should be turned into a link |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-04 UTC."],[],[]]