@Override
public boolean visitReferenceProperty(String propertyName, AutoBean<?> value,
PropertyContext ctx) {
if (ctx.canSet()) {
if (properties.containsKey(propertyName)) {
Splittable raw = properties.get(propertyName);
Object decoded = null;
if (ctx.getType() == Map.class) {
MapPropertyContext mapCtx = (MapPropertyContext) ctx;
Class<?> keyType = mapCtx.getKeyType();
Class<?> valueType = mapCtx.getValueType();
decoded =
EntityCodex.decode(AbstractRequestContext.this, mapCtx.getType(), keyType,
valueType, raw);
} else {
Class<?> elementType =
ctx instanceof CollectionPropertyContext ? ((CollectionPropertyContext) ctx)
.getElementType() : null;
decoded =
EntityCodex.decode(AbstractRequestContext.this, ctx.getType(), elementType, raw);
}
ctx.set(decoded);
}
}
return false;
}
@Override
public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) {
if (ctx.canSet()) {
if (properties.containsKey(propertyName)) {
Splittable raw = properties.get(propertyName);
Object decoded = ValueCodex.decode(ctx.getType(), raw);
/*
* Hack for Date subtypes, consider generalizing for "custom serializers"
*/
if (decoded != null && Date.class.equals(ctx.getType())) {