d67304b25f4e1e3fa43a0413d9165cc482f090b5
[jalviewjs.git] / site / j2s / java / util / logging / LogRecord.js
1 Clazz.declarePackage ("java.util.logging");\r
2 Clazz.load (null, "java.util.logging.LogRecord", ["java.lang.NullPointerException", "$.Throwable"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.level = null;\r
5 this.sequenceNumber = 0;\r
6 this.sourceClassName = null;\r
7 this.sourceMethodName = null;\r
8 this.message = null;\r
9 this.threadID = 0;\r
10 this.millis = 0;\r
11 this.thrown = null;\r
12 this.loggerName = null;\r
13 this.resourceBundleName = null;\r
14 this.needToInferCaller = false;\r
15 this.parameters = null;\r
16 this.resourceBundle = null;\r
17 Clazz.instantialize (this, arguments);\r
18 }, java.util.logging, "LogRecord", null, java.io.Serializable);\r
19 Clazz.makeConstructor (c$, \r
20 function (level, msg) {\r
21 level.getClass ();\r
22 this.level = level;\r
23 this.message = msg;\r
24 this.millis = System.currentTimeMillis ();\r
25 this.needToInferCaller = true;\r
26 }, "java.util.logging.Level,~S");\r
27 Clazz.defineMethod (c$, "getLoggerName", \r
28 function () {\r
29 return this.loggerName;\r
30 });\r
31 Clazz.defineMethod (c$, "setLoggerName", \r
32 function (name) {\r
33 this.loggerName = name;\r
34 }, "~S");\r
35 Clazz.defineMethod (c$, "getResourceBundle", \r
36 function () {\r
37 return this.resourceBundle;\r
38 });\r
39 Clazz.defineMethod (c$, "setResourceBundle", \r
40 function (bundle) {\r
41 this.resourceBundle = bundle;\r
42 }, "java.util.ResourceBundle");\r
43 Clazz.defineMethod (c$, "getResourceBundleName", \r
44 function () {\r
45 return this.resourceBundleName;\r
46 });\r
47 Clazz.defineMethod (c$, "setResourceBundleName", \r
48 function (name) {\r
49 this.resourceBundleName = name;\r
50 }, "~S");\r
51 Clazz.defineMethod (c$, "getLevel", \r
52 function () {\r
53 return this.level;\r
54 });\r
55 Clazz.defineMethod (c$, "setLevel", \r
56 function (level) {\r
57 if (level == null) {\r
58 throw  new NullPointerException ();\r
59 }this.level = level;\r
60 }, "java.util.logging.Level");\r
61 Clazz.defineMethod (c$, "getSequenceNumber", \r
62 function () {\r
63 return this.sequenceNumber;\r
64 });\r
65 Clazz.defineMethod (c$, "setSequenceNumber", \r
66 function (seq) {\r
67 this.sequenceNumber = seq;\r
68 }, "~N");\r
69 Clazz.defineMethod (c$, "getSourceClassName", \r
70 function () {\r
71 if (this.needToInferCaller) {\r
72 this.inferCaller ();\r
73 }return this.sourceClassName;\r
74 });\r
75 Clazz.defineMethod (c$, "setSourceClassName", \r
76 function (sourceClassName) {\r
77 this.sourceClassName = sourceClassName;\r
78 this.needToInferCaller = false;\r
79 }, "~S");\r
80 Clazz.defineMethod (c$, "getSourceMethodName", \r
81 function () {\r
82 if (this.needToInferCaller) {\r
83 this.inferCaller ();\r
84 }return this.sourceMethodName;\r
85 });\r
86 Clazz.defineMethod (c$, "setSourceMethodName", \r
87 function (sourceMethodName) {\r
88 this.sourceMethodName = sourceMethodName;\r
89 this.needToInferCaller = false;\r
90 }, "~S");\r
91 Clazz.defineMethod (c$, "getMessage", \r
92 function () {\r
93 return this.message;\r
94 });\r
95 Clazz.defineMethod (c$, "setMessage", \r
96 function (message) {\r
97 this.message = message;\r
98 }, "~S");\r
99 Clazz.defineMethod (c$, "getParameters", \r
100 function () {\r
101 return this.parameters;\r
102 });\r
103 Clazz.defineMethod (c$, "setParameters", \r
104 function (parameters) {\r
105 this.parameters = parameters;\r
106 }, "~A");\r
107 Clazz.defineMethod (c$, "getThreadID", \r
108 function () {\r
109 return this.threadID;\r
110 });\r
111 Clazz.defineMethod (c$, "setThreadID", \r
112 function (threadID) {\r
113 this.threadID = threadID;\r
114 }, "~N");\r
115 Clazz.defineMethod (c$, "getMillis", \r
116 function () {\r
117 return this.millis;\r
118 });\r
119 Clazz.defineMethod (c$, "setMillis", \r
120 function (millis) {\r
121 this.millis = millis;\r
122 }, "~N");\r
123 Clazz.defineMethod (c$, "getThrown", \r
124 function () {\r
125 return this.thrown;\r
126 });\r
127 Clazz.defineMethod (c$, "setThrown", \r
128 function (thrown) {\r
129 this.thrown = thrown;\r
130 }, "Throwable");\r
131 Clazz.defineMethod (c$, "inferCaller", \r
132  function () {\r
133 this.needToInferCaller = false;\r
134 var stack = ( new Throwable ()).getStackTrace ();\r
135 var ix = 0;\r
136 while (ix < stack.length) {\r
137 var frame = stack[ix];\r
138 var cname = frame.getClassName ();\r
139 if (cname.equals ("java.util.logging.Logger")) {\r
140 break;\r
141 }ix++;\r
142 }\r
143 while (ix < stack.length) {\r
144 var frame = stack[ix];\r
145 var cname = frame.getClassName ();\r
146 if (!cname.equals ("java.util.logging.Logger")) {\r
147 this.setSourceClassName (cname);\r
148 this.setSourceMethodName (frame.getMethodName ());\r
149 return;\r
150 }ix++;\r
151 }\r
152 });\r
153 Clazz.defineStatics (c$,\r
154 "globalSequenceNumber", 0);\r
155 });\r