|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.petebevin.markdown.TextEditor
public class TextEditor
Mutable String with common operations used in Markdown processing.
Constructor Summary | |
---|---|
TextEditor(CharSequence text)
Create a new TextEditor based on the contents of a String or StringBuffer. |
Method Summary | |
---|---|
void |
append(CharSequence s)
Add a string to the end of the buffer. |
TextEditor |
deleteAll(String pattern)
Remove all occurrences of the given regex pattern, replacing them with the empty string. |
TextEditor |
detabify()
Convert tabs to spaces given the default tab width of 4 spaces. |
TextEditor |
detabify(int tabWidth)
Convert tabs to spaces. |
TextEditor |
indent(int spaces)
Introduce a number of spaces at the start of each line. |
boolean |
isEmpty()
Find out whether the buffer is empty. |
TextEditor |
outdent()
Remove one tab width (4 spaces) from the start of each line. |
TextEditor |
outdent(int spaces)
Remove a number of spaces at the start of each line. |
void |
prepend(CharSequence s)
Add a string to the start of the first line of the buffer. |
TextEditor |
replaceAll(Pattern pattern,
Replacement replacement)
Replace all occurrences of the Pattern. |
TextEditor |
replaceAll(String regex,
String replacement)
Replace all occurrences of the regular expression with the replacement. |
TextEditor |
replaceAllLiteral(String regex,
String replacement)
Same as replaceAll(String, String), but does not interpret $1, $2 etc. |
Collection<HTMLToken> |
tokenizeHTML()
Parse HTML tags, returning a Collection of HTMLToken objects. |
String |
toString()
Give up the contents of the TextEditor. |
TextEditor |
trim()
Remove leading and trailing space from the start and end of the buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextEditor(CharSequence text)
text
- Method Detail |
---|
public String toString()
toString
in class Object
public TextEditor replaceAll(String regex, String replacement)
regex
- replacement
-
public TextEditor replaceAllLiteral(String regex, String replacement)
regex
- replacement
-
public TextEditor replaceAll(Pattern pattern, Replacement replacement)
pattern
- replacement
-
public TextEditor deleteAll(String pattern)
pattern
- Regular expression
Pattern
public TextEditor detabify()
public TextEditor detabify(int tabWidth)
tabWidth
- Number of spaces per tab.
public TextEditor outdent(int spaces)
spaces
-
public TextEditor outdent()
public TextEditor trim()
public TextEditor indent(int spaces)
spaces
-
public void append(CharSequence s)
s
- public Collection<HTMLToken> tokenizeHTML()
public void prepend(CharSequence s)
s
- public boolean isEmpty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |