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, setRemoved
private 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()
ObjectConfigurable
null
values are accepted.getModuleName
in interface ObjectConfigurable
null
if none is configuredpublic java.lang.String getClassName()
ObjectConfigurable
getClassName
in interface ObjectConfigurable
static 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
PropertyConfigurable
setPropertyValueString
in interface PropertyConfigurable
propertyName
- 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)
PropertyConfigurable
getPropertyValueString
in interface PropertyConfigurable
propertyName
- the property namepublic ValueExpression<java.lang.String> getPropertyValueExpression(java.lang.String propertyName)
PropertyConfigurable
getPropertyValueExpression
in interface PropertyConfigurable
propertyName
- the property namepublic void setPropertyValueExpression(java.lang.String propertyName, java.lang.String expression)
PropertyConfigurable
setPropertyValueExpression
in interface PropertyConfigurable
propertyName
- 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)
PropertyConfigurable
value
parameter for the
value.setPropertyValueExpression
in interface PropertyConfigurable
propertyName
- 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)
PropertyConfigurable
hasProperty
in interface PropertyConfigurable
propertyName
- the property name to testtrue
if the name is configured, false
otherwisepublic boolean removeProperty(java.lang.String propertyName)
PropertyConfigurable
removeProperty
in interface PropertyConfigurable
propertyName
- the property nametrue
if the property name was removed, false
if it was not presentpublic java.util.List<java.lang.String> getPropertyNames()
PropertyConfigurable
getPropertyNames
in interface PropertyConfigurable
public boolean hasConstructorProperty(java.lang.String propertyName)
PropertyConfigurable
hasConstructorProperty
in interface PropertyConfigurable
propertyName
- 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()
PropertyConfigurable
getConstructorProperties
in interface PropertyConfigurable
public boolean addPostConfigurationMethod(java.lang.String methodName)
PropertyConfigurable
addPostConfigurationMethod
in interface PropertyConfigurable
methodName
- the name of the methodtrue
if the method was successfully added, otherwise false
public java.util.List<java.lang.String> getPostConfigurationMethods()
PropertyConfigurable
getPostConfigurationMethods
in interface PropertyConfigurable
public void setPostConfigurationMethods(java.lang.String... methodNames)
PropertyConfigurable
setPostConfigurationMethods
in interface PropertyConfigurable
methodNames
- the method names to invokepublic void setPostConfigurationMethods(java.util.List<java.lang.String> methodNames)
PropertyConfigurable
setPostConfigurationMethods
in interface PropertyConfigurable
methodNames
- the method names to invokepublic boolean removePostConfigurationMethod(java.lang.String methodName)
PropertyConfigurable
removePostConfigurationMethod
in interface PropertyConfigurable
methodName
- the method to removetrue
if the method was removed, otherwise false
protected 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)