org.apache.bval.util
Class PrivilegedActions

java.lang.Object
  extended by org.apache.bval.util.PrivilegedActions
Direct Known Subclasses:
SecureActions

public class PrivilegedActions
extends Object

Description: utility methods to perform actions with AccessController or without.


Constructor Summary
PrivilegedActions()
           
 
Method Summary
static Object getAnnotationValue(Annotation annotation, String name)
          Return a PrivilegedAction object for clazz.getDeclaredMethod().invoke().
static Class<?> getClass(ClassLoader classLoader, String className)
          Perform AccessController.doPrivileged() action for ClassUtil.getClass()
static ClassLoader getClassLoader(Class<?> clazz)
          Return a PrivilegeAction object for clazz.getClassloader().
static String getLineSeparator()
          Deprecated. 
static String getPathSeparator()
          Deprecated. 
static String getProperty(String name)
          Return a PrivilegeAction object for System.getProperty().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivilegedActions

public PrivilegedActions()
Method Detail

getLineSeparator

@Deprecated
public static final String getLineSeparator()
Deprecated. 

Return the value of the "line.separator" system property. Requires security policy: 'permission java.util.PropertyPermission "read";'


getPathSeparator

@Deprecated
public static final String getPathSeparator()
Deprecated. 

Return the value of the "path.separator" system property. Requires security policy: 'permission java.util.PropertyPermission "read";'


getClass

public static Class<?> getClass(ClassLoader classLoader,
                                String className)
                         throws Exception
Perform AccessController.doPrivileged() action for ClassUtil.getClass()

Returns:
Class
Throws:
Exception

getAnnotationValue

public static Object getAnnotationValue(Annotation annotation,
                                        String name)
                                 throws IllegalAccessException,
                                        InvocationTargetException
Return a PrivilegedAction object for clazz.getDeclaredMethod().invoke(). Requires security policy 'permission java.lang.RuntimePermission "accessDeclaredMembers";' 'permission java.lang.reflect.ReflectPermission "suppressAccessChecks";'

Returns:
Object
Throws:
IllegalAccessException, - InvocationTargetException
IllegalAccessException
InvocationTargetException

getClassLoader

public static ClassLoader getClassLoader(Class<?> clazz)
Return a PrivilegeAction object for clazz.getClassloader(). Requires security policy: 'permission java.lang.RuntimePermission "getClassLoader";'

Returns:
Classloader

getProperty

public static final String getProperty(String name)
Return a PrivilegeAction object for System.getProperty(). Requires security policy: 'permission java.util.PropertyPermission "read";'

Returns:
String


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.