|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.scanner.base.AbstractCharScannerSyntax
public abstract class AbstractCharScannerSyntax
This is the abstract base implementation of the CharScannerSyntax
interface.
The actual chars like escape are realized
as simple bean-properties and initialized with '\0' so they are
disabled by default.
CharStreamScanner.readUntil(char, boolean,
CharScannerSyntax)| Field Summary | |
|---|---|
private char |
altQuoteEnd
|
private char |
altQuoteEscape
|
private boolean |
altQuoteEscapeLazy
|
private char |
altQuoteStart
|
private char |
entityEnd
|
private char |
entityStart
|
private char |
escape
|
private char |
quoteEnd
|
private char |
quoteEscape
|
private boolean |
quoteEscapeLazy
|
private char |
quoteStart
|
| Constructor Summary | |
|---|---|
AbstractCharScannerSyntax()
The constructor. |
|
| Method Summary | |
|---|---|
char |
getAltQuoteEnd()
This method gets the alternative character used to end a quotation. |
char |
getAltQuoteEscape()
This method gets the character used to escape the alt-quote-end character within an quotation opened by
alt-quote-start. |
char |
getAltQuoteStart()
This method gets the alternative character used to start a quotation that should be terminated by a alt-quote-end
character. |
char |
getEntityEnd()
This method gets the character used to end an entity. |
char |
getEntityStart()
This method gets the character used to start an entity. |
char |
getEscape()
This method gets the character used as escape. |
char |
getQuoteEnd()
This method gets the character used to end a quotation. |
char |
getQuoteEscape()
This method gets the character used to escape the quote-end character within a quotation. |
char |
getQuoteStart()
This method gets the character used to start a quotation that should be terminated by a quote-end character. |
boolean |
isAltQuoteEscapeLazy()
If alt-quote-start, alt-quote-end and alt-quote-escape all point
to the same character (which is NOT '\0'), then this method
determines if alt-quotation escaping is
lazy. |
boolean |
isQuoteEscapeLazy()
If quote-start, quote-end
and quote-escape all point to the same character
(which is NOT '\0'), then this method determines if
quotation escaping is lazy. |
String |
resolveEntity(String entity)
This method resolves the given entity. |
void |
setAltQuote(char altQuote)
This method sets both the alt-quote-start and
alt-quote-end character. |
void |
setAltQuoteEnd(char alternativeQuoteEnd)
This method sets the alt-quote-end character. |
void |
setAltQuoteEscape(char altQuoteEscape)
|
void |
setAltQuoteEscapeLazy(boolean altQuoteEscapeLazy)
|
void |
setAltQuoteStart(char alternativeQuoteStart)
|
void |
setEntityEnd(char entityEnd)
|
void |
setEntityStart(char entityStart)
|
void |
setEscape(char escape)
|
void |
setQuote(char quote)
This method sets both the quote-start and
quote-end character. |
void |
setQuoteEnd(char quoteEnd)
|
void |
setQuoteEscape(char quoteEscape)
|
void |
setQuoteEscapeLazy(boolean quoteEscapeLazy)
|
void |
setQuoteStart(char quoteStart)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private char escape
getEscape()private char quoteStart
getQuoteStart()private char quoteEnd
getQuoteEnd()private char quoteEscape
getQuoteEscape()private boolean quoteEscapeLazy
isQuoteEscapeLazy()private char altQuoteStart
getAltQuoteStart()private char altQuoteEnd
getAltQuoteEnd()private char altQuoteEscape
getAltQuoteEscape()private boolean altQuoteEscapeLazy
isAltQuoteEscapeLazy()private char entityStart
getEntityStart()private char entityEnd
getEntityEnd()| Constructor Detail |
|---|
public AbstractCharScannerSyntax()
| Method Detail |
|---|
public char getEscape()
stop-character, quote-start,
alt-quote-start, as well as the
escape itself.\).escape |
input | output |
|---|---|---|
| \ | a\b\\c | ab\c |
| ~ | a~b~~~c | ab~c |
escape is disabled within quotations.
getEscape in interface CharScannerSyntax0 ('\0') for no
escaping.CharScannerSyntax.getEntityStart()public void setEscape(char escape)
escape - is the escape character to set.public char getQuoteStart()
quote-end character. The text inside
the quote is taken as is (without the quote characters).') and
double quotes (").
getQuoteStart in interface CharScannerSyntax0 (
'\0') to disable.public void setQuoteStart(char quoteStart)
quoteStart - is the quote-start character to
set.public char getQuoteEnd()
getQuoteEnd in interface CharScannerSyntaxCharScannerSyntax.getQuoteStart()public void setQuoteEnd(char quoteEnd)
quoteEnd - is the quote-end character to set.public void setQuote(char quote)
quote-start and
quote-end character.
quote - the quote character to set.public char getQuoteEscape()
quote-end character within a quotation. This may be the
quote-end itself so a duplicate
quote-end represents a single occurrence of that
character within a quotation. Otherwise the escape may be any other
character.quote-start and only escapes the
quote-end character and nothing else so in any other
case the quote-escape is treated as a regular
character.quote-start |
quote-end |
quote-escape |
input | output |
|---|---|---|---|---|
| ' | ' | ' | a'bc'd | abcd |
| ' | ' | ' | a'b''c'd | ab'cd |
| ' | ' | \ | a'b\c\'d\\'e'f | ab\c'd\'ef |
getQuoteEscape in interface CharScannerSyntaxquote-end
character or 0 ('\0') to disable.public void setQuoteEscape(char quoteEscape)
quoteEscape - is the quote-escape to set.public boolean isQuoteEscapeLazy()
quote-start, quote-end
and quote-escape all point to the same character
(which is NOT '\0'), then this method determines if
quotation escaping is lazy. This means
that outside a quotation a double occurrence of the quote character is NOT
treated as quotation but as escaped quote character. Otherwise if NOT lazy,
the double quote character is treated as quotation representing the empty
sequence.
quote-start
quote-end
quote-escape
quote-escape-lazy
input
output
'
'
'
true
''
'
'
'
'
false
''
'
'
'
true
''''
''
'
'
'
false
''''
'
'
'
'
true
'''a'
'a
'
'
'
false
'''a'
'a
'''a' the complete sequence is treated as quote if
quote-escape-lazy is false and
otherwise just the trailing 'a'.
isQuoteEscapeLazy in interface CharScannerSyntaxtrue if quote-escaping is lazy, false
otherwise.public void setQuoteEscapeLazy(boolean quoteEscapeLazy)
quoteEscapeLazy - the quote-escape-lazy
flag to setpublic char getAltQuoteStart()
alt-quote-end
character. The text inside the quote is taken as is (without the quote
characters).
getAltQuoteStart in interface CharScannerSyntax0 ('\0') for no quotation.getQuoteStart()public void setAltQuoteStart(char alternativeQuoteStart)
alternativeQuoteStart - is the alt-quote-start character to set.public char getAltQuoteEnd()
getAltQuoteEnd in interface CharScannerSyntaxgetAltQuoteStart()public void setAltQuoteEnd(char alternativeQuoteEnd)
alt-quote-end character.
alternativeQuoteEnd - is the alt-quote-end
character.public void setAltQuote(char altQuote)
alt-quote-start and
alt-quote-end character.
altQuote - the alt-quote character to set.public char getAltQuoteEscape()
alt-quote-end character within an quotation opened by
alt-quote-start.
getAltQuoteEscape in interface CharScannerSyntaxquote-end
character or 0 ('\0') to disable.CharScannerSyntax.getQuoteEscape()public void setAltQuoteEscape(char altQuoteEscape)
altQuoteEscape - is the alt-quote-escape
to set.public boolean isAltQuoteEscapeLazy()
alt-quote-start, alt-quote-end and alt-quote-escape all point
to the same character (which is NOT '\0'), then this method
determines if alt-quotation escaping is
lazy.
isAltQuoteEscapeLazy in interface CharScannerSyntaxtrue if alt-quote-escaping is lazy, false
otherwise.CharScannerSyntax.isQuoteEscapeLazy()public void setAltQuoteEscapeLazy(boolean altQuoteEscapeLazy)
altQuoteEscapeLazy - the alt-quote-lazy flag to setpublic char getEntityStart()
entity-start and entity-end. It will be decoded by
CharScannerSyntax.resolveEntity(String).
getEntityStart in interface CharScannerSyntax0 (
'\0') to disable.public void setEntityStart(char entityStart)
entityStart - the entity-start to set.public char getEntityEnd()
getEntityEnd in interface CharScannerSyntaxCharScannerSyntax.getEntityStart()public void setEntityEnd(char entityEnd)
entityEnd - the entity-end to set.public String resolveEntity(String entity)
entity.entity-start is '&' and
CharScannerSyntax.getEntityEnd() is ';' then if the string "<" is
scanned, this method is called with "lt" as
entity argument and may return "<".
ATTENTION:use entities.
resolveEntity in interface CharScannerSyntaxentity - is the entity string that was found surrounded by
entity-start and
entity-end excluding these characters.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||