Class AbstractPropertyConfiguration<T,​C extends AbstractPropertyConfiguration<T,​C>>

    • 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

      • getDescription

        abstract java.lang.String getDescription()
      • getModuleName

        public java.lang.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 java.lang.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​(java.lang.Object[] array,
                                java.lang.Object val)
      • setPropertyValueString

        public void setPropertyValueString​(java.lang.String propertyName,
                                           java.lang.String value)
                                    throws java.lang.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:
        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: 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
      • setPropertyValueExpression

        public void setPropertyValueExpression​(java.lang.String propertyName,
                                               java.lang.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​(java.lang.String propertyName,
                                               java.lang.String expression,
                                               java.lang.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​(java.lang.String propertyName,
                                                ValueExpression<java.lang.String> expression)
      • hasProperty

        public boolean hasProperty​(java.lang.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​(java.lang.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 java.util.List<java.lang.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​(java.lang.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

        java.lang.Class<? extends T> getActualClass()
      • getConstructorProperties

        public java.util.List<java.lang.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​(java.lang.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 java.util.List<java.lang.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​(java.lang.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​(java.util.List<java.lang.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​(java.lang.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 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)