|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.shady.ArgString
public class ArgString
Store the string value as an argument. We want to allow escaping (e.g. \n, \t ..) and we are using syntax defined by the (java lexical structure).
The constructor won't automatically unescape the passed value. UseArgString#parseStringLiteral(java.lang.StringBuilder)
.
| Constructor Summary | |
|---|---|
ArgString(String string)
Take the string and use it as the value of the argument. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
T |
getValue()
|
protected static Character |
parseStringCharacter(StringBuilder sb)
Extract the StringCharacter from the sb and return it. |
protected static String |
parseStringLiteral(String escaped)
Take the escaped string, parse it and return the unescaped value. |
static String |
unescape(String escapedString)
Get unescaped version of passed string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArgString(String string)
unescape(java.lang.String) is
recommended (it parses escaped string into an unescaped form).
string - value of the argument| Method Detail |
|---|
public static String unescape(String escapedString)
throws ParseException
escapedString - string escaped according to java lexical structure,
without double quotes (e.g. Hello\nWorld)
ParseException - if there is an error in the escaping
protected static String parseStringLiteral(String escaped)
throws ParseException
string - string to parse, incl. quotes (e.g. "Foo\nBar")
StringLiteral: " [StringCharacters] "
ParseException
protected static Character parseStringCharacter(StringBuilder sb)
throws ParseException
\(u)+ [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] ~ Unicode char \[btnfr"'\] \[0-3][0-7][0-7] \[0-7][0-7] \[0-7]
sb - sequence of chars that is used to extract the character. Is
modified (characters are removed) during parsing.
ParseExceptionpublic T getValue()
getValue in interface IArgument<T>public boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||