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
  • Field Details

    • actualClass

      private final Class<? extends T> actualClass
    • moduleName

      private final String moduleName
    • className

      private final String className
    • constructorProperties

      private final String[] constructorProperties
    • properties

      private final Map<String,ValueExpression<String>> properties
    • postConfigurationMethods

      private final Map<String,Method> postConfigurationMethods
  • Constructor Details

  • Method Details

    • getConstructAction

      ConfigAction<T> getConstructAction()
    • getDescription

      abstract String getDescription()
    • getModuleName

      public String getModuleName()
      Description copied from interface: ObjectConfigurable
      Get the module name for this object's configuration, if any. If JBoss Modules is not present on the class path, only null values are accepted.
      Specified by:
      getModuleName in interface ObjectConfigurable
      Returns:
      the module name, or null if none is configured
    • getClassName

      public String getClassName()
      Description copied from interface: ObjectConfigurable
      Get the class name for this object's configuration.
      Specified by:
      getClassName in interface ObjectConfigurable
      Returns:
      the class name
    • contains

      static boolean contains(Object[] array, Object val)
    • setPropertyValueString

      public void setPropertyValueString(String propertyName, String value) throws IllegalArgumentException
      Description copied from interface: PropertyConfigurable
      Set a property value from a string.
      Specified by:
      setPropertyValueString in interface PropertyConfigurable
      Parameters:
      propertyName - the property name
      value - the property value
      Throws:
      IllegalArgumentException - if the given value is not acceptable for this property
    • getPropertyValueString

      public String getPropertyValueString(String propertyName)
      Description copied from interface: PropertyConfigurable
      Get the string property value with the given name.
      Specified by:
      getPropertyValueString in interface PropertyConfigurable
      Parameters:
      propertyName - the property name
      Returns:
      the property value string
    • getPropertyValueExpression

      public ValueExpression<String> getPropertyValueExpression(String propertyName)
      Description copied from interface: PropertyConfigurable
      Get the property value.
      Specified by:
      getPropertyValueExpression in interface PropertyConfigurable
      Parameters:
      propertyName - the property name
      Returns:
      the property value
    • setPropertyValueExpression

      public void setPropertyValueExpression(String propertyName, String expression)
      Description copied from interface: PropertyConfigurable
      Sets the expression value for the property.
      Specified by:
      setPropertyValueExpression in interface PropertyConfigurable
      Parameters:
      propertyName - the name of the property
      expression - the expression used to resolve the value
    • setPropertyValueExpression

      public void setPropertyValueExpression(String propertyName, String expression, String value)
      Description copied from interface: PropertyConfigurable
      Sets the expression value for the property.

      This method will not parse the expression for the value and instead use the value parameter for the value.

      Specified by:
      setPropertyValueExpression in interface PropertyConfigurable
      Parameters:
      propertyName - the name of the property
      expression - the expression used to resolve the value
      value - the value to use
    • setPropertyValueExpression

      private void setPropertyValueExpression(String propertyName, ValueExpression<String> expression)
    • hasProperty

      public boolean hasProperty(String propertyName)
      Description copied from interface: PropertyConfigurable
      Determine whether the given property name is configured.
      Specified by:
      hasProperty in interface PropertyConfigurable
      Parameters:
      propertyName - the property name to test
      Returns:
      true if the name is configured, false otherwise
    • removeProperty

      public boolean removeProperty(String propertyName)
      Description copied from interface: PropertyConfigurable
      Remove a configured property. Does not affect the underlying configured value; just removes it from the configuration.
      Specified by:
      removeProperty in interface PropertyConfigurable
      Parameters:
      propertyName - the property name
      Returns:
      true if the property name was removed, false if it was not present
    • getPropertyNames

      public List<String> getPropertyNames()
      Description copied from interface: PropertyConfigurable
      Get the names of the configured properties in order.
      Specified by:
      getPropertyNames in interface PropertyConfigurable
      Returns:
      the property names
    • hasConstructorProperty

      public boolean hasConstructorProperty(String propertyName)
      Description copied from interface: PropertyConfigurable
      Determine whether the given property name is a constructor property.
      Specified by:
      hasConstructorProperty in interface PropertyConfigurable
      Parameters:
      propertyName - the name of the property to check.
      Returns:
      true if the property should be used as a construction property, otherwise false.
    • getActualClass

      Class<? extends T> getActualClass()
    • getConstructorProperties

      public List<String> getConstructorProperties()
      Description copied from interface: PropertyConfigurable
      Returns a collection of the constructor properties.
      Specified by:
      getConstructorProperties in interface PropertyConfigurable
      Returns:
      a collection of the constructor properties.
    • addPostConfigurationMethod

      public boolean addPostConfigurationMethod(String methodName)
      Description copied from interface: PropertyConfigurable
      Adds a method name to be invoked after all properties have been set.
      Specified by:
      addPostConfigurationMethod in interface PropertyConfigurable
      Parameters:
      methodName - the name of the method
      Returns:
      true if the method was successfully added, otherwise false
    • getPostConfigurationMethods

      public List<String> getPostConfigurationMethods()
      Description copied from interface: PropertyConfigurable
      Returns a collection of the methods to be invoked after the properties have been set.
      Specified by:
      getPostConfigurationMethods in interface PropertyConfigurable
      Returns:
      a collection of method names or an empty list
    • setPostConfigurationMethods

      public void setPostConfigurationMethods(String... methodNames)
      Description copied from interface: PropertyConfigurable
      Sets the method names to be invoked after the properties have been set.
      Specified by:
      setPostConfigurationMethods in interface PropertyConfigurable
      Parameters:
      methodNames - the method names to invoke
    • setPostConfigurationMethods

      public void setPostConfigurationMethods(List<String> methodNames)
      Description copied from interface: PropertyConfigurable
      Sets the method names to be invoked after the properties have been set.
      Specified by:
      setPostConfigurationMethods in interface PropertyConfigurable
      Parameters:
      methodNames - the method names to invoke
    • removePostConfigurationMethod

      public boolean removePostConfigurationMethod(String methodName)
      Description copied from interface: PropertyConfigurable
      Removes the post configuration method.
      Specified by:
      removePostConfigurationMethod in interface PropertyConfigurable
      Parameters:
      methodName - the method to remove
      Returns:
      true if the method was removed, otherwise false
    • addPostConfigurationActions

      protected final void addPostConfigurationActions()
    • addPostConfigurationActions

      private void addPostConfigurationActions(boolean replace)
    • removePostConfigurationActions

      protected final Deque<?> removePostConfigurationActions()
    • getPropertyType

      static Class<?> getPropertyType(Class<?> clazz, String propertyName)
    • getConstructorPropertyType

      static Class<?> getConstructorPropertyType(Class<?> clazz, String propertyName)
    • getPropertySetter

      static Method getPropertySetter(Class<?> clazz, String propertyName)
    • getPropertyGetter

      static Method getPropertyGetter(Class<?> clazz, String propertyName)