TreePruner pruner = (tree!=null) ? new NamedPathPruner(tree) : new ByDepth(1 - depth); p.writeTo(bean,pruner,Flavor.XML.createDataWriter(bean,sw));
TreePruner pruner = (tree!=null) ? new NamedPathPruner(tree) : new ByDepth(1 - depth); p.writeTo(bean,pruner,Flavor.XML.createDataWriter(bean,sw));
throw new ServletException("Depth parameter must be a number"); pruner = new ByDepth(1 - depth);
throw new ServletException("Depth parameter must be a number"); pruner = new ByDepth(1 - depth);
throw new ServletException("Depth parameter must be a number"); pruner = new ByDepth(1 - depth);
/** * Writes the property values of the given object to the writer. * * @param baseVisibility * This parameters controls how much data we'd be writing, * by adding bias to the sub tree cutting. * A property with {@link Exported#visibility() visibility} X will be written * if the current depth Y and baseVisibility Z satisfies {@code X + Z > Y}. * * 0 is the normal value. Positive value means writing bigger tree, * and negative value means writing smaller trees. * * @deprecated as of 1.139 */ @Deprecated public void writeTo(T object, int baseVisibility, DataWriter writer) throws IOException { writeTo(object,new ByDepth(1-baseVisibility),writer); }
/** * Writes the property values of the given object to the writer. * * @param baseVisibility * This parameters controls how much data we'd be writing, * by adding bias to the sub tree cutting. * A property with {@link Exported#visibility() visibility} X will be written * if the current depth Y and baseVisibility Z satisfies {@code X + Z > Y}. * * 0 is the normal value. Positive value means writing bigger tree, * and negative value means writing smaller trees. * * @deprecated as of 1.139 */ @Deprecated public void writeTo(T object, int baseVisibility, DataWriter writer) throws IOException { writeTo(object,new ByDepth(1-baseVisibility),writer); }
/** * Writes the property values of the given object to the writer. * * @param baseVisibility * This parameters controls how much data we'd be writing, * by adding bias to the sub tree cutting. * A property with {@link Exported#visibility() visibility} X will be written * if the current depth Y and baseVisibility Z satisfies X+Z>Y. * * 0 is the normal value. Positive value means writing bigger tree, * and negative value means writing smaller trees. * * @deprecated as of 1.139 */ public void writeTo(T object, int baseVisibility, DataWriter writer) throws IOException { writeTo(object,new ByDepth(1-baseVisibility),writer); }
private ByDepth next() { if (next==null) next = new ByDepth(n+1); return next; }
@Override public TreePruner accept(Object node, Property prop) { if (prop.visibility < n) return null; // not visible if (prop.inline) return this; return next(); } }
@Override public TreePruner accept(Object node, Property prop) { if (prop.visibility < n) return null; // not visible if (prop.inline || prop.merge) return this; return next(); } }
private <T> String write(T bean) throws IOException { StringWriter w = new StringWriter(); Model model = new ModelBuilder().get(bean.getClass()); model.writeTo(bean, new TreePruner.ByDepth(-999), Flavor.JSON.createDataWriter(bean, w, config)); return w.toString().replace('\"','\''); }
/** * @deprecated as of 1.139 */ public void writeTo(Object object, int depth, DataWriter writer) throws IOException { writeTo(object,new ByDepth(depth),writer); }
/** * @deprecated as of 1.139 */ public void writeTo(Object object, int depth, DataWriter writer) throws IOException { writeTo(object,new ByDepth(depth),writer); }
private ByDepth next() { if (next==null) next = new ByDepth(n+1); return next; }
/** * @deprecated as of 1.139 */ public void writeTo(Object object, int depth, DataWriter writer) throws IOException { writeTo(object,new ByDepth(depth),writer); }
private ByDepth next() { if (next==null) next = new ByDepth(n+1); return next; }
@Override public TreePruner accept(Object node, Property prop) { if (prop.visibility < n) return null; // not visible if (prop.inline || prop.merge) return this; return next(); } }