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