Interface DynamicMetaBean

  • All Superinterfaces:

    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
        the bean builder, not null
        java.lang.UnsupportedOperationException - if the bean cannot be created
      • beanType

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

        <R> MetaProperty<R> metaProperty​(java.lang.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
        propertyName - the property name to retrieve, not null
        the meta property, not null
      • metaPropertyDefine

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

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

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

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