KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > util > classhelper > jdk12 > ClassHelperImpl


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.util.classhelper.jdk12;
13
14 public class ClassHelperImpl
15     extends com.versant.core.util.classhelper.ClassHelper {
16
17     public Class JavaDoc classForName(String JavaDoc clazz, boolean validate,
18                               ClassLoader JavaDoc loader) throws ClassNotFoundException JavaDoc
19     {
20         return Class.forName(clazz, validate, loader);
21     }
22
23     public ClassLoader JavaDoc getContextClassLoader(Thread JavaDoc thread)
24     {
25         return thread.getContextClassLoader();
26     }
27     public ClassLoader JavaDoc getSystemClassLoader()
28     {
29         return ClassLoader.getSystemClassLoader();
30     }
31
32     public void setAccessible(java.lang.reflect.Field JavaDoc field, boolean value)
33     {
34         field.setAccessible(value);
35     }
36
37     public void setAccessible(java.lang.reflect.Constructor JavaDoc ctor, boolean value)
38     {
39         ctor.setAccessible(value);
40     }
41
42     public Object JavaDoc getFieldValue(java.lang.reflect.Field JavaDoc field, Object JavaDoc obj)
43         throws IllegalAccessException JavaDoc
44     {
45         return field.get(obj);
46     }
47 }
48
Popular Tags