public class DelimitSubstitutionFormat extends ReportFormat
base
,
but surround the result with markSubstitutionStart
and markSubstitutionStart
. However, it the value is
and UnescapedData
write it out as-is, with no marks.
If the value is a List
(and not a CharSequence
),
write each element of the list as above, and surround the entire
list with markGroupStart
and markGroupEnd
.
This is currently used for enclosed expressions in shell/process
quasi-literals, to enable proper quotation/escaping. It could be used
for other "mini-languages", such as sql statements.Modifier and Type | Field and Description |
---|---|
static char |
MARK_GROUP_END |
static char |
MARK_GROUP_START |
static char |
MARK_SUBSTITUTION_END |
static char |
MARK_SUBSTITUTION_START |
char |
markGroupEnd |
char |
markGroupStart |
char |
markSubstitutionEnd |
char |
markSubstitutionStart |
PARAM_FROM_COUNT, PARAM_FROM_LIST, PARAM_UNSPECIFIED
Constructor and Description |
---|
DelimitSubstitutionFormat(ReportFormat base) |
Modifier and Type | Method and Description |
---|---|
int |
format(java.lang.Object[] args,
int start,
java.lang.Appendable dst,
java.text.FieldPosition fpos)
Format an array of arguments, and write out the result.
|
static DelimitSubstitutionFormat |
getInstance(ReportFormat base) |
format, format, format, format, format, getParam, getParam, getParam, nextArg, parseObject, print, print, result, resultCode
public static final char MARK_GROUP_START
public static final char MARK_GROUP_END
public static final char MARK_SUBSTITUTION_START
public static final char MARK_SUBSTITUTION_END
public char markGroupStart
public char markGroupEnd
public char markSubstitutionStart
public char markSubstitutionEnd
public DelimitSubstitutionFormat(ReportFormat base)
public static DelimitSubstitutionFormat getInstance(ReportFormat base)
public int format(java.lang.Object[] args, int start, java.lang.Appendable dst, java.text.FieldPosition fpos) throws java.io.IOException
ReportFormat
format
in class ReportFormat
args
- the objects to be formattedstart
- the index (in args) of the argument to start withdst
- where to write the resultjava.io.IOException