public class CommentFormats extends Object
Modifier and Type | Field and Description |
---|---|
static int |
escape_blanks_individually |
static int |
escape_frame_with_doublequotes |
static String |
format_dateAndTime
String formatting template for date and time.
|
static int |
no_escape |
static Pattern |
pattern_newlineAndTabs |
Constructor and Description |
---|
CommentFormats() |
Modifier and Type | Method and Description |
---|---|
static String |
anonymiseLocalFile(String path)
Heuristics which removes "/home/max/metatools/" by "$(HOME)/metatools".
FIXME only implemented for UNIX. |
static Format |
apiDoc(List<Format> formats) |
static String |
date_standardFormat(GregorianCalendar now)
Returns the given date in the format defined by
format_dateAndTime . |
static String |
dateNow_standardFormat()
Returns the current state of the calendaric clock in the format defined
by
format_dateAndTime . |
static Format |
generationComment(String name_program,
@Opt String name_version,
int escapemode,
boolean html_breaks,
String[] args)
Generates a Format which can be used to document the
command line call.
|
static Format |
generationComment(String name_program,
@Opt String name_version,
String dateAndTime,
int escapemode,
boolean html_breaks,
String[] args)
Generates a Format which can be used to document the
command line call, which initiated the generation of a certain
java source file.
|
static String |
generationText(String prefix,
String[] args,
int blankEscapeMode,
String argSeparator,
String lineSeparator,
int maxWidth)
Generate a primitive string which explains the parameters of a tool application.
|
static Format |
multiLine(Format format) |
static String |
replaceNewlinesAndTabs(String s) |
static Format |
singleLine(Format format) |
static String |
stringescape(String data,
int mode)
Escapes blank characters in the given datum according to the
methods selected by
no_escape , no change,
escape_blanks_individually , escape each blank with an own
backslash,
or escape_frame_with_doublequotes , frame whole string with
double quotes and escape all internal double quotes with a backslash. |
public static final int no_escape
public static final int escape_frame_with_doublequotes
public static final int escape_blanks_individually
public static final Pattern pattern_newlineAndTabs
public static final String format_dateAndTime
java.lang.String.format(String,Object...)
with
some GregorianCalendar
as second argument.
Date and Time format is set to the same format as the shell function
"makedate" in "etc/calltools.mk", (beside that the latter does
currently not include seconds.)
2009-07-21_01h09m07s
%tF %tHh%tMm%tS
"
%tF %tT
"
%tFT%tT
"
public static String stringescape(String data, int mode)
no_escape
, no change,
escape_blanks_individually
, escape each blank with an own
backslash,
escape_frame_with_doublequotes
, frame whole string with
double quotes and escape all internal double quotes with a backslash.
public static String dateNow_standardFormat()
format_dateAndTime
.public static String date_standardFormat(GregorianCalendar now)
format_dateAndTime
.public static String anonymiseLocalFile(String path)
public static String generationText(String prefix, String[] args, int blankEscapeMode, String argSeparator, String lineSeparator, int maxWidth)
public static Format generationComment(String name_program, @Opt @Opt String name_version, String dateAndTime, int escapemode, boolean html_breaks, String[] args)
GeneratedAnnotationTarget.addComment(Format)
or
GeneratedAnnotationTarget.addComment(Format)
Format
.
Created onAll strings args are considered as potential file paths and HEURISTICALLY anonymized: "$(HOME)" is inserted for anything which looks like a home directory.by (version )? command line:
name_program
- must be given,name_version
- may be ==null
, omitting the "version ..." textdateAndTime
- must be given,escapemode
- how arg-strings which contain whitespace shall be encodedhtml_breaks
- whether to insert html break commands.args
- the arguments which reached static void main()
public static Format generationComment(String name_program, @Opt @Opt String name_version, int escapemode, boolean html_breaks, String[] args)
generationComment(String,String,String,int,boolean,String[])
,
but uses dateNow_standardFormat()
for date and time.name_program
- must be given,name_version
- may be ==null
, omitting the "version ..." textescapemode
- how arg-strings which contain whitespace shall be encodedhtml_breaks
- whether to insert html break commands.args
- the arguments which reached static void main()
see also the complete user documentation .