Преглед на файлове

Use an informative exception message when Binder is incorrectly constructed (#8631)

tags/8.1.0.alpha1
Artur преди 7 години
родител
ревизия
a720d998f5
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4
    2
      server/src/main/java/com/vaadin/data/Binder.java

+ 4
- 2
server/src/main/java/com/vaadin/data/Binder.java Целия файл

@@ -1110,14 +1110,16 @@ public class Binder<BEAN> implements Serializable {
@Override
public Stream<PropertyDefinition<BEAN, ?>> getProperties() {
throw new IllegalStateException(
"A Binder created with the default constructor doesn't support listing properties.");
"This Binder instance was created using the default constructor. "
+ "To be able to use property names and bind to instance fields, create the binder using the Binder(Class<BEAN> beanType) constructor instead.");
}

@Override
public Optional<PropertyDefinition<BEAN, ?>> getProperty(
String name) {
throw new IllegalStateException(
"A Binder created with the default constructor doesn't support finding properties by name.");
"This Binder instance was created using the default constructor. "
+ "To be able to use property names and bind to instance fields, create the binder using the Binder(Class<BEAN> beanType) constructor instead.");
}
});
}

Loading…
Отказ
Запис