KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > idl > Environment


1 package org.jacorb.idl;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2004 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23
24
25 public final class Environment
26 {
27     /**
28      * <code>JAVA14</code> denotes whether we are using JDK 1.4.
29      */

30     static boolean JAVA14 = false;
31
32     static
33     {
34         String JavaDoc javaVer = System.getProperty ("java.version");
35         JAVA14 = (javaVer.indexOf ("1.4") != -1);
36     }
37
38
39     /**
40      * <code>intToPriority</code> returns the priority level for a given integer.
41      * It is a copy of the method in util/LogKitLoggerFactory copied to ensure
42      * that the idl compiler can be standalone.
43      *
44      * @param priority an <code>int</code> value
45      * @return an <code>org.apache.log.Priority</code> value
46      */

47     public static org.apache.log.Priority intToPriority(int priority)
48     {
49         switch (priority)
50         {
51             case 4 :
52                 return org.apache.log.Priority.DEBUG;
53             case 3 :
54                 return org.apache.log.Priority.INFO;
55             case 2 :
56                 return org.apache.log.Priority.WARN;
57             case 1 :
58                 return org.apache.log.Priority.ERROR;
59             case 0 :
60             default :
61                 return org.apache.log.Priority.FATAL_ERROR;
62         }
63     }
64 }
65
Popular Tags