/** * Handles instance invocations as the instance at the 0th parameter. */ private List<Object> decodeInvocationArguments(RequestState source, List<Splittable> parameters, Class<?>[] contextArgs, Type[] genericArgs) { if (parameters == null) { // Can't return Collections.emptyList() because this must be mutable return new ArrayList<Object>(); } assert parameters.size() == contextArgs.length; List<Object> args = new ArrayList<Object>(contextArgs.length); for (int i = 0, j = contextArgs.length; i < j; i++) { Class<?> type = contextArgs[i]; Class<?> elementType = null; Splittable split; if (Collection.class.isAssignableFrom(type)) { elementType = TypeUtils.ensureBaseType(TypeUtils.getSingleParameterization(Collection.class, genericArgs[i])); split = parameters.get(i); } else { split = parameters.get(i); } Object arg = EntityCodex.decode(source, type, elementType, split); arg = source.getResolver().resolveDomainValue(arg, !EntityProxyId.class.equals(contextArgs[i])); args.add(arg); } return args; }
@Override public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) { if (flatValueMap.containsKey(propertyName)) { Splittable split = flatValueMap.get(propertyName); Object newValue = ValueCodex.decode(ctx.getType(), split); Object resolved = state.getResolver().resolveDomainValue(newValue, false); service.setProperty(domain, propertyName, ctx.getType(), resolved); } return false; } });
accumulator.add(resolveDomainValue(o, detectDeadEntities)); for (Entry<?, ?> entry : ((Map<?, ?>) maybeEntityProxy).entrySet()) { accumulator.put( resolveDomainValue(entry.getKey(), detectDeadEntities), resolveDomainValue(entry.getValue(), detectDeadEntities));
@Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value, PropertyContext ctx) { // containsKey to distinguish null from unknown if (flatValueMap.containsKey(propertyName)) { Object resolved = null; // The null check on getKeyType() is necessary as some of the given PropertyContext's // implement both MapPropertyContext and CollectionPropertyContext. if (ctx.getType() == Map.class) { MapPropertyContext mapCtx = (MapPropertyContext) ctx; Class<?> keyType = mapCtx.getKeyType(); Class<?> valueType = mapCtx.getValueType(); Object newValue = EntityCodex.decode(state, mapCtx.getType(), keyType, valueType, flatValueMap.get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } else { Class<?> elementType = ctx instanceof CollectionPropertyContext ? ((CollectionPropertyContext) ctx) .getElementType() : null; Object newValue = EntityCodex.decode(state, ctx.getType(), elementType, flatValueMap .get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } service.setProperty(domain, propertyName, service.resolveDomainClass(ctx.getType()), resolved); } return false; }
accumulator.add(resolveDomainValue(o, detectDeadEntities)); for (Entry<?, ?> entry : ((Map<?, ?>) maybeEntityProxy).entrySet()) { accumulator.put( resolveDomainValue(entry.getKey(), detectDeadEntities), resolveDomainValue(entry.getValue(), detectDeadEntities));
/** * Handles instance invocations as the instance at the 0th parameter. */ private List<Object> decodeInvocationArguments(RequestState source, List<Splittable> parameters, Class<?>[] contextArgs, Type[] genericArgs) { if (parameters == null) { // Can't return Collections.emptyList() because this must be mutable return new ArrayList<Object>(); } assert parameters.size() == contextArgs.length; List<Object> args = new ArrayList<Object>(contextArgs.length); for (int i = 0, j = contextArgs.length; i < j; i++) { Class<?> type = contextArgs[i]; Class<?> elementType = null; Splittable split; if (Collection.class.isAssignableFrom(type)) { elementType = TypeUtils.ensureBaseType(TypeUtils.getSingleParameterization(Collection.class, genericArgs[i])); split = parameters.get(i); } else { split = parameters.get(i); } Object arg = EntityCodex.decode(source, type, elementType, split); arg = source.getResolver().resolveDomainValue(arg, !EntityProxyId.class.equals(contextArgs[i])); args.add(arg); } return args; }
accumulator.add(resolveDomainValue(o, detectDeadEntities)); for (Entry<?, ?> entry : ((Map<?, ?>) maybeEntityProxy).entrySet()) { accumulator.put( resolveDomainValue(entry.getKey(), detectDeadEntities), resolveDomainValue(entry.getValue(), detectDeadEntities));
@Override public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) { if (flatValueMap.containsKey(propertyName)) { Splittable split = flatValueMap.get(propertyName); Object newValue = ValueCodex.decode(ctx.getType(), split); Object resolved = state.getResolver().resolveDomainValue(newValue, false); service.setProperty(domain, propertyName, ctx.getType(), resolved); } return false; } });
/** * Handles instance invocations as the instance at the 0th parameter. */ private List<Object> decodeInvocationArguments(RequestState source, List<Splittable> parameters, Class<?>[] contextArgs, Type[] genericArgs) { if (parameters == null) { // Can't return Collections.emptyList() because this must be mutable return new ArrayList<Object>(); } assert parameters.size() == contextArgs.length; List<Object> args = new ArrayList<Object>(contextArgs.length); for (int i = 0, j = contextArgs.length; i < j; i++) { Class<?> type = contextArgs[i]; Class<?> elementType = null; Splittable split; if (Collection.class.isAssignableFrom(type)) { elementType = TypeUtils.ensureBaseType(TypeUtils.getSingleParameterization(Collection.class, genericArgs[i])); split = parameters.get(i); } else { split = parameters.get(i); } Object arg = EntityCodex.decode(source, type, elementType, split); arg = source.getResolver().resolveDomainValue(arg, !EntityProxyId.class.equals(contextArgs[i])); args.add(arg); } return args; }
/** * Handles instance invocations as the instance at the 0th parameter. */ private List<Object> decodeInvocationArguments(RequestState source, List<Splittable> parameters, Class<?>[] contextArgs, Type[] genericArgs) { if (parameters == null) { // Can't return Collections.emptyList() because this must be mutable return new ArrayList<Object>(); } assert parameters.size() == contextArgs.length; List<Object> args = new ArrayList<Object>(contextArgs.length); for (int i = 0, j = contextArgs.length; i < j; i++) { Class<?> type = contextArgs[i]; Class<?> elementType = null; Splittable split; if (Collection.class.isAssignableFrom(type)) { elementType = TypeUtils.ensureBaseType(TypeUtils.getSingleParameterization(Collection.class, genericArgs[i])); split = parameters.get(i); } else { split = parameters.get(i); } Object arg = EntityCodex.decode(source, type, elementType, split); arg = source.getResolver().resolveDomainValue(arg, !EntityProxyId.class.equals(contextArgs[i])); args.add(arg); } return args; }
@Override public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) { if (flatValueMap.containsKey(propertyName)) { Splittable split = flatValueMap.get(propertyName); Object newValue = ValueCodex.decode(ctx.getType(), split); Object resolved = state.getResolver().resolveDomainValue(newValue, false); service.setProperty(domain, propertyName, ctx.getType(), resolved); } return false; } });
accumulator.add(resolveDomainValue(o, detectDeadEntities)); for (Entry<?, ?> entry : ((Map<?, ?>) maybeEntityProxy).entrySet()) { accumulator.put( resolveDomainValue(entry.getKey(), detectDeadEntities), resolveDomainValue(entry.getValue(), detectDeadEntities));
@Override public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) { if (flatValueMap.containsKey(propertyName)) { Splittable split = flatValueMap.get(propertyName); Object newValue = ValueCodex.decode(ctx.getType(), split); Object resolved = state.getResolver().resolveDomainValue(newValue, false); service.setProperty(domain, propertyName, ctx.getType(), resolved); } return false; } });
@Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value, PropertyContext ctx) { // containsKey to distinguish null from unknown if (flatValueMap.containsKey(propertyName)) { Object resolved = null; // The null check on getKeyType() is necessary as some of the given PropertyContext's // implement both MapPropertyContext and CollectionPropertyContext. if (ctx.getType() == Map.class) { MapPropertyContext mapCtx = (MapPropertyContext) ctx; Class<?> keyType = mapCtx.getKeyType(); Class<?> valueType = mapCtx.getValueType(); Object newValue = EntityCodex.decode(state, mapCtx.getType(), keyType, valueType, flatValueMap.get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } else { Class<?> elementType = ctx instanceof CollectionPropertyContext ? ((CollectionPropertyContext) ctx) .getElementType() : null; Object newValue = EntityCodex.decode(state, ctx.getType(), elementType, flatValueMap .get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } service.setProperty(domain, propertyName, service.resolveDomainClass(ctx.getType()), resolved); } return false; }
@Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value, PropertyContext ctx) { // containsKey to distinguish null from unknown if (flatValueMap.containsKey(propertyName)) { Object resolved = null; // The null check on getKeyType() is necessary as some of the given PropertyContext's // implement both MapPropertyContext and CollectionPropertyContext. if (ctx.getType() == Map.class) { MapPropertyContext mapCtx = (MapPropertyContext) ctx; Class<?> keyType = mapCtx.getKeyType(); Class<?> valueType = mapCtx.getValueType(); Object newValue = EntityCodex.decode(state, mapCtx.getType(), keyType, valueType, flatValueMap.get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } else { Class<?> elementType = ctx instanceof CollectionPropertyContext ? ((CollectionPropertyContext) ctx) .getElementType() : null; Object newValue = EntityCodex.decode(state, ctx.getType(), elementType, flatValueMap .get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } service.setProperty(domain, propertyName, service.resolveDomainClass(ctx.getType()), resolved); } return false; }
@Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value, PropertyContext ctx) { // containsKey to distinguish null from unknown if (flatValueMap.containsKey(propertyName)) { Object resolved = null; // The null check on getKeyType() is necessary as some of the given PropertyContext's // implement both MapPropertyContext and CollectionPropertyContext. if (ctx.getType() == Map.class) { MapPropertyContext mapCtx = (MapPropertyContext) ctx; Class<?> keyType = mapCtx.getKeyType(); Class<?> valueType = mapCtx.getValueType(); Object newValue = EntityCodex.decode(state, mapCtx.getType(), keyType, valueType, flatValueMap.get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } else { Class<?> elementType = ctx instanceof CollectionPropertyContext ? ((CollectionPropertyContext) ctx) .getElementType() : null; Object newValue = EntityCodex.decode(state, ctx.getType(), elementType, flatValueMap .get(propertyName)); resolved = state.getResolver().resolveDomainValue(newValue, false); } service.setProperty(domain, propertyName, service.resolveDomainClass(ctx.getType()), resolved); } return false; }