public void decodeInto(EncodeState state, Splittable data, AutoBean<?> bean) { this.data = data; this.state = state; bean.accept(this); }
/** * Returns a map that is a copy of the properties contained in an AutoBean. * The returned map is mutable, but editing it will not have any effect on the * bean that produced it. * * @param bean an {@link AutoBean} * @return a {@link Map} of the bean's properties */ public static Map<String, Object> getAllProperties(AutoBean<?> bean) { final Map<String, Object> toReturn = new LinkedHashMap<String, Object>(); // Look at the previous value of all properties bean.accept(new AutoBeanVisitor() { @Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value, PropertyContext ctx) { toReturn.put(propertyName, value == null ? null : value.as()); return false; } @Override public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) { toReturn.put(propertyName, value); return false; } }); return toReturn; }
public static Coder doCoderFor(AutoBean<?> bean, String propertyName) { synchronized (coderFor) { String key = key(bean, propertyName); Coder toReturn = coderFor.get(key); if (toReturn == null) { bean.accept(new PropertyCoderCreator()); toReturn = coderFor.get(key); if (toReturn == null) { throw new IllegalArgumentException(propertyName); } } return toReturn; } }
public static void doEncode(EncodeState state, AutoBean<?> bean) { PropertyGetter e = new PropertyGetter(state); try { bean.accept(e); } catch (HaltException ex) { throw ex.getCause(); } }
a.accept(new AutoBeanVisitor() { @Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> previousValue,
bean.accept(new AutoBeanVisitor() { @Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value,
/** * 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(); }
serialized.put(id, root); serializeOneProxy(id, root); root.accept(new AutoBeanVisitor() { @Override public void endVisit(AutoBean<?> bean, Context ctx) {
public void decodeInto(EncodeState state, Splittable data, AutoBean<?> bean) { this.data = data; this.state = state; bean.accept(this); }
public void decodeInto(EncodeState state, Splittable data, AutoBean<?> bean) { this.data = data; this.state = state; bean.accept(this); }
public void decodeInto(EncodeState state, Splittable data, AutoBean<?> bean) { this.data = data; this.state = state; bean.accept(this); }
clone.accept(new AutoBeanVisitor() { final Map<String, Object> values = AutoBeanUtils.getAllProperties(toClone);
/** * Returns a map that is a copy of the properties contained in an AutoBean. * The returned map is mutable, but editing it will not have any effect on the * bean that produced it. * * @param bean an {@link AutoBean} * @return a {@link Map} of the bean's properties */ public static Map<String, Object> getAllProperties(AutoBean<?> bean) { final Map<String, Object> toReturn = new LinkedHashMap<String, Object>(); // Look at the previous value of all properties bean.accept(new AutoBeanVisitor() { @Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value, PropertyContext ctx) { toReturn.put(propertyName, value == null ? null : value.as()); return false; } @Override public boolean visitValueProperty(String propertyName, Object value, PropertyContext ctx) { toReturn.put(propertyName, value); return false; } }); return toReturn; }
public static Coder doCoderFor(AutoBean<?> bean, String propertyName) { synchronized (coderFor) { String key = key(bean, propertyName); Coder toReturn = coderFor.get(key); if (toReturn == null) { bean.accept(new PropertyCoderCreator()); toReturn = coderFor.get(key); if (toReturn == null) { throw new IllegalArgumentException(propertyName); } } return toReturn; } }
public static Coder doCoderFor(AutoBean<?> bean, String propertyName) { synchronized (coderFor) { String key = key(bean, propertyName); Coder toReturn = coderFor.get(key); if (toReturn == null) { bean.accept(new PropertyCoderCreator()); toReturn = coderFor.get(key); if (toReturn == null) { throw new IllegalArgumentException(propertyName); } } return toReturn; } }
public static Coder doCoderFor(AutoBean<?> bean, String propertyName) { synchronized (coderFor) { String key = key(bean, propertyName); Coder toReturn = coderFor.get(key); if (toReturn == null) { bean.accept(new PropertyCoderCreator()); toReturn = coderFor.get(key); if (toReturn == null) { throw new IllegalArgumentException(propertyName); } } return toReturn; } }
if (properties != null) { toMutate.accept(new AutoBeanVisitor() { @Override public boolean visitReferenceProperty(String propertyName, AutoBean<?> value,
public static void doEncode(EncodeState state, AutoBean<?> bean) { PropertyGetter e = new PropertyGetter(state); try { bean.accept(e); } catch (HaltException ex) { throw ex.getCause(); } }
public static void doEncode(EncodeState state, AutoBean<?> bean) { PropertyGetter e = new PropertyGetter(state); try { bean.accept(e); } catch (HaltException ex) { throw ex.getCause(); } }
public static void doEncode(EncodeState state, AutoBean<?> bean) { PropertyGetter e = new PropertyGetter(state); try { bean.accept(e); } catch (HaltException ex) { throw ex.getCause(); } }