Class AbstractFieldBuilder.DefaultInfo

java.lang.Object
org.dellroad.stuff.vaadin24.field.AbstractFieldBuilder.DefaultInfo
Enclosing class:
AbstractFieldBuilder<S extends AbstractFieldBuilder<S,T>,T>

public static class AbstractFieldBuilder.DefaultInfo extends Object
Holds static information gathered from scanning @FieldBuilder.FieldDefault annotations.

Instances are immutable.

  • Constructor Details

    • DefaultInfo

      public DefaultInfo(Method method, String propertyName)
      Constructor.
      Parameters:
      method - the annotated method that provides the alternate default value
      propertyName - the name of the field property provided by method
      Throws:
      IllegalArgumentException - if either parameter is null
  • Method Details

    • getMethod

      public Method getMethod()
      Get the annotated method that provides the alternate default value.
      Returns:
      default providing method
    • getPropertyName

      public String getPropertyName()
      Get the name of the field property provided.
      Returns:
      provided property name
    • applyTo

      public boolean applyTo(HasValue<?,?> field)
      Apply the alternate default value to the configured property in the given field, if possible.
      Parameters:
      field - field to update
      Returns:
      true if successful, false if no such setter method exists, value is incompatible, etc.
      Throws:
      IllegalArgumentException - if field is null
    • toString

      public String toString()
      Overrides:
      toString in class Object