class_body
{ "{"
block_comment "/**\n * ID to represent the 'UTC' string, default timezon"...
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "UTC_ID"
= "="
string_literal
" "\""
string_fragment "UTC"
" "\""
; ";"
block_comment "/**\n * The UTC timezone, prefetched to avoid more lookup"...
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "TimeZone"
variable_declarator
identifier "TIMEZONE_UTC"
= "="
method_invocation
identifier "TimeZone"
. "."
identifier "getTimeZone"
argument_list
( "("
identifier "UTC_ID"
) ")"
; ";"
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Format a date into 'yyyy-MM-ddThh:mm:ssZ' (defaul"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Format a date into 'yyyy-MM-ddThh:mm:ss[.sss]Z' ("...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * Format date into yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]"...
method_declaration (+616 nodes collapsed)
block_comment "/*\n /****************************************************"...
block_comment "/**\n * Parse a date from ISO-8601 formatted string. It e"...
method_declaration
modifiers
public "public"
static "static"
type_identifier "Date"
identifier "parse"
formal_parameters
( "("
formal_parameter
type_identifier "String"
identifier "date"
, ","
formal_parameter
type_identifier "ParsePosition"
identifier "pos"
) ")"
throws
throws "throws"
type_identifier "ParseException"
block
{ "{"
local_variable_declaration
type_identifier "Exception"
variable_declarator
identifier "fail"
= "="
null_literal "null"
; ";"
try_statement
try "try"
block
{ "{"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "offset"
= "="
method_invocation
identifier "pos"
. "."
identifier "getIndex"
argument_list
( "("
) ")"
; ";"
line_comment "// extract year"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "year"
= "="
method_invocation
identifier "parseInt"
argument_list
( "("
identifier "date"
, ","
identifier "offset"
, ","
assignment_expression
identifier "offset"
+= "+="
decimal_integer_literal "4"
) ")"
; ";"
if_statement (+24 nodes collapsed)
line_comment "// extract month"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "month"
= "="
method_invocation
identifier "parseInt"
argument_list
( "("
identifier "date"
, ","
identifier "offset"
, ","
assignment_expression
identifier "offset"
+= "+="
decimal_integer_literal "2"
) ")"
; ";"
if_statement (+24 nodes collapsed)
line_comment "// extract day"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "day"
= "="
method_invocation
identifier "parseInt"
argument_list
( "("
identifier "date"
, ","
identifier "offset"
, ","
assignment_expression
identifier "offset"
+= "+="
decimal_integer_literal "2"
) ")"
; ";"
line_comment "// default time value"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "hour"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "minutes"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "seconds"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "milliseconds"
= "="
decimal_integer_literal "0"
; ";"
line_comment "// always use 0 otherwise returned date will include millis "...
line_comment "// if the value has no time component (and no time zone), we"...
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "hasT"
= "="
method_invocation
identifier "checkOffset"
argument_list
( "("
identifier "date"
, ","
identifier "offset"
, ","
character_literal "'T'"
) ")"
; ";"
if_statement (+66 nodes collapsed)
if_statement (+341 nodes collapsed)
line_comment "// extract timezone"
if_statement (+31 nodes collapsed)
local_variable_declaration
type_identifier "TimeZone"
variable_declarator
identifier "timezone"
= "="
null_literal "null"
; ";"
local_variable_declaration
integral_type
char "char"
variable_declarator
identifier "timezoneIndicator"
= "="
method_invocation
identifier "date"
. "."
identifier "charAt"
argument_list
( "("
identifier "offset"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "timezoneIndicator"
== "=="
character_literal "'Z'"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "timezone"
= "="
identifier "TIMEZONE_UTC"
; ";"
expression_statement
assignment_expression
identifier "offset"
+= "+="
decimal_integer_literal "1"
; ";"
} "}"
else "else"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "timezoneIndicator"
== "=="
character_literal "'+'"
|| "||"
binary_expression
identifier "timezoneIndicator"
== "=="
character_literal "'-'"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "timezoneOffset"
= "="
method_invocation
identifier "date"
. "."
identifier "substring"
argument_list
( "("
identifier "offset"
) ")"
; ";"
line_comment "// When timezone has no minutes, we should append it, valid "...
expression_statement
assignment_expression
identifier "offset"
+= "+="
method_invocation
identifier "timezoneOffset"
. "."
identifier "length"
argument_list
( "("
) ")"
; ";"
line_comment "// 18-Jun-2015, tatu: Minor simplification, skip offset of \""...
if_statement (+175 nodes collapsed)
} "}"
else "else"
block (+25 nodes collapsed)
local_variable_declaration
type_identifier "Calendar"
variable_declarator
identifier "calendar"
= "="
object_creation_expression
new "new"
type_identifier "GregorianCalendar"
argument_list
( "("
identifier "timezone"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "setLenient"
argument_list
( "("
false "false"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "set"
argument_list
( "("
field_access
identifier "Calendar"
. "."
identifier "YEAR"
, ","
identifier "year"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "set"
argument_list
( "("
field_access
identifier "Calendar"
. "."
identifier "MONTH"
, ","
binary_expression
identifier "month"
- "-"
decimal_integer_literal "1"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "set"
argument_list
( "("
field_access
identifier "Calendar"
. "."
identifier "DAY_OF_MONTH"
, ","
identifier "day"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "set"
argument_list
( "("
field_access
identifier "Calendar"
. "."
identifier "HOUR_OF_DAY"
, ","
identifier "hour"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "set"
argument_list
( "("
field_access
identifier "Calendar"
. "."
identifier "MINUTE"
, ","
identifier "minutes"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "set"
argument_list
( "("
field_access
identifier "Calendar"
. "."
identifier "SECOND"
, ","
identifier "seconds"
) ")"
; ";"
expression_statement
method_invocation
identifier "calendar"
. "."
identifier "set"
argument_list
( "("
field_access
identifier "Calendar"
. "."
identifier "MILLISECOND"
, ","
identifier "milliseconds"
) ")"
; ";"
expression_statement
method_invocation
identifier "pos"
. "."
identifier "setIndex"
argument_list
( "("
identifier "offset"
) ")"
; ";"
return_statement
return "return"
method_invocation
identifier "calendar"
. "."
identifier "getTime"
argument_list
( "("
) ")"
; ";"
line_comment "// If we get a ParseException it'll already have the right m"...
line_comment "// Other exception types can convert here."
} "}"
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "IndexOutOfBoundsException"
identifier "e"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "fail"
= "="
identifier "e"
; ";"
} "}"
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "NumberFormatException"
identifier "e"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "fail"
= "="
identifier "e"
; ";"
} "}"
catch_clause
catch "catch"
( "("
catch_formal_parameter
catch_type
type_identifier "IllegalArgumentException"
identifier "e"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "fail"
= "="
identifier "e"
; ";"
} "}"
local_variable_declaration (+30 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "msg"
= "="
method_invocation
identifier "fail"
. "."
identifier "getMessage"
argument_list
( "("
) ")"
; ";"
if_statement (+51 nodes collapsed)
local_variable_declaration (+36 nodes collapsed)
expression_statement
method_invocation
identifier "ex"
. "."
identifier "initCause"
argument_list
( "("
identifier "fail"
) ")"
; ";"
throw_statement
throw "throw"
identifier "ex"
; ";"
} "}"
block_comment "/**\n * Check if the expected character exist at the give"...
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Parse an integer located between 2 given offsets "...
method_declaration (+264 nodes collapsed)
block_comment "/**\n * Zero pad a number to a specified length\n * \n "...
method_declaration (+91 nodes collapsed)
block_comment "/**\n * Returns the index of the first character in the s"...
method_declaration (+94 nodes collapsed)
} "}"