Package org.jboss.logmanager.config
Class AbstractPropertyConfiguration<T,C extends AbstractPropertyConfiguration<T,C>>
- java.lang.Object
-
- org.jboss.logmanager.config.AbstractBasicConfiguration<T,C>
-
- org.jboss.logmanager.config.AbstractPropertyConfiguration<T,C>
-
- All Implemented Interfaces:
NamedConfigurable,ObjectConfigurable,PropertyConfigurable
- Direct Known Subclasses:
ErrorManagerConfigurationImpl,FilterConfigurationImpl,FormatterConfigurationImpl,HandlerConfigurationImpl,PojoConfigurationImpl
abstract class AbstractPropertyConfiguration<T,C extends AbstractPropertyConfiguration<T,C>> extends AbstractBasicConfiguration<T,C> implements ObjectConfigurable, PropertyConfigurable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classAbstractPropertyConfiguration.ConstructAction(package private) static classAbstractPropertyConfiguration.ModuleFinder
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<? extends T>actualClassprivate java.lang.StringclassNameprivate java.lang.String[]constructorPropertiesprivate java.lang.StringmoduleNameprivate java.util.Map<java.lang.String,java.lang.reflect.Method>postConfigurationMethodsprivate java.util.Map<java.lang.String,ValueExpression<java.lang.String>>properties-
Fields inherited from class org.jboss.logmanager.config.AbstractBasicConfiguration
configs, refs
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPropertyConfiguration(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)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddPostConfigurationActions()private voidaddPostConfigurationActions(boolean replace)booleanaddPostConfigurationMethod(java.lang.String methodName)Adds a method name to be invoked after all properties have been set.(package private) static booleancontains(java.lang.Object[] array, java.lang.Object val)(package private) java.lang.Class<? extends T>getActualClass()java.lang.StringgetClassName()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.StringgetDescription()java.lang.StringgetModuleName()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.MethodgetPropertyGetter(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.MethodgetPropertySetter(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.StringgetPropertyValueString(java.lang.String propertyName)Get the string property value with the given name.booleanhasConstructorProperty(java.lang.String propertyName)Determine whether the given property name is a constructor property.booleanhasProperty(java.lang.String propertyName)Determine whether the given property name is configured.protected java.util.Deque<?>removePostConfigurationActions()booleanremovePostConfigurationMethod(java.lang.String methodName)Removes the post configuration method.booleanremoveProperty(java.lang.String propertyName)Remove a configured property.voidsetPostConfigurationMethods(java.lang.String... methodNames)Sets the method names to be invoked after the properties have been set.voidsetPostConfigurationMethods(java.util.List<java.lang.String> methodNames)Sets the method names to be invoked after the properties have been set.voidsetPropertyValueExpression(java.lang.String propertyName, java.lang.String expression)Sets the expression value for the property.voidsetPropertyValueExpression(java.lang.String propertyName, java.lang.String expression, java.lang.String value)Sets the expression value for the property.private voidsetPropertyValueExpression(java.lang.String propertyName, ValueExpression<java.lang.String> expression)voidsetPropertyValueString(java.lang.String propertyName, java.lang.String value)Set a property value from a string.-
Methods inherited from class org.jboss.logmanager.config.AbstractBasicConfiguration
clearRemoved, getConfigs, getConfiguration, getName, getRefs, getRemoveAction, isRemoved, setRemoved
-
-
-
-
Field Detail
-
actualClass
private final java.lang.Class<? extends T> actualClass
-
moduleName
private final java.lang.String moduleName
-
className
private final java.lang.String className
-
constructorProperties
private final java.lang.String[] constructorProperties
-
properties
private final java.util.Map<java.lang.String,ValueExpression<java.lang.String>> properties
-
postConfigurationMethods
private final java.util.Map<java.lang.String,java.lang.reflect.Method> postConfigurationMethods
-
-
Constructor Detail
-
AbstractPropertyConfiguration
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)
-
-
Method Detail
-
getConstructAction
ConfigAction<T> getConstructAction()
-
getDescription
abstract java.lang.String getDescription()
-
getModuleName
public java.lang.String getModuleName()
Description copied from interface:ObjectConfigurableGet the module name for this object's configuration, if any. If JBoss Modules is not present on the class path, onlynullvalues are accepted.- Specified by:
getModuleNamein interfaceObjectConfigurable- Returns:
- the module name, or
nullif none is configured
-
getClassName
public java.lang.String getClassName()
Description copied from interface:ObjectConfigurableGet the class name for this object's configuration.- Specified by:
getClassNamein interfaceObjectConfigurable- Returns:
- the class name
-
contains
static boolean contains(java.lang.Object[] array, java.lang.Object val)
-
setPropertyValueString
public void setPropertyValueString(java.lang.String propertyName, java.lang.String value) throws java.lang.IllegalArgumentExceptionDescription copied from interface:PropertyConfigurableSet a property value from a string.- Specified by:
setPropertyValueStringin interfacePropertyConfigurable- Parameters:
propertyName- the property namevalue- the property value- Throws:
java.lang.IllegalArgumentException- if the given value is not acceptable for this property
-
getPropertyValueString
public java.lang.String getPropertyValueString(java.lang.String propertyName)
Description copied from interface:PropertyConfigurableGet the string property value with the given name.- Specified by:
getPropertyValueStringin interfacePropertyConfigurable- Parameters:
propertyName- the property name- Returns:
- the property value string
-
getPropertyValueExpression
public ValueExpression<java.lang.String> getPropertyValueExpression(java.lang.String propertyName)
Description copied from interface:PropertyConfigurableGet the property value.- Specified by:
getPropertyValueExpressionin interfacePropertyConfigurable- Parameters:
propertyName- the property name- Returns:
- the property value
-
setPropertyValueExpression
public void setPropertyValueExpression(java.lang.String propertyName, java.lang.String expression)Description copied from interface:PropertyConfigurableSets the expression value for the property.- Specified by:
setPropertyValueExpressionin interfacePropertyConfigurable- Parameters:
propertyName- the name of the propertyexpression- the expression used to resolve the value
-
setPropertyValueExpression
public void setPropertyValueExpression(java.lang.String propertyName, java.lang.String expression, java.lang.String value)Description copied from interface:PropertyConfigurableSets the expression value for the property. This method will not parse the expression for the value and instead use thevalueparameter for the value.- Specified by:
setPropertyValueExpressionin interfacePropertyConfigurable- Parameters:
propertyName- the name of the propertyexpression- the expression used to resolve the valuevalue- the value to use
-
setPropertyValueExpression
private void setPropertyValueExpression(java.lang.String propertyName, ValueExpression<java.lang.String> expression)
-
hasProperty
public boolean hasProperty(java.lang.String propertyName)
Description copied from interface:PropertyConfigurableDetermine whether the given property name is configured.- Specified by:
hasPropertyin interfacePropertyConfigurable- Parameters:
propertyName- the property name to test- Returns:
trueif the name is configured,falseotherwise
-
removeProperty
public boolean removeProperty(java.lang.String propertyName)
Description copied from interface:PropertyConfigurableRemove a configured property. Does not affect the underlying configured value; just removes it from the configuration.- Specified by:
removePropertyin interfacePropertyConfigurable- Parameters:
propertyName- the property name- Returns:
trueif the property name was removed,falseif it was not present
-
getPropertyNames
public java.util.List<java.lang.String> getPropertyNames()
Description copied from interface:PropertyConfigurableGet the names of the configured properties in order.- Specified by:
getPropertyNamesin interfacePropertyConfigurable- Returns:
- the property names
-
hasConstructorProperty
public boolean hasConstructorProperty(java.lang.String propertyName)
Description copied from interface:PropertyConfigurableDetermine whether the given property name is a constructor property.- Specified by:
hasConstructorPropertyin interfacePropertyConfigurable- Parameters:
propertyName- the name of the property to check.- Returns:
trueif the property should be used as a construction property, otherwisefalse.
-
getActualClass
java.lang.Class<? extends T> getActualClass()
-
getConstructorProperties
public java.util.List<java.lang.String> getConstructorProperties()
Description copied from interface:PropertyConfigurableReturns a collection of the constructor properties.- Specified by:
getConstructorPropertiesin interfacePropertyConfigurable- Returns:
- a collection of the constructor properties.
-
addPostConfigurationMethod
public boolean addPostConfigurationMethod(java.lang.String methodName)
Description copied from interface:PropertyConfigurableAdds a method name to be invoked after all properties have been set.- Specified by:
addPostConfigurationMethodin interfacePropertyConfigurable- Parameters:
methodName- the name of the method- Returns:
trueif the method was successfully added, otherwisefalse
-
getPostConfigurationMethods
public java.util.List<java.lang.String> getPostConfigurationMethods()
Description copied from interface:PropertyConfigurableReturns a collection of the methods to be invoked after the properties have been set.- Specified by:
getPostConfigurationMethodsin interfacePropertyConfigurable- Returns:
- a collection of method names or an empty list
-
setPostConfigurationMethods
public void setPostConfigurationMethods(java.lang.String... methodNames)
Description copied from interface:PropertyConfigurableSets the method names to be invoked after the properties have been set.- Specified by:
setPostConfigurationMethodsin interfacePropertyConfigurable- Parameters:
methodNames- the method names to invoke
-
setPostConfigurationMethods
public void setPostConfigurationMethods(java.util.List<java.lang.String> methodNames)
Description copied from interface:PropertyConfigurableSets the method names to be invoked after the properties have been set.- Specified by:
setPostConfigurationMethodsin interfacePropertyConfigurable- Parameters:
methodNames- the method names to invoke
-
removePostConfigurationMethod
public boolean removePostConfigurationMethod(java.lang.String methodName)
Description copied from interface:PropertyConfigurableRemoves the post configuration method.- Specified by:
removePostConfigurationMethodin interfacePropertyConfigurable- Parameters:
methodName- the method to remove- Returns:
trueif the method was removed, otherwisefalse
-
addPostConfigurationActions
protected final void addPostConfigurationActions()
-
addPostConfigurationActions
private void addPostConfigurationActions(boolean replace)
-
removePostConfigurationActions
protected final java.util.Deque<?> removePostConfigurationActions()
-
getPropertyType
static java.lang.Class<?> getPropertyType(java.lang.Class<?> clazz, java.lang.String propertyName)
-
getConstructorPropertyType
static java.lang.Class<?> getConstructorPropertyType(java.lang.Class<?> clazz, java.lang.String propertyName)
-
getPropertySetter
static java.lang.reflect.Method getPropertySetter(java.lang.Class<?> clazz, java.lang.String propertyName)
-
getPropertyGetter
static java.lang.reflect.Method getPropertyGetter(java.lang.Class<?> clazz, java.lang.String propertyName)
-
-