KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > interop > rmi > iiop > FinalFieldSetter


1 /**
2  *
3  * Copyright 2004-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.geronimo.interop.rmi.iiop;
19
20 import org.apache.geronimo.interop.util.SystemUtil;
21
22 import java.lang.reflect.Field JavaDoc;
23
24 public abstract class FinalFieldSetter
25 {
26     private static final boolean JDK14 = SystemUtil.isJDK14();
27
28     public static FinalFieldSetter getInstance(Field JavaDoc f)
29     {
30         if(JDK14)
31         {
32             return new FinalFieldSetterJdk14(f);
33         }
34         else
35         {
36             throw new RuntimeException JavaDoc("FinalFieldSetter is not implemented for jdk version: " +
37                 SystemUtil.getVmVersion());
38         }
39     }
40
41     public abstract void setBoolean(Object JavaDoc that, boolean value);
42     public abstract void setByte(Object JavaDoc that, byte value);
43     public abstract void setChar(Object JavaDoc that, char value);
44     public abstract void setDouble(Object JavaDoc that, double value);
45     public abstract void setFloat(Object JavaDoc that, float value);
46     public abstract void setInt(Object JavaDoc that, int value);
47     public abstract void setLong(Object JavaDoc that, long value);
48     public abstract void setShort(Object JavaDoc that, short value);
49     public abstract void set(Object JavaDoc that, Object JavaDoc value);
50 }
51
Popular Tags