Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–722 unchanged (722 lines)
723 * @param nextLineTabStop The position on the next line for the first tab.
724 * @param text The text to be written to the PrintWriter
725 */
726 public void printWrapped(PrintWriter pw, int width, int nextLineTabStop, String text)
727 {
728 StringBuffer sb = new StringBuffer(text.length());
729
730 renderWrappedText(sb, width, nextLineTabStop, text);
731 pw.println(sb.toString());
732 }
733
734 // --------------------------------------------------------------- Protected
735
736 /**
…lines 737–893 unchanged (157 lines)
894 *
895 * @param sb The StringBuffer to place the rendered text into.
896 * @param width The number of characters to display per line
897 * @param nextLineTabStop The position on the next line for the first tab.
898 * @param text The text to be rendered.
899 */
900 // cannot happen
901
902
903 /**
904 * Finds the next text wrap position after <code>startPos</code> for the
905 * text in <code>text</code> with the column width <code>width</code>.
906 * The wrap point is the last position before startPos+width having a
907 * whitespace character (space, \n, \r). If there is no whitespace character
…lines 908–1026 unchanged (119 lines)

After

…lines 1–722 unchanged (722 lines)
723 * @param nextLineTabStop The position on the next line for the first tab.
724 * @param text The text to be written to the PrintWriter
725 */
726 public void printWrapped(PrintWriter pw, int width, int nextLineTabStop, String text)
727 {
728 StringBuffer sb = new StringBuffer(text.length());
729
730 renderWrappedTextBlock(sb, width, nextLineTabStop, text);
731 pw.println(sb.toString());
732 }
733
734 // --------------------------------------------------------------- Protected
735
736 /**
…lines 737–893 unchanged (157 lines)
894 *
895 * @param sb The StringBuffer to place the rendered text into.
896 * @param width The number of characters to display per line
897 * @param nextLineTabStop The position on the next line for the first tab.
898 * @param text The text to be rendered.
899 */
900 private StringBuffer renderWrappedTextBlock(StringBuffer sb, int width, int nextLineTabStop, String text) {
901 try {
902 BufferedReader in = new BufferedReader(new StringReader(text));
903 String line;
904 boolean firstLine = true;
905 while ((line = in.readLine()) != null) {
906 if (!firstLine) {
907 sb.append(getNewLine());
908 } else {
909 firstLine = false;
910 }
911 renderWrappedText(sb, width, nextLineTabStop, line);
912 }
913 } catch (IOException e) {
914 // cannot happen
915 }
916
917 return sb;
918 }
919
920 /**
921 * Finds the next text wrap position after <code>startPos</code> for the
922 * text in <code>text</code> with the column width <code>width</code>.
923 * The wrap point is the last position before startPos+width having a
924 * whitespace character (space, \n, \r). If there is no whitespace character
…lines 925–1043 unchanged (119 lines)

Before

program
block_comment "/**\n * Licensed to the Apache Software Foundation (ASF) unde"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "BufferedReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "PrintWriter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "StringReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Comparator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/** \n * A formatter of help messages for the current command"...
class_declaration
modifiers
public "public"
class "class"
identifier "HelpFormatter"
class_body
{ "{"
line_comment "// ---------------------------------------------------------"...
block_comment "/** default number of characters per line */"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_WIDTH"
= "="
decimal_integer_literal "74"
; ";"
block_comment "/** default padding to the left of each line */"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_LEFT_PAD"
= "="
decimal_integer_literal "1"
; ";"
block_comment "/**\n * the number of characters of padding to be prefixe"...
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_DESC_PAD"
= "="
decimal_integer_literal "3"
; ";"
block_comment "/** the string to display at the beginning of the usage stat"...
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_SYNTAX_PREFIX"
= "="
string_literal
" "\""
string_fragment "usage: "
" "\""
; ";"
block_comment "/** default prefix for shortOpts */"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_OPT_PREFIX"
= "="
string_literal
" "\""
string_fragment "-"
" "\""
; ";"
block_comment "/** default prefix for long Option */"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_LONG_OPT_PREFIX"
= "="
string_literal
" "\""
string_fragment "--"
" "\""
; ";"
block_comment "/** default separator displayed between a long Option and it"...
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_LONG_OPT_SEPARATOR"
= "="
string_literal
" "\""
string_fragment " "
" "\""
; ";"
block_comment "/** default name for an argument */"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_ARG_NAME"
= "="
string_literal
" "\""
string_fragment "arg"
" "\""
; ";"
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * number of characters per line\n *\n * @depr"...
field_declaration
modifiers
public "public"
integral_type
int "int"
variable_declarator
identifier "defaultWidth"
= "="
identifier "DEFAULT_WIDTH"
; ";"
block_comment "/**\n * amount of padding to the left of each line\n *"...
field_declaration
modifiers
public "public"
integral_type
int "int"
variable_declarator
identifier "defaultLeftPad"
= "="
identifier "DEFAULT_LEFT_PAD"
; ";"
block_comment "/**\n * the number of characters of padding to be prefixe"...
field_declaration
modifiers
public "public"
integral_type
int "int"
variable_declarator
identifier "defaultDescPad"
= "="
identifier "DEFAULT_DESC_PAD"
; ";"
block_comment "/**\n * the string to display at the begining of the usag"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultSyntaxPrefix"
= "="
identifier "DEFAULT_SYNTAX_PREFIX"
; ";"
block_comment "/**\n * the new line string\n *\n * @deprecated Sco"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultNewLine"
= "="
method_invocation
identifier "System"
. "."
identifier "getProperty"
argument_list
( "("
string_literal
" "\""
string_fragment "line.separator"
" "\""
) ")"
; ";"
block_comment "/**\n * the shortOpt prefix\n *\n * @deprecated Sco"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultOptPrefix"
= "="
identifier "DEFAULT_OPT_PREFIX"
; ";"
block_comment "/**\n * the long Opt prefix\n *\n * @deprecated Sco"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultLongOptPrefix"
= "="
identifier "DEFAULT_LONG_OPT_PREFIX"
; ";"
block_comment "/** The separator displayed between the long option and its "...
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "longOptSeparator"
= "="
identifier "DEFAULT_LONG_OPT_SEPARATOR"
; ";"
block_comment "/**\n * the name of the argument\n *\n * @deprecate"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultArgName"
= "="
identifier "DEFAULT_ARG_NAME"
; ";"
block_comment "/**\n * Comparator used to sort the options when they out"...
field_declaration
modifiers
protected "protected"
type_identifier "Comparator"
variable_declarator
identifier "optionComparator"
= "="
object_creation_expression
new "new"
type_identifier "OptionComparator"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Sets the 'width'.\n *\n * @param width the "...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the 'width'.\n *\n * @return the 'w"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getWidth"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultWidth"
; ";"
} "}"
block_comment "/**\n * Sets the 'leftPadding'.\n *\n * @param padd"...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the 'leftPadding'.\n *\n * @return "...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getLeftPadding"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultLeftPad"
; ";"
} "}"
block_comment "/**\n * Sets the 'descPadding'.\n *\n * @param padd"...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the 'descPadding'.\n *\n * @return "...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getDescPadding"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultDescPad"
; ";"
} "}"
block_comment "/**\n * Sets the 'syntaxPrefix'.\n *\n * @param pre"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'syntaxPrefix'.\n *\n * @return"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getSyntaxPrefix"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultSyntaxPrefix"
; ";"
} "}"
block_comment "/**\n * Sets the 'newLine'.\n *\n * @param newline "...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'newLine'.\n *\n * @return the "...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getNewLine"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultNewLine"
; ";"
} "}"
block_comment "/**\n * Sets the 'optPrefix'.\n *\n * @param prefix"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'optPrefix'.\n *\n * @return th"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getOptPrefix"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultOptPrefix"
; ";"
} "}"
block_comment "/**\n * Sets the 'longOptPrefix'.\n *\n * @param pr"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'longOptPrefix'.\n *\n * @retur"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getLongOptPrefix"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultLongOptPrefix"
; ";"
} "}"
block_comment "/**\n * Set the separator displayed between a long option"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the separator displayed between a long op"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getLongOptSeparator"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "longOptSeparator"
; ";"
} "}"
block_comment "/**\n * Sets the 'argName'.\n *\n * @param name the"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'argName'.\n *\n * @return the "...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getArgName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultArgName"
; ";"
} "}"
block_comment "/**\n * Comparator used to sort the options when they out"...
method_declaration
modifiers
public "public"
type_identifier "Comparator"
identifier "getOptionComparator"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "optionComparator"
; ";"
} "}"
block_comment "/**\n * Set the comparator used to sort the options when "...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+243 nodes collapsed)
block_comment "/**\n * Prints the usage statement for the specified appl"...
method_declaration (+319 nodes collapsed)
block_comment "/**\n * Appends the usage clause for an OptionGroup to a "...
method_declaration (+197 nodes collapsed)
block_comment "/**\n * Appends the usage clause for an Option to a Strin"...
method_declaration (+281 nodes collapsed)
block_comment "/**\n * Print the cmdLineSyntax to the specified writer, "...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * Print the help for the specified Options to the s"...
method_declaration (+77 nodes collapsed)
block_comment "/**\n * Print the specified text to the specified PrintWr"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Print the specified text to the specified PrintWr"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "printWrapped"
formal_parameters
( "("
formal_parameter
type_identifier "PrintWriter"
identifier "pw"
, ","
formal_parameter
integral_type
int "int"
identifier "width"
, ","
formal_parameter
integral_type
int "int"
identifier "nextLineTabStop"
, ","
formal_parameter
type_identifier "String"
identifier "text"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "StringBuffer"
variable_declarator
identifier "sb"
= "="
object_creation_expression
new "new"
type_identifier "StringBuffer"
argument_list
( "("
method_invocation
identifier "text"
. "."
identifier "length"
argument_list
( "("
) ")"
) ")"
; ";"
expression_statement
method_invocation
identifier "renderWrappedText"
argument_list
( "("
identifier "sb"
, ","
identifier "width"
, ","
identifier "nextLineTabStop"
, ","
identifier "text"
) ")"
; ";"
expression_statement
method_invocation
identifier "pw"
. "."
identifier "println"
argument_list
( "("
method_invocation
identifier "sb"
. "."
identifier "toString"
argument_list
( "("
) ")"
) ")"
; ";"
} "}"
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * Render the specified Options and return the rende"...
method_declaration (+712 nodes collapsed)
block_comment "/**\n * Render the specified text and return the rendered"...
method_declaration (+287 nodes collapsed)
block_comment "/**\n * Render the specified text width a maximum width. "...
line_comment "// cannot happen"
block_comment "/**\n * Finds the next text wrap position after <code>sta"...
method_declaration (+260 nodes collapsed)
block_comment "/**\n * Return a String of padding of length <code>len</c"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * Remove the trailing whitespace from the specified"...
method_declaration (+115 nodes collapsed)
line_comment "// ------------------------------------------------------ Pa"...
line_comment "// ---------------------------------------------------------"...
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * This class implements the <code>Comparator</code>"...
class_declaration (+78 nodes collapsed)
} "}"

After

program
block_comment "/**\n * Licensed to the Apache Software Foundation (ASF) unde"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "cli"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "BufferedReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "PrintWriter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "StringReader"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "ArrayList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Arrays"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collection"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Comparator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Iterator"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
block_comment "/** \n * A formatter of help messages for the current command"...
class_declaration
modifiers
public "public"
class "class"
identifier "HelpFormatter"
class_body
{ "{"
line_comment "// ---------------------------------------------------------"...
block_comment "/** default number of characters per line */"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_WIDTH"
= "="
decimal_integer_literal "74"
; ";"
block_comment "/** default padding to the left of each line */"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_LEFT_PAD"
= "="
decimal_integer_literal "1"
; ";"
block_comment "/**\n * the number of characters of padding to be prefixe"...
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "DEFAULT_DESC_PAD"
= "="
decimal_integer_literal "3"
; ";"
block_comment "/** the string to display at the beginning of the usage stat"...
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_SYNTAX_PREFIX"
= "="
string_literal
" "\""
string_fragment "usage: "
" "\""
; ";"
block_comment "/** default prefix for shortOpts */"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_OPT_PREFIX"
= "="
string_literal
" "\""
string_fragment "-"
" "\""
; ";"
block_comment "/** default prefix for long Option */"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_LONG_OPT_PREFIX"
= "="
string_literal
" "\""
string_fragment "--"
" "\""
; ";"
block_comment "/** default separator displayed between a long Option and it"...
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_LONG_OPT_SEPARATOR"
= "="
string_literal
" "\""
string_fragment " "
" "\""
; ";"
block_comment "/** default name for an argument */"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "DEFAULT_ARG_NAME"
= "="
string_literal
" "\""
string_fragment "arg"
" "\""
; ";"
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * number of characters per line\n *\n * @depr"...
field_declaration
modifiers
public "public"
integral_type
int "int"
variable_declarator
identifier "defaultWidth"
= "="
identifier "DEFAULT_WIDTH"
; ";"
block_comment "/**\n * amount of padding to the left of each line\n *"...
field_declaration
modifiers
public "public"
integral_type
int "int"
variable_declarator
identifier "defaultLeftPad"
= "="
identifier "DEFAULT_LEFT_PAD"
; ";"
block_comment "/**\n * the number of characters of padding to be prefixe"...
field_declaration
modifiers
public "public"
integral_type
int "int"
variable_declarator
identifier "defaultDescPad"
= "="
identifier "DEFAULT_DESC_PAD"
; ";"
block_comment "/**\n * the string to display at the begining of the usag"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultSyntaxPrefix"
= "="
identifier "DEFAULT_SYNTAX_PREFIX"
; ";"
block_comment "/**\n * the new line string\n *\n * @deprecated Sco"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultNewLine"
= "="
method_invocation
identifier "System"
. "."
identifier "getProperty"
argument_list
( "("
string_literal
" "\""
string_fragment "line.separator"
" "\""
) ")"
; ";"
block_comment "/**\n * the shortOpt prefix\n *\n * @deprecated Sco"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultOptPrefix"
= "="
identifier "DEFAULT_OPT_PREFIX"
; ";"
block_comment "/**\n * the long Opt prefix\n *\n * @deprecated Sco"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultLongOptPrefix"
= "="
identifier "DEFAULT_LONG_OPT_PREFIX"
; ";"
block_comment "/** The separator displayed between the long option and its "...
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "longOptSeparator"
= "="
identifier "DEFAULT_LONG_OPT_SEPARATOR"
; ";"
block_comment "/**\n * the name of the argument\n *\n * @deprecate"...
field_declaration
modifiers
public "public"
type_identifier "String"
variable_declarator
identifier "defaultArgName"
= "="
identifier "DEFAULT_ARG_NAME"
; ";"
block_comment "/**\n * Comparator used to sort the options when they out"...
field_declaration
modifiers
protected "protected"
type_identifier "Comparator"
variable_declarator
identifier "optionComparator"
= "="
object_creation_expression
new "new"
type_identifier "OptionComparator"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * Sets the 'width'.\n *\n * @param width the "...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the 'width'.\n *\n * @return the 'w"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getWidth"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultWidth"
; ";"
} "}"
block_comment "/**\n * Sets the 'leftPadding'.\n *\n * @param padd"...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the 'leftPadding'.\n *\n * @return "...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getLeftPadding"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultLeftPad"
; ";"
} "}"
block_comment "/**\n * Sets the 'descPadding'.\n *\n * @param padd"...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Returns the 'descPadding'.\n *\n * @return "...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getDescPadding"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultDescPad"
; ";"
} "}"
block_comment "/**\n * Sets the 'syntaxPrefix'.\n *\n * @param pre"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'syntaxPrefix'.\n *\n * @return"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getSyntaxPrefix"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultSyntaxPrefix"
; ";"
} "}"
block_comment "/**\n * Sets the 'newLine'.\n *\n * @param newline "...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'newLine'.\n *\n * @return the "...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getNewLine"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultNewLine"
; ";"
} "}"
block_comment "/**\n * Sets the 'optPrefix'.\n *\n * @param prefix"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'optPrefix'.\n *\n * @return th"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getOptPrefix"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultOptPrefix"
; ";"
} "}"
block_comment "/**\n * Sets the 'longOptPrefix'.\n *\n * @param pr"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'longOptPrefix'.\n *\n * @retur"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getLongOptPrefix"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultLongOptPrefix"
; ";"
} "}"
block_comment "/**\n * Set the separator displayed between a long option"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the separator displayed between a long op"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getLongOptSeparator"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "longOptSeparator"
; ";"
} "}"
block_comment "/**\n * Sets the 'argName'.\n *\n * @param name the"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Returns the 'argName'.\n *\n * @return the "...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getArgName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "defaultArgName"
; ";"
} "}"
block_comment "/**\n * Comparator used to sort the options when they out"...
method_declaration
modifiers
public "public"
type_identifier "Comparator"
identifier "getOptionComparator"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "optionComparator"
; ";"
} "}"
block_comment "/**\n * Set the comparator used to sort the options when "...
method_declaration (+53 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+42 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+49 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Print the help for <code>options</code> with the "...
method_declaration (+243 nodes collapsed)
block_comment "/**\n * Prints the usage statement for the specified appl"...
method_declaration (+319 nodes collapsed)
block_comment "/**\n * Appends the usage clause for an OptionGroup to a "...
method_declaration (+197 nodes collapsed)
block_comment "/**\n * Appends the usage clause for an Option to a Strin"...
method_declaration (+281 nodes collapsed)
block_comment "/**\n * Print the cmdLineSyntax to the specified writer, "...
method_declaration (+67 nodes collapsed)
block_comment "/**\n * Print the help for the specified Options to the s"...
method_declaration (+77 nodes collapsed)
block_comment "/**\n * Print the specified text to the specified PrintWr"...
method_declaration (+37 nodes collapsed)
block_comment "/**\n * Print the specified text to the specified PrintWr"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "printWrapped"
formal_parameters
( "("
formal_parameter
type_identifier "PrintWriter"
identifier "pw"
, ","
formal_parameter
integral_type
int "int"
identifier "width"
, ","
formal_parameter
integral_type
int "int"
identifier "nextLineTabStop"
, ","
formal_parameter
type_identifier "String"
identifier "text"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "StringBuffer"
variable_declarator
identifier "sb"
= "="
object_creation_expression
new "new"
type_identifier "StringBuffer"
argument_list
( "("
method_invocation
identifier "text"
. "."
identifier "length"
argument_list
( "("
) ")"
) ")"
; ";"
expression_statement
method_invocation
identifier "renderWrappedTextBlock"
argument_list
( "("
identifier "sb"
, ","
identifier "width"
, ","
identifier "nextLineTabStop"
, ","
identifier "text"
) ")"
; ";"
expression_statement
method_invocation
identifier "pw"
. "."
identifier "println"
argument_list
( "("
method_invocation
identifier "sb"
. "."
identifier "toString"
argument_list
( "("
) ")"
) ")"
; ";"
} "}"
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * Render the specified Options and return the rende"...
method_declaration (+712 nodes collapsed)
block_comment "/**\n * Render the specified text and return the rendered"...
method_declaration (+287 nodes collapsed)
block_comment "/**\n * Render the specified text width a maximum width. "...
method_declaration
modifiers
private "private"
type_identifier "StringBuffer"
identifier "renderWrappedTextBlock"
formal_parameters
( "("
formal_parameter
type_identifier "StringBuffer"
identifier "sb"
, ","
formal_parameter
integral_type
int "int"
identifier "width"
, ","
formal_parameter
integral_type
int "int"
identifier "nextLineTabStop"
, ","
formal_parameter
type_identifier "String"
identifier "text"
) ")"
block
{ "{"
try_statement
try "try"
block
{ "{"
local_variable_declaration
type_identifier "BufferedReader"
variable_declarator
identifier "in"
= "="
object_creation_expression
new "new"
type_identifier "BufferedReader"
argument_list
( "("
object_creation_expression
new "new"
type_identifier "StringReader"
argument_list
( "("
identifier "text"
) ")"
) ")"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "line"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "firstLine"
= "="
true "true"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
parenthesized_expression
( "("
assignment_expression
identifier "line"
= "="
method_invocation
identifier "in"
. "."
identifier "readLine"
argument_list
( "("
) ")"
) ")"
!= "!="
null_literal "null"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
identifier "firstLine"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "sb"
. "."
identifier "append"
argument_list
( "("
method_invocation
identifier "getNewLine"
argument_list
( "("
) ")"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
assignment_expression
identifier "firstLine"
= "="
false "false"
; ";"
} "}"
expression_statement
method_invocation
identifier "renderWrappedText"
argument_list
( "("
identifier "sb"
, ","
identifier "width"
, ","
identifier "nextLineTabStop"
, ","
identifier "line"
) ")"
; ";"
} "}"
} "}"
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "IOException"
identifier "e"
) ")"
block
{ "{"
line_comment "// cannot happen"
} "}"
return_statement
return "return"
identifier "sb"
; ";"
} "}"
block_comment "/**\n * Finds the next text wrap position after <code>sta"...
method_declaration (+260 nodes collapsed)
block_comment "/**\n * Return a String of padding of length <code>len</c"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * Remove the trailing whitespace from the specified"...
method_declaration (+115 nodes collapsed)
line_comment "// ------------------------------------------------------ Pa"...
line_comment "// ---------------------------------------------------------"...
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * This class implements the <code>Comparator</code>"...
class_declaration (+78 nodes collapsed)
} "}"