|
|
@ -127,27 +127,25 @@ class JavaBeanBinder implements BeanBinder {
|
|
|
|
int parameterCount = method.getParameterCount();
|
|
|
|
int parameterCount = method.getParameterCount();
|
|
|
|
if (name.startsWith("get") && parameterCount == 0) {
|
|
|
|
if (name.startsWith("get") && parameterCount == 0) {
|
|
|
|
name = Introspector.decapitalize(name.substring(3));
|
|
|
|
name = Introspector.decapitalize(name.substring(3));
|
|
|
|
this.properties
|
|
|
|
this.properties.computeIfAbsent(name, this::getBeanProperty)
|
|
|
|
.computeIfAbsent(name,
|
|
|
|
|
|
|
|
(n) -> new BeanProperty(n, this.resolvableType))
|
|
|
|
|
|
|
|
.addGetter(method);
|
|
|
|
.addGetter(method);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (name.startsWith("is") && parameterCount == 0) {
|
|
|
|
else if (name.startsWith("is") && parameterCount == 0) {
|
|
|
|
name = Introspector.decapitalize(name.substring(2));
|
|
|
|
name = Introspector.decapitalize(name.substring(2));
|
|
|
|
this.properties
|
|
|
|
this.properties.computeIfAbsent(name, this::getBeanProperty)
|
|
|
|
.computeIfAbsent(name,
|
|
|
|
|
|
|
|
(n) -> new BeanProperty(n, this.resolvableType))
|
|
|
|
|
|
|
|
.addGetter(method);
|
|
|
|
.addGetter(method);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (name.startsWith("set") && parameterCount == 1) {
|
|
|
|
else if (name.startsWith("set") && parameterCount == 1) {
|
|
|
|
name = Introspector.decapitalize(name.substring(3));
|
|
|
|
name = Introspector.decapitalize(name.substring(3));
|
|
|
|
this.properties
|
|
|
|
this.properties.computeIfAbsent(name, this::getBeanProperty)
|
|
|
|
.computeIfAbsent(name,
|
|
|
|
|
|
|
|
(n) -> new BeanProperty(n, this.resolvableType))
|
|
|
|
|
|
|
|
.addSetter(method);
|
|
|
|
.addSetter(method);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private BeanProperty getBeanProperty(String name) {
|
|
|
|
|
|
|
|
return new BeanProperty(name, this.resolvableType);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void addField(Field field) {
|
|
|
|
private void addField(Field field) {
|
|
|
|
BeanProperty property = this.properties.get(field.getName());
|
|
|
|
BeanProperty property = this.properties.get(field.getName());
|
|
|
|
if (property != null) {
|
|
|
|
if (property != null) {
|
|
|
|