public abstract class Selector<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Selector.Getter<T>
An efficient, unchecked getter for a selector for a given class.
|
Constructor and Description |
---|
Selector() |
Modifier and Type | Method and Description |
---|---|
abstract T |
get()
Get the currently relevant object, or
null if there is none. |
static SelectorPermission |
getChangePermissionFor(Class<?> clazz)
Get the
change permission for the given class. |
static SelectorPermission |
getGetPermissionFor(Class<?> clazz)
Get the
get permission for the given class. |
static SelectorPermission |
getSetPermissionFor(Class<?> clazz)
Get the
set permission for the given class. |
static <T> Selector<T> |
nullSelector()
Get the
null selector. |
static <T> Selector<T> |
selectorFor(Class<T> clazz)
Get the selector for a given class.
|
static <T> PrivilegedAction<Selector.Getter<T>> |
selectorGetterActionFor(Class<T> clazz)
Get a privileged action which returns the getter for a selector.
|
static <T> Selector.Getter<T> |
selectorGetterFor(Class<T> clazz)
Get an efficient, unchecked selector getter for a given class.
|
static <T> void |
setSelectorFor(Class<T> clazz,
Selector<T> selector)
Set the selector for a given class.
|
public abstract T get()
null
if there is none.public static <T> Selector<T> nullSelector()
null
selector. This selector always returns null
.T
- the selectable class' typenull
selectorpublic static <T> Selector<T> selectorFor(Class<T> clazz)
null
. If there is a selector set, the caller must
have the get
SelectorPermission
for the class.T
- the class typeclazz
- the classnull
)public static <T> void setSelectorFor(Class<T> clazz, Selector<T> selector)
set
SelectorPermission
for that class.
If there is one set, the caller must have the change
SelectorPermission
. If there is a selector
set, and it is identical to the proposed selector, this method returns without taking any action.T
- the class typeclazz
- the classselector
- the selector to set for the classpublic static <T> Selector.Getter<T> selectorGetterFor(Class<T> clazz)
get
SelectorPermission
for the class.T
- the class typeclazz
- the classpublic static <T> PrivilegedAction<Selector.Getter<T>> selectorGetterActionFor(Class<T> clazz)
T
- the class typeclazz
- the classpublic static SelectorPermission getGetPermissionFor(Class<?> clazz)
get
permission for the given class. The permission is cached.clazz
- the class to get the permission forpublic static SelectorPermission getSetPermissionFor(Class<?> clazz)
set
permission for the given class. The permission is cached.clazz
- the class to get the permission forpublic static SelectorPermission getChangePermissionFor(Class<?> clazz)
change
permission for the given class. The permission is cached.clazz
- the class to get the permission forCopyright © 2015 JBoss, a division of Red Hat, Inc.