|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.umber.core.text.splitters.BraceMatchSplitter
Text splitter which divides a text document according to matching pairs of open/close brace tokens. The splitter manages nested braces to ensure it finds the proper closing brace. For example, given the text document "one (two (three) four) five)", and braces of "(" and ")", the brace matcher would split the text into the fragments "one ", "(two (three) four)", and " five)". It would not match the nested closing brace after "three", nor the unpaired brace after "five".
Constructor Summary | |
BraceMatchSplitter()
Creates a new instance of BraceMatchSplitter. |
|
BraceMatchSplitter(java.lang.String openBrace,
java.lang.String closeBrace)
Creates a new instance of BraceMatchSplitter with custom braces. |
Method Summary | |
java.lang.String[] |
splitText(java.lang.String text)
Extracts fragments of text from the input text document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BraceMatchSplitter()
public BraceMatchSplitter(java.lang.String openBrace, java.lang.String closeBrace)
openBrace
- the starting brace tokencloseBrace
- the ending brace tokenMethod Detail |
public java.lang.String[] splitText(java.lang.String text)
This implementation extracts one fragment of text for each parenthetical regular expression group. If the expression has no groups, this method will return an empty array.
splitText
in interface ITextSplitter
text
- input text document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |