View Javadoc
1   /*******************************************************************************
2    * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian
3    * Thomschke.
4    * 
5    * All Rights Reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    * http://www.eclipse.org/legal/epl-v10.html
9    * 
10   * Contributors:
11   *     Sebastian Thomschke - initial implementation.
12   *******************************************************************************/
13  package net.sf.oval.internal.util;
14  
15  import java.lang.reflect.AccessibleObject;
16  import java.security.PrivilegedAction;
17  
18  /**
19   * @author Sebastian Thomschke
20   */
21  public final class SetAccessibleAction implements PrivilegedAction<Object>
22  {
23  	private final AccessibleObject ao;
24  
25  	public SetAccessibleAction(final AccessibleObject ao)
26  	{
27  		this.ao = ao;
28  	}
29  
30  	/**
31  	 * {@inheritDoc}
32  	 */
33  	public Object run()
34  	{
35  		ao.setAccessible(true);
36  		return null;
37  	}
38  }