/** * Given a domain object, return a value that can be encoded by the client. * * @param domainValue the domain object to be converted into a client-side * value * @param assignableTo the type in the client to which the resolved value * should be assignable. A value of {@code null} indicates that any * resolution will suffice. * @param propertyRefs the property references requested by the client */ public Object resolveClientValue(Object domainValue, Type assignableTo, Set<String> propertyRefs) { Resolution toReturn = resolveClientValue(domainValue, assignableTo); if (toReturn == null) { return null; } addPathsToResolution(toReturn, "", expandPropertyRefs(propertyRefs)); while (!toProcess.isEmpty()) { List<Resolution> working = new ArrayList<Resolution>(toProcess); toProcess.clear(); for (Resolution resolution : working) { if (resolution.hasWork()) { AutoBean<BaseProxy> bean = AutoBeanUtils.getAutoBean((BaseProxy) resolution.getClientObject()); bean.accept(new PropertyResolver(resolution)); } } } return toReturn.getClientObject(); }
/** * Given a domain object, return a value that can be encoded by the client. * * @param domainValue the domain object to be converted into a client-side * value * @param assignableTo the type in the client to which the resolved value * should be assignable. A value of {@code null} indicates that any * resolution will suffice. * @param propertyRefs the property references requested by the client */ public Object resolveClientValue(Object domainValue, Type assignableTo, Set<String> propertyRefs) { Resolution toReturn = resolveClientValue(domainValue, assignableTo); if (toReturn == null) { return null; } addPathsToResolution(toReturn, "", expandPropertyRefs(propertyRefs)); while (!toProcess.isEmpty()) { List<Resolution> working = new ArrayList<Resolution>(toProcess); toProcess.clear(); for (Resolution resolution : working) { if (resolution.hasWork()) { AutoBean<BaseProxy> bean = AutoBeanUtils.getAutoBean((BaseProxy) resolution.getClientObject()); bean.accept(new PropertyResolver(resolution)); } } } return toReturn.getClientObject(); }
/** * Given a domain object, return a value that can be encoded by the client. * * @param domainValue the domain object to be converted into a client-side * value * @param assignableTo the type in the client to which the resolved value * should be assignable. A value of {@code null} indicates that any * resolution will suffice. * @param propertyRefs the property references requested by the client */ public Object resolveClientValue(Object domainValue, Type assignableTo, Set<String> propertyRefs) { Resolution toReturn = resolveClientValue(domainValue, assignableTo); if (toReturn == null) { return null; } addPathsToResolution(toReturn, "", expandPropertyRefs(propertyRefs)); while (!toProcess.isEmpty()) { List<Resolution> working = new ArrayList<Resolution>(toProcess); toProcess.clear(); for (Resolution resolution : working) { if (resolution.hasWork()) { AutoBean<BaseProxy> bean = AutoBeanUtils.getAutoBean((BaseProxy) resolution.getClientObject()); bean.accept(new PropertyResolver(resolution)); } } } return toReturn.getClientObject(); }
/** * Given a domain object, return a value that can be encoded by the client. * * @param domainValue the domain object to be converted into a client-side * value * @param assignableTo the type in the client to which the resolved value * should be assignable. A value of {@code null} indicates that any * resolution will suffice. * @param propertyRefs the property references requested by the client */ public Object resolveClientValue(Object domainValue, Type assignableTo, Set<String> propertyRefs) { Resolution toReturn = resolveClientValue(domainValue, assignableTo); if (toReturn == null) { return null; } addPathsToResolution(toReturn, "", expandPropertyRefs(propertyRefs)); while (!toProcess.isEmpty()) { List<Resolution> working = new ArrayList<Resolution>(toProcess); toProcess.clear(); for (Resolution resolution : working) { if (resolution.hasWork()) { AutoBean<BaseProxy> bean = AutoBeanUtils.getAutoBean((BaseProxy) resolution.getClientObject()); bean.accept(new PropertyResolver(resolution)); } } } return toReturn.getClientObject(); }