public abstract class GenericCrudCommand extends Object implements CommandModelProvider, org.glassfish.hk2.api.PostConstruct, AdminCommandSecurity.Preauthorization
Modifier and Type | Field and Description |
---|---|
protected String |
commandName |
protected static Level |
level |
protected static LocalStringManagerImpl |
LOCAL_STRINGS |
protected static Logger |
LOGGER |
protected Class |
parentType |
protected Method |
targetMethod |
protected Class |
targetType |
Constructor and Description |
---|
GenericCrudCommand() |
Modifier and Type | Method and Description |
---|---|
static Properties |
convertStringToProperties(String propsString,
char sep)
Convert a String with the following format to Properties:
name1=value1:name2=value2:name3=value3:...
|
static String |
elementName(DomDocument document,
Class<?> parent,
Class<?> child)
Returns the element name used by the parent to store instances of the child
|
protected <T extends Annotation> |
getAnnotation(Method target,
Class<T> type) |
abstract Class |
getDecoratorClass()
Decorator class if particular command
|
InjectionResolver<Param> |
getInjectionResolver() |
protected Class<?> |
loadClass(String type) |
void |
postConstruct() |
boolean |
preAuthorization(AdminCommandContext adminCommandContext) |
void |
setInjectionResolver(InjectionResolver<Param> injector)
we need to have access to the injector instance that has all the parameters context
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getModel
protected static final Logger LOGGER
protected static final LocalStringManagerImpl LOCAL_STRINGS
protected String commandName
protected Class parentType
protected Class targetType
protected Method targetMethod
protected static final Level level
public boolean preAuthorization(AdminCommandContext adminCommandContext)
preAuthorization
in interface AdminCommandSecurity.Preauthorization
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
protected <T extends Annotation> T getAnnotation(Method target, Class<T> type)
public void setInjectionResolver(InjectionResolver<Param> injector)
injector
- the original command injectorpublic InjectionResolver<Param> getInjectionResolver()
protected Class<?> loadClass(String type) throws ClassNotFoundException
ClassNotFoundException
public static Properties convertStringToProperties(String propsString, char sep)
propsString
- the String to convertsep
- the separator characterpublic static String elementName(DomDocument document, Class<?> parent, Class<?> child) throws ClassNotFoundException
document
- the dom document this configuration element lives in.parent
- type of the parentchild
- type of the childClassNotFoundException
- when subclasses cannot be loadedpublic abstract Class getDecoratorClass()
Copyright © 2021. All rights reserved.