public class CVComponentConfigHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
CVComponentConfigHelper.ComponentConfigBeanFiller
The overridden ConfigBeanFiller with CVComponent-specific config
serialization.
|
protected static class |
CVComponentConfigHelper.ComponentConfigTypeGenerator
The overridden ConfigTypeGenerator with CVComponent-specific config
serialization.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.Class<?> |
clazz |
static java.lang.String |
COMPONENT_CONFIG_CLASS_NAME_KEY
Name of the key which stores generic config object types.
|
protected java.lang.ClassLoader |
loader |
Constructor and Description |
---|
CVComponentConfigHelper(java.lang.ClassLoader loader,
java.lang.String pluginClass)
Build a new config helper
|
Modifier and Type | Method and Description |
---|---|
static CVComponentConfig |
buildConfig(java.lang.ClassLoader loader,
java.lang.Class<? extends CVComponentConfig> configClass,
com.exalead.config.ConfigApi conf)
Static helper to build a CVComponentConfig corresponding to a given
config class, using the provided ConfigApi object.
|
static CVComponentConfig |
buildConfig(java.lang.ClassLoader loader,
java.lang.Class<? extends CVComponentConfig> configClass,
exa.bee.KeyValue kv)
Static helper to build a CVComponentConfig corresponding to a given
config class, using the provided root KeyValue object.
|
CVComponentConfig |
buildConfig(com.exalead.config.ConfigApi conf)
Build a new CVComponentConfig corresponding to the current class, using
the provided ConfigApi object.
|
CVComponentConfig |
buildConfig(exa.bee.KeyValue root)
Build a new CVComponentConfig corresponding to the current class, using
the provided configuration root key.
|
CVComponentConfig |
buildConfig(java.util.List<exa.bee.KeyValue> kv)
Build a new CVComponentConfig corresponding to the current class, using
the provided configuration keys.
|
CVComponentConfig |
buildConfig(java.lang.String[] kv)
Build a new CVComponentConfig corresponding to the current class, using
the provided configuration keys.
|
CVComponentConfigCheck<CVComponentConfig> |
buildConfigChecker()
Build a new CVComponentConfigCheck corresponding to the current class,
using the provided configuration keys.
|
void |
checkConfig(CVComponentConfig config,
boolean useNow)
Check a configuration using plugin's configuration checker.
|
protected static void |
ensureAnnotationIsNotPresent(java.lang.Class<?> parent,
java.lang.Class<?> cls)
Ensure annotation classes are sane (class loader hell)
|
java.lang.Class<?> |
getComponentClass()
Return the component class.
|
CVComponentConfigClass |
getComponentConfigClass()
Get the CVComponentConfigClass associated with the component class.
|
protected com.exalead.config.ConfigApi |
getConfigApi(exa.bee.KeyValue root) |
protected com.exalead.config.ConfigApi |
getConfigApi(java.util.List<exa.bee.KeyValue> kv) |
protected com.exalead.config.ConfigApi |
getConfigApi(java.lang.String[] kv) |
java.lang.Class<? extends CVComponentConfigCheck<? extends CVComponentConfig>> |
getConfigCheckClass()
Get the configuration checker class.
|
java.lang.Class<? extends CVComponentConfig> |
getConfigClass()
Get the configuration class.
|
protected java.lang.Class<? extends CVComponentConfig> |
getConfigClassInternal()
Get the configuration class.
|
static exa.bee.KeyValue |
getConfigKV(CVComponentConfig config)
Get the component configuration as KeyValue.
|
static exa.bee.KeyValue |
getConfigKV(CVComponentConfig config,
boolean addDefaultValue)
Get the component configuration as KeyValue.
|
ConfigBeanFiller.DefaultConfig |
getDefaultBeanConfig()
Return the default configuration as a DefaultConfig object.
|
ConfigBeanFiller.DefaultConfig |
getDefaultBeanConfig(boolean addDefaultValue)
Return the default configuration as a DefaultConfig object.
|
CVComponentConfig |
getDefaultConfig()
Get the default component configuration.
|
exa.bee.KeyValue |
getDefaultConfigKV()
Get the default component configuration as KeyValue.
|
exa.bee.KeyValue |
getDefaultConfigKV(boolean addDefaultValue)
Get the default component configuration as KeyValue.
|
Descriptor |
getDescriptor()
Get the default component configuration as KeyValue.
|
static Descriptor |
getDescriptorOf(CVComponentConfig config)
Get the component Descriptor.
|
boolean |
isCVComponent()
Is the current class a component class ?
|
static void |
main(java.lang.String[] args)
Static main sample (debugging purpose).
|
public static final java.lang.String COMPONENT_CONFIG_CLASS_NAME_KEY
protected final java.lang.Class<?> clazz
protected final java.lang.ClassLoader loader
public CVComponentConfigHelper(java.lang.ClassLoader loader, java.lang.String pluginClass) throws java.lang.ClassNotFoundException
pluginClass
- The plugin class nameloader
- class loader used to load the plugin and its componentsjava.lang.ClassNotFoundException
protected com.exalead.config.ConfigApi getConfigApi(java.lang.String[] kv)
protected com.exalead.config.ConfigApi getConfigApi(java.util.List<exa.bee.KeyValue> kv)
protected com.exalead.config.ConfigApi getConfigApi(exa.bee.KeyValue root)
protected static void ensureAnnotationIsNotPresent(java.lang.Class<?> parent, java.lang.Class<?> cls) throws java.lang.ClassCastException
java.lang.ClassCastException
public java.lang.Class<?> getComponentClass()
public CVComponentConfigClass getComponentConfigClass()
public boolean isCVComponent() throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
protected java.lang.Class<? extends CVComponentConfig> getConfigClassInternal()
public java.lang.Class<? extends CVComponentConfig> getConfigClass() throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public java.lang.Class<? extends CVComponentConfigCheck<? extends CVComponentConfig>> getConfigCheckClass() throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static CVComponentConfig buildConfig(java.lang.ClassLoader loader, java.lang.Class<? extends CVComponentConfig> configClass, com.exalead.config.ConfigApi conf) throws MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public static CVComponentConfig buildConfig(java.lang.ClassLoader loader, java.lang.Class<? extends CVComponentConfig> configClass, exa.bee.KeyValue kv) throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public CVComponentConfig buildConfig(com.exalead.config.ConfigApi conf) throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public CVComponentConfig buildConfig(exa.bee.KeyValue root) throws MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public CVComponentConfig buildConfig(java.util.List<exa.bee.KeyValue> kv) throws MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public CVComponentConfig buildConfig(java.lang.String[] kv) throws MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public CVComponentConfigCheck<CVComponentConfig> buildConfigChecker() throws java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public void checkConfig(CVComponentConfig config, boolean useNow) throws MandatoryKeyMissingException, IllegalValueException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.Exception
useNow
- if true, the configuration check should also include checks
related to the current state of the plugin peers or
environment ; that is, typically checking that a remote server
is available, file path filled exist, etc. If useNow is false,
the check should not assume that potentially configured
resources are available now (remote servers(s) might be down,
third-party configuration elements might be missing etc.)MandatoryKeyMissingException
IllegalValueException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.Exception
public CVComponentConfig getDefaultConfig() throws MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public exa.bee.KeyValue getDefaultConfigKV() throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public exa.bee.KeyValue getDefaultConfigKV(boolean addDefaultValue) throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public ConfigBeanFiller.DefaultConfig getDefaultBeanConfig(boolean addDefaultValue) throws java.lang.NoSuchMethodException, java.lang.Exception
java.lang.NoSuchMethodException
java.lang.Exception
public ConfigBeanFiller.DefaultConfig getDefaultBeanConfig() throws java.lang.NoSuchMethodException, java.lang.Exception
java.lang.NoSuchMethodException
java.lang.Exception
public Descriptor getDescriptor() throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public static exa.bee.KeyValue getConfigKV(CVComponentConfig config) throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public static exa.bee.KeyValue getConfigKV(CVComponentConfig config, boolean addDefaultValue) throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
config
- The configurationdefaultValues
- if true, always add a default value (especially for arrays)java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public static Descriptor getDescriptorOf(CVComponentConfig config) throws java.lang.NoSuchMethodException, MandatoryKeyMissingException, IllegalValueException, java.lang.ClassNotFoundException, java.lang.Exception
java.lang.NoSuchMethodException
MandatoryKeyMissingException
IllegalValueException
java.lang.ClassNotFoundException
java.lang.Exception
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
Copyright © 2013 Dassault Systèmes, All Rights Reserved.