org.springframework.beans

Class BeanMetadataAttributeAccessor

    • Constructor Detail

      • BeanMetadataAttributeAccessor

        public BeanMetadataAttributeAccessor()
    • Method Detail

      • setSource

        public void setSource(@Nullable
                              java.lang.Object source)
        Set the configuration source Object for this metadata element.

        The exact type of the object will depend on the configuration mechanism used.

      • addMetadataAttribute

        public void addMetadataAttribute(BeanMetadataAttribute attribute)
        Add the given BeanMetadataAttribute to this accessor's set of attributes.
        Parameters:
        attribute - the BeanMetadataAttribute object to register
      • getMetadataAttribute

        @Nullable
        public BeanMetadataAttribute getMetadataAttribute(java.lang.String name)
        Look up the given BeanMetadataAttribute in this accessor's set of attributes.
        Parameters:
        name - the name of the attribute
        Returns:
        the corresponding BeanMetadataAttribute object, or null if no such attribute defined
      • setAttribute

        public void setAttribute(java.lang.String name,
                                 @Nullable
                                 java.lang.Object value)
        Description copied from interface: AttributeAccessor
        Set the attribute defined by name to the supplied value. If value is null, the attribute is removed.

        In general, users should take care to prevent overlaps with other metadata attributes by using fully-qualified names, perhaps using class or package names as prefix.

        Specified by:
        setAttribute in interface AttributeAccessor
        Overrides:
        setAttribute in class AttributeAccessorSupport
        Parameters:
        name - the unique attribute key
        value - the attribute value to be attached