Sample.java
Alexander Hristov
 
0001 0002 0003
/**
0004
* This class just features a plethora of java syntax constructs in order to test some of the analyzing features
0005
* of the HTML converter
0006
* @author Alexander Hristov
0007
*
0008
*/
0009
@
SuppressWarnings
(
value
=
{
"all"
}) 0010
public
abstract
class
HTMLTest
{ 0011 0012
private
int
intField
; 0013
private
int
intField1
=
0
; 0014
private
int
[]
intField2
; 0015
private
int
intField3
[]; 0016
private
int
[]
intField4
=
{
1
,(
int
)
Math
.
random
(),
3
}; 0017 0018
private
short
shortField
; 0019
private
short
shortField1
=
0
; 0020 0021
private
byte
byteField
; 0022
private
byte
byteField1
=
1
; 0023 0024
private
long
longField
; 0025
private
long
longField1
=
1
; 0026 0027
public
static
final
String
field2
=
"foo"
; 0028 0029
private
String
stringField1
; 0030
String
[]
stringField2
=
{
"a"
,
"b"
,
"c"
}; 0031
String
[][]
stringField3
=
{ {
"a"
,
"b"
,
"c"
},{
"a"
,
"b"
,
"c"
} }; 0032
private
String
[][]
stringField4
=
{ {
"a"
,
"b"
,
"c"
},{
"a"
,
"b"
,
"c"
} }; 0033 0034
// A really convoluted initialization;
0035
private
String
convoluted
=
new
Thread
( 0036
new
Runnable
() { 0037
private
int
innerFieldShouldNotBeVisible
; 0038
public
void
run
() { 0039
System
.
out
.
println
(
"foo"
); 0040 } 0041 } 0042 )
.
toString
(); 0043 0044
private
int
beforeStaticInitializer
; 0045
/*
0046
A very long multiline comment for testing highlighting.
0047
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
0048
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
0049
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
0050
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
0051
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
0052
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
0053
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
0054
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
0055
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
0056
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
0057
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
0058
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
0059
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
0060
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
0061
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum laborum laborum
0062
*/
0063 0064
// Static initializer
0065 0066
static
{ 0067
System
.
out
.
println
(
"foo"
); 0068 } 0069 0070
private
int
afterStaticInitializer
; 0071 0072
// Nonstatic initializer
0073 { 0074
System
.
out
.
println
(
"bar"
); 0075 } 0076
private
int
afterNonStaticInitializer
; 0077 0078
// Nested interface declaration
0079
protected
interface
sample
{ 0080
public
void
foo
(); 0081 } 0082 0083
// Nested class declaration
0084
protected
static
class
cls
{ 0085
int
a
; 0086
protected
static
class
cls2
{ 0087
int
b
; 0088 } 0089 } 0090 0091
// Nested annotation declaration
0092
protected
@
interface
annotation
{ } 0093 0094 0095
public
abstract
void
voidMehtod
(); 0096 0097
/**
0098
* Javadoc comment containing @interface
0099
* @param a Parameter a
0100
* @param b bParameter b
0101
*/
0102
public
void
sampleMethod
(
int
a
,
int
b
) { 0103
a
=
3
; 0104
b
=
4
; 0105
int
String
=
3
; 0106
float
FileInputStream
=
8
; 0107 } 0108 0109
/** Method with a marker annotation **/
0110
public
@
Deprecated
String
annotatedMethod1
() {
return
"test"
; } 0111 0112
/** Method with a value annotation **/
0113
public
@
SuppressWarnings
(
value
=
"deprecation"
)
String
annotatedMethod2
() {
return
"test"
; } 0114
public
@
SuppressWarnings
(
"deprecation"
)
String
annotatedMethod3
() {
return
"test"
; } 0115 0116
/** Method with two annotations **/
0117
public
@
Deprecated
@
SuppressWarnings
(
value
=
"deprecation"
)
String
annotatedMethod4
() {
return
"test"
; } 0118 0119
/** Method that mixes generics, arrays, and annotations **/
0120
public
@
SuppressWarnings
(
value
=
"deprecation"
)
java
.
util
.
HashMap
<
String
,
java
.
util
.
ArrayList
<
String
>
>
convoluted
0121 (
java
.
util
.
Map
<
Integer
,
java
.
util
.
List
<
String
>
>
name
0122 )
throws
java
.
io
.
IOException
{
return
null
; } 0123 0124 0125 0126} 0127
private field int afterStaticInitializer	[70-70]afterStaticInitializer
private field int beforeStaticInitializer	[44-44]beforeStaticInitializer
private field byte byteField	[21-21]byteField
private field byte byteField1	[22-22]byteField1
private field String convoluted	[34-42]convoluted
public final static field String field2	[27-27]field2
private field int intField	[9-12]intField
private field int intField1	[13-13]intField1
private field int[] intField2	[14-14]intField2
private field int intField3	[15-15]intField3
private field int[] intField4	[16-16]intField4
private field long longField	[24-24]longField
private field long longField1	[25-25]longField1
private field short shortField	[18-18]shortField
private field short shortField1	[19-19]shortField1
private field String stringField1	[29-29]stringField1
packagefield String[] stringField2	[30-30]stringField2
packagefield String[][] stringField3	[31-31]stringField3
private field String[][] stringField4	[32-32]stringField4
packagefield null null	[72-75]null
private field int afterNonStaticInitializer	[76-76]afterNonStaticInitializer
protected interface sample	[78-81]sample
protected annotation annotation	[91-92]annotation
public method null annotatedMethod1()	[109-110]annotatedMethod1 (...)
public method null annotatedMethod2()	[112-113]annotatedMethod2 (...)
public method null annotatedMethod3()	[114-114]annotatedMethod3 (...)
public method null annotatedMethod4()	[116-117]annotatedMethod4 (...)
public method null<<>> convoluted(java.util.Map<Integer,java.util.List<String>> name)	[119-122]convoluted (...)
public method void sampleMethod(int a, int b)	[97-107]sampleMethod (...)
public abstract method void voidMehtod()	[95-95]voidMehtod (...)
Coloring style :