com.holonplatform.core.beans

## Interface BeanProperty<T>

- Type Parameters:
    `T` - Property type
  All Superinterfaces:
    Expression, Localizable, Path<T>, PathExpression<T>, PathProperty<T>, Property<T>, QueryExpression<T>, QueryProjection<T>, Serializable, Validator.Validatable<T>
  All Known Subinterfaces:
    BeanProperty.Builder<T>

      public interface BeanProperty<T>
      extends PathProperty<T>

  Represents a Java Bean property as a `PathProperty`, providing additional configuration informations and methods.
  Since:
    5.0.0
  See Also:
    `BeanIntrospector`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `BeanProperty.Builder<T>` BeanProperty builder.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.property.PathProperty

      `PathProperty.PathPropertyBuilder<T>`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.property.Property

      `Property.PropertyAccessException, Property.PropertyNotFoundException, Property.PropertyReadException, Property.PropertyReadOnlyException, Property.PropertyWriteException`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.i18n.Localizable

      `Localizable.LocalizableBuilder, Localizable.LocalizationException`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Path

      `Path.FinalPath<T>, Path.PathBuilder<T>`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `Expression.ExpressionResolverFunction<E extends Expression,R extends Expression>, Expression.InvalidExpressionException`

  - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.core.Path

      `PATH_HIERARCHY_SEPARATOR`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> BeanProperty.Builder<T>` | `builder(String name, Class<T> type)` Get a builder to create a `BeanProperty`.
    `<NT> BeanProperty.Builder<NT>` | `clone(Class<NT> type)` Clone this property to obtain a property with same configuration but different type.
    `<A extends Annotation> Optional<A>` | `getAnnotation(Class<A> annotationClass)` Gets the annotation of given `annotationClass` type declared on this property, if available.
    `Optional<Field>` | `getField()` Get the field to which the bean property is bound
    `Optional<BeanProperty<?>>` | `getParentProperty()` Get the parent bean property, if any
    `Optional<Method>` | `getReadMethod()` Get the bean method to be used to read property value, if available.
    `Optional<Integer>` | `getSequence()` Get the property sequence within a property set, if configured.
    `Optional<Method>` | `getWriteMethod()` Get the bean method to be used to write property value, if available.
    `default <A extends Annotation> boolean` | `hasAnnotation(Class<A> annotationClass)` Checks whether an annotation of given `annotationClass` is present on this property.

    - ### Methods inherited from interface com.holonplatform.core.property.PathProperty

      `asc, avg, between, clone, contains, contains, containsIgnoreCase, count, create, create, desc, endsWith, endsWith, endsWithIgnoreCase, eq, eq, goe, goe, gt, gt, in, in, in, isNotNull, isNull, isReadOnly, loe, loe, lt, lt, max, min, neq, neq, nin, nin, nin, startsWith, startsWith, startsWithIgnoreCase, sum`

    - ### Methods inherited from interface com.holonplatform.core.property.Property

      `getConfiguration, getConvertedValue, getConverter, getType, present, render, renderIfAvailable`

    - ### Methods inherited from interface com.holonplatform.core.Validator.Validatable

      `getValidators, validate`

    - ### Methods inherited from interface com.holonplatform.core.i18n.Localizable

      `builder, getMessage, getMessageArguments, getMessageCode`

    - ### Methods inherited from interface com.holonplatform.core.query.PathExpression

      `from`

    - ### Methods inherited from interface com.holonplatform.core.Path

      `fullName, getName, getParent, getType, isRootPath, of, relativeName, stream`

    - ### Methods inherited from interface com.holonplatform.core.query.QueryExpression

      `getType`

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

    - ### Methods inherited from interface com.holonplatform.core.query.QueryProjection

      `getType`

- - ### Method Detail

    - #### getParentProperty

          Optional<BeanProperty<?>> getParentProperty()

      Get the parent bean property, if any
      Returns:
        Optional parent bean property

    - #### getReadMethod

          Optional<Method> getReadMethod()

      Get the bean method to be used to read property value, if available.
      Returns:
        Optional read method

    - #### getWriteMethod

          Optional<Method> getWriteMethod()

      Get the bean method to be used to write property value, if available.
      Returns:
        Optional write method

    - #### getField

          Optional<Field> getField()

      Get the field to which the bean property is bound
      Returns:
        Optional bean property field

    - #### getSequence

          Optional<Integer> getSequence()

      Get the property sequence within a property set, if configured.
      Returns:
        Optional property sequence

    - #### getAnnotation

          <A extends Annotation> Optional<A> getAnnotation(Class<A> annotationClass)

      Gets the annotation of given `annotationClass` type declared on this property, if available.

      Only annotations declared on the `Field` which corresponds to this property are taken into account, any annotation on read/write methods is ignored.

      Type Parameters:
        `A` - Annotation type
      Parameters:
        `annotationClass` - Annotation class to obtain
      Returns:
        Optional Annotation instance

    - #### hasAnnotation

          default <A extends Annotation> boolean hasAnnotation(Class<A> annotationClass)

      Checks whether an annotation of given `annotationClass` is present on this property.
      Type Parameters:
        `A` - Annotation type
      Parameters:
        `annotationClass` - Annotation class to check
      Returns:
        `true` if an annotation of given type is present on this property, `false` otherwise

    - #### clone

          <NT> BeanProperty.Builder<NT> clone(Class<NT> type)

      Clone this property to obtain a property with same configuration but different type. Because of the potential type change, any `PropertyValueConverter` or `Validator` is not inherited from the cloned property.
      Type Parameters:
        `NT` - Type of the cloned property
      Parameters:
        `type` - New property type (not null)
      Returns:
        `BeanProperty` builder for the newly created property

    - #### builder

          static <T> BeanProperty.Builder<T> builder(String name,
                                                     Class<T> type)

      Get a builder to create a `BeanProperty`.
      Type Parameters:
        `T` - Property type
      Parameters:
        `name` - Property name (not null)
        `type` - Property type (not null)
      Returns:
        BeanProperty builder

Copyright © 2017 The Holon Platform. All rights reserved.