Package hudson
Class AbstractMarkupText
java.lang.Object
hudson.AbstractMarkupText
- Direct Known Subclasses:
- MarkupText,- MarkupText.SubText
Common part between 
MarkupText and MarkupText.SubText.
 
 See MarkupText for more discussion about what this class represents.
- Since:
- 1.250
- Author:
- Kohsuke Kawaguchi
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddHyperlink(int startPos, int endPos, String url) Inserts an A tag that surrounds the given position.voidaddHyperlinkLowKey(int startPos, int endPos, String url) Inserts an A tag that surrounds the given position.abstract voidAdds a start tag and end tag at the specified position.charcharAt(int idx) protected abstract MarkupText.SubTextFind the first occurrence of the given pattern in this text, or null.findTokens(Pattern pattern) Find all "tokens" that match the given pattern in this text.abstract StringgetText()Returns the plain text portion of thisMarkupTextwithout any markup, nor any escape.voidhide(int startPos, int endPos) Hides the given text.final intlength()Length of the plain text.abstract MarkupText.SubTextsubText(int start, int end) Returns a subtext.final voidAdds a start tag and end tag around the entire text
- 
Method Details- 
getTextReturns the plain text portion of thisMarkupTextwithout any markup, nor any escape.
- 
charAtpublic char charAt(int idx) 
- 
lengthpublic final int length()Length of the plain text.
- 
subTextReturns a subtext.- Parameters:
- end- If negative, -N means "trim the last N-1 chars". That is, (s,-1) is the same as (s,length)
 
- 
addMarkupAdds a start tag and end tag at the specified position.For example, if the text was "abc", then addMarkup(1,2,"<b>","</b>")would generate"a<b>b</b>c"
- 
addHyperlinkInserts an A tag that surrounds the given position.- Since:
- 1.349
 
- 
addHyperlinkLowKeyInserts an A tag that surrounds the given position. But this hyperlink is less visible.- Since:
- 1.395
 
- 
hidepublic void hide(int startPos, int endPos) Hides the given text.
- 
wrapByAdds a start tag and end tag around the entire text
- 
findTokenFind the first occurrence of the given pattern in this text, or null.- Since:
- 1.349
 
- 
findTokensFind all "tokens" that match the given pattern in this text.A token is like a substring, except that it's aware of word boundaries. For example, while "bc" is a string of "abc", calling findTokenswith "bc" as a pattern on string "abc" won't match anything.This method is convenient for finding keywords that follow a certain syntax from natural text. You can then use MarkupText.SubText.surroundWith(String,String)to put mark up around such text.
- 
createSubText
 
-