abstract class AbstractPropertyConfiguration<T,C extends AbstractPropertyConfiguration<T,C>> extends AbstractBasicConfiguration<T,C> implements ObjectConfigurable, PropertyConfigurable
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
AbstractPropertyConfiguration.ConstructAction |
(package private) static class |
AbstractPropertyConfiguration.ModuleFinder |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<? extends T> |
actualClass |
private java.lang.String |
className |
private java.lang.String[] |
constructorProperties |
private java.lang.String |
moduleName |
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
postConfigurationMethods |
private java.util.Map<java.lang.String,ValueExpression<java.lang.String>> |
properties |
configs, refs| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPropertyConfiguration(java.lang.Class<T> baseClass,
LogContextConfigurationImpl configuration,
java.util.Map<java.lang.String,T> refs,
java.util.Map<java.lang.String,C> configs,
java.lang.String name,
java.lang.String moduleName,
java.lang.String className,
java.lang.String[] constructorProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPostConfigurationActions() |
private void |
addPostConfigurationActions(boolean replace) |
boolean |
addPostConfigurationMethod(java.lang.String methodName)
Adds a method name to be invoked after all properties have been set.
|
(package private) static boolean |
contains(java.lang.Object[] array,
java.lang.Object val) |
(package private) java.lang.Class<? extends T> |
getActualClass() |
java.lang.String |
getClassName()
Get the class name for this object's configuration.
|
(package private) ConfigAction<T> |
getConstructAction() |
java.util.List<java.lang.String> |
getConstructorProperties()
Returns a collection of the constructor properties.
|
(package private) static java.lang.Class<?> |
getConstructorPropertyType(java.lang.Class<?> clazz,
java.lang.String propertyName) |
(package private) abstract java.lang.String |
getDescription() |
java.lang.String |
getModuleName()
Get the module name for this object's configuration, if any.
|
java.util.List<java.lang.String> |
getPostConfigurationMethods()
Returns a collection of the methods to be invoked after the properties have been set.
|
(package private) static java.lang.reflect.Method |
getPropertyGetter(java.lang.Class<?> clazz,
java.lang.String propertyName) |
java.util.List<java.lang.String> |
getPropertyNames()
Get the names of the configured properties in order.
|
(package private) static java.lang.reflect.Method |
getPropertySetter(java.lang.Class<?> clazz,
java.lang.String propertyName) |
(package private) static java.lang.Class<?> |
getPropertyType(java.lang.Class<?> clazz,
java.lang.String propertyName) |
ValueExpression<java.lang.String> |
getPropertyValueExpression(java.lang.String propertyName)
Get the property value.
|
java.lang.String |
getPropertyValueString(java.lang.String propertyName)
Get the string property value with the given name.
|
boolean |
hasConstructorProperty(java.lang.String propertyName)
Determine whether the given property name is a constructor property.
|
boolean |
hasProperty(java.lang.String propertyName)
Determine whether the given property name is configured.
|
protected java.util.Deque<?> |
removePostConfigurationActions() |
boolean |
removePostConfigurationMethod(java.lang.String methodName)
Removes the post configuration method.
|
boolean |
removeProperty(java.lang.String propertyName)
Remove a configured property.
|
void |
setPostConfigurationMethods(java.util.List<java.lang.String> methodNames)
Sets the method names to be invoked after the properties have been set.
|
void |
setPostConfigurationMethods(java.lang.String... methodNames)
Sets the method names to be invoked after the properties have been set.
|
void |
setPropertyValueExpression(java.lang.String propertyName,
java.lang.String expression)
Sets the expression value for the property.
|
void |
setPropertyValueExpression(java.lang.String propertyName,
java.lang.String expression,
java.lang.String value)
Sets the expression value for the property.
|
private void |
setPropertyValueExpression(java.lang.String propertyName,
ValueExpression<java.lang.String> expression) |
void |
setPropertyValueString(java.lang.String propertyName,
java.lang.String value)
Set a property value from a string.
|
clearRemoved, getConfigs, getConfiguration, getName, getRefs, getRemoveAction, isRemoved, setRemovedprivate final java.lang.Class<? extends T> actualClass
private final java.lang.String moduleName
private final java.lang.String className
private final java.lang.String[] constructorProperties
private final java.util.Map<java.lang.String,ValueExpression<java.lang.String>> properties
private final java.util.Map<java.lang.String,java.lang.reflect.Method> postConfigurationMethods
protected AbstractPropertyConfiguration(java.lang.Class<T> baseClass, LogContextConfigurationImpl configuration, java.util.Map<java.lang.String,T> refs, java.util.Map<java.lang.String,C> configs, java.lang.String name, java.lang.String moduleName, java.lang.String className, java.lang.String[] constructorProperties)
ConfigAction<T> getConstructAction()
abstract java.lang.String getDescription()
public java.lang.String getModuleName()
ObjectConfigurablenull values are accepted.getModuleName in interface ObjectConfigurablenull if none is configuredpublic java.lang.String getClassName()
ObjectConfigurablegetClassName in interface ObjectConfigurablestatic boolean contains(java.lang.Object[] array,
java.lang.Object val)
public void setPropertyValueString(java.lang.String propertyName,
java.lang.String value)
throws java.lang.IllegalArgumentException
PropertyConfigurablesetPropertyValueString in interface PropertyConfigurablepropertyName - the property namevalue - the property valuejava.lang.IllegalArgumentException - if the given value is not acceptable for this propertypublic java.lang.String getPropertyValueString(java.lang.String propertyName)
PropertyConfigurablegetPropertyValueString in interface PropertyConfigurablepropertyName - the property namepublic ValueExpression<java.lang.String> getPropertyValueExpression(java.lang.String propertyName)
PropertyConfigurablegetPropertyValueExpression in interface PropertyConfigurablepropertyName - the property namepublic void setPropertyValueExpression(java.lang.String propertyName,
java.lang.String expression)
PropertyConfigurablesetPropertyValueExpression in interface PropertyConfigurablepropertyName - the name of the propertyexpression - the expression used to resolve the valuepublic void setPropertyValueExpression(java.lang.String propertyName,
java.lang.String expression,
java.lang.String value)
PropertyConfigurablevalue parameter for the
value.setPropertyValueExpression in interface PropertyConfigurablepropertyName - the name of the propertyexpression - the expression used to resolve the valuevalue - the value to useprivate void setPropertyValueExpression(java.lang.String propertyName,
ValueExpression<java.lang.String> expression)
public boolean hasProperty(java.lang.String propertyName)
PropertyConfigurablehasProperty in interface PropertyConfigurablepropertyName - the property name to testtrue if the name is configured, false otherwisepublic boolean removeProperty(java.lang.String propertyName)
PropertyConfigurableremoveProperty in interface PropertyConfigurablepropertyName - the property nametrue if the property name was removed, false if it was not presentpublic java.util.List<java.lang.String> getPropertyNames()
PropertyConfigurablegetPropertyNames in interface PropertyConfigurablepublic boolean hasConstructorProperty(java.lang.String propertyName)
PropertyConfigurablehasConstructorProperty in interface PropertyConfigurablepropertyName - the name of the property to check.true if the property should be used as a construction property, otherwise false.java.lang.Class<? extends T> getActualClass()
public java.util.List<java.lang.String> getConstructorProperties()
PropertyConfigurablegetConstructorProperties in interface PropertyConfigurablepublic boolean addPostConfigurationMethod(java.lang.String methodName)
PropertyConfigurableaddPostConfigurationMethod in interface PropertyConfigurablemethodName - the name of the methodtrue if the method was successfully added, otherwise falsepublic java.util.List<java.lang.String> getPostConfigurationMethods()
PropertyConfigurablegetPostConfigurationMethods in interface PropertyConfigurablepublic void setPostConfigurationMethods(java.lang.String... methodNames)
PropertyConfigurablesetPostConfigurationMethods in interface PropertyConfigurablemethodNames - the method names to invokepublic void setPostConfigurationMethods(java.util.List<java.lang.String> methodNames)
PropertyConfigurablesetPostConfigurationMethods in interface PropertyConfigurablemethodNames - the method names to invokepublic boolean removePostConfigurationMethod(java.lang.String methodName)
PropertyConfigurableremovePostConfigurationMethod in interface PropertyConfigurablemethodName - the method to removetrue if the method was removed, otherwise falseprotected final void addPostConfigurationActions()
private void addPostConfigurationActions(boolean replace)
protected final java.util.Deque<?> removePostConfigurationActions()
static java.lang.Class<?> getPropertyType(java.lang.Class<?> clazz,
java.lang.String propertyName)
static java.lang.Class<?> getConstructorPropertyType(java.lang.Class<?> clazz,
java.lang.String propertyName)
static java.lang.reflect.Method getPropertySetter(java.lang.Class<?> clazz,
java.lang.String propertyName)
static java.lang.reflect.Method getPropertyGetter(java.lang.Class<?> clazz,
java.lang.String propertyName)