You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BinderPropertyDefinition.java 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.data;
  17. import java.io.Serializable;
  18. import java.util.Optional;
  19. import com.vaadin.data.Binder.BindingBuilder;
  20. import com.vaadin.server.Setter;
  21. /**
  22. * A property from a {@link BinderPropertySet}.
  23. *
  24. * @author Vaadin Ltd
  25. * @since
  26. *
  27. * @param <T>
  28. * the type of the binder property set
  29. * @param <V>
  30. * the property type
  31. */
  32. public interface BinderPropertyDefinition<T, V> extends Serializable {
  33. /**
  34. * Gets the value provider that is used for finding the value of this
  35. * property for a bean.
  36. *
  37. * @return the getter, not <code>null</code>
  38. */
  39. public ValueProvider<T, V> getGetter();
  40. /**
  41. * Gets an optional setter for storing a property value in a bean.
  42. *
  43. * @return the setter, or an empty optional if this property is read-only
  44. */
  45. public Optional<Setter<T, V>> getSetter();
  46. /**
  47. * Gets the type of this property.
  48. *
  49. * @return the property type. not <code>null</code>
  50. */
  51. public Class<V> getType();
  52. /**
  53. * Hook for modifying a binding before it is being bound to this property.
  54. * This method can return the provided {@link BindingBuilder} as-is if no
  55. * modifications are necessary.
  56. *
  57. * @param originalBuilder
  58. * the original binding builder that is being bound, not
  59. * <code>null</code>
  60. * @return the binding builder to use for creating the binding, not
  61. * <code>null</code>
  62. */
  63. public BindingBuilder<T, V> beforeBind(
  64. BindingBuilder<T, V> originalBuilder);
  65. /**
  66. * Gets the name of this property.
  67. *
  68. * @return the property name, not <code>null</code>
  69. */
  70. public String getName();
  71. /**
  72. * Gets the {@link BinderPropertySet} that this property belongs to.
  73. *
  74. * @return the binder property set, not <code>null</code>
  75. */
  76. public BinderPropertySet<T> getPropertySet();
  77. }