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.

PropertyDefinition.java 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.server.Setter;
  20. /**
  21. * A property from a {@link PropertySet}.
  22. *
  23. * @author Vaadin Ltd
  24. * @since
  25. *
  26. * @param <T>
  27. * the type of the property set
  28. * @param <V>
  29. * the property type
  30. */
  31. public interface PropertyDefinition<T, V> extends Serializable {
  32. /**
  33. * Gets the value provider that is used for finding the value of this
  34. * property for a bean.
  35. *
  36. * @return the getter, not <code>null</code>
  37. */
  38. public ValueProvider<T, V> getGetter();
  39. /**
  40. * Gets an optional setter for storing a property value in a bean.
  41. *
  42. * @return the setter, or an empty optional if this property is read-only
  43. */
  44. public Optional<Setter<T, V>> getSetter();
  45. /**
  46. * Gets the type of this property.
  47. *
  48. * @return the property type. not <code>null</code>
  49. */
  50. public Class<V> getType();
  51. /**
  52. * Gets the name of this property.
  53. *
  54. * @return the property name, not <code>null</code>
  55. */
  56. public String getName();
  57. /**
  58. * Gets the human readable caption to show for this property.
  59. *
  60. * @return the caption to show, not <code>null</code>
  61. */
  62. public String getCaption();
  63. /**
  64. * Gets the {@link PropertySet} that this property belongs to.
  65. *
  66. * @return the property set, not <code>null</code>
  67. */
  68. public PropertySet<T> getPropertySet();
  69. }