Interface DynamicMetaBean

  • All Superinterfaces:
    MetaBean

    public interface DynamicMetaBean
    extends MetaBean
    A dynamic meta-bean which works with DynamicBean.

    A dynamic bean can have properties added or removed at any time. As such, there is a different meta-bean for each dynamic bean. The meta-bean allows meta-properties to be created on demand.

    • Method Detail

      • builder

        BeanBuilder<? extends DynamicBean> builder()
        Creates a bean builder that can be used to create an instance of this bean.

        All properties added to the builder will be created and appear in the result.

        Specified by:
        builder in interface MetaBean
        Returns:
        the bean builder, not null
        Throws:
        UnsupportedOperationException - if the bean cannot be created
      • beanType

        Class<? extends DynamicBean> beanType()
        Get the type of the bean represented as a Class.
        Specified by:
        beanType in interface MetaBean
        Returns:
        the type of the bean, not null
      • metaProperty

        <R> MetaProperty<R> metaProperty​(String propertyName)
        Gets a meta-property by name.

        This will not throw an exception if the meta-property name does not exist. Whether a meta-property is immediately created or not is implementation dependent.

        Specified by:
        metaProperty in interface MetaBean
        Type Parameters:
        R - the property type, optional, enabling auto-casting
        Parameters:
        propertyName - the property name to retrieve, not null
        Returns:
        the meta property, not null
      • metaPropertyDefine

        void metaPropertyDefine​(String propertyName,
                                Class<?> propertyType)
        Defines a property for the bean.

        Some implementations will automatically add properties, in which case this method will have no effect.

        Parameters:
        propertyName - the property name to check, not empty, not null
        propertyType - the property type, not null
      • metaPropertyRemove

        void metaPropertyRemove​(String propertyName)
        Removes a property by name.
        Parameters:
        propertyName - the property name to remove, null ignored