for (ChangeLogSet<?> cs : ((RunWithSCM<?, ?>) build).getChangeSets()) { Model p = new ModelBuilder().get(cs.getClass()); p.writeTo(cs, Flavor.XML.createDataWriter(cs, w));
void writeNestedObjectTo(T object, TreePruner pruner, DataWriter writer) throws IOException { if(superModel !=null) superModel.writeNestedObjectTo(object,pruner,writer); for (Property p : properties) p.writeTo(object,pruner,writer); } }
@Test // JENKINS-26775 public void syntheticMethodShouldNotBeExported() { Model<Impl> model = builder.get(Impl.class); assertEquals("Redundant properties discovered: " + model.getProperties(), 1, model.getProperties().size()); }
public String getJavadoc() { return parent.getJavadoc().getProperty(method.getName()+"()"); }
public <T> Model<T> get(Class<T> type) { Model m = models.get(type); if(m==null) { synchronized(this) { m = models.get(type); if(m==null) m = new Model<T>(this,type); } } return m; } }
void writeNestedObjectTo(T object, TreePruner pruner, DataWriter writer) throws IOException { if (superModel != null) { superModel.writeNestedObjectTo(object, new FilteringTreePruner(HAS_PROPERTY_NAME,pruner), writer); } for (Property p : properties) { p.writeTo(object, pruner, writer); } }
for (Property p : m.getProperties()) { Class t = p.getType(); final boolean isCollection;
public String getJavadoc() { return parent.getJavadoc().getProperty(field.getName()); }
/** * Instead of throwing {@link NotExportableException} this method will return null * This should be used on hot paths where throwing the exception and catching it would incur a performance hit * @return model * @since 1.253 */ @CheckForNull public <T> Model<T> getOrNull(Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property) { Model<T> m = models.get(type); if(m==null && type.getAnnotation(ExportedBean.class) != null) { m = new Model<T>(this, type, propertyOwner, property); } return m; } }
p.writeTo(bean,pruner,Flavor.XML.createDataWriter(bean,sw));
void writeNestedObjectTo(T object, TreePruner pruner, DataWriter writer) throws IOException { if (superModel != null) { superModel.writeNestedObjectTo(object, new FilteringTreePruner(HAS_PROPERTY_NAME,pruner), writer); } for (Property p : properties) { p.writeTo(object, pruner, writer); } }
for (Property p : m.getProperties()) { Class t = p.getType(); final boolean isCollection;
public String getJavadoc() { return parent.getJavadoc().getProperty(method.getName()+"()"); }
/** * Instead of throwing {@link NotExportableException} this method will return null * This should be used on hot paths where throwing the exception and catching it would incur a performance hit * @return model * @since 1.253 */ @CheckForNull public <T> Model<T> getOrNull(Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property) { Model<T> m = models.get(type); if(m==null && type.getAnnotation(ExportedBean.class) != null) { m = new Model<T>(this, type, propertyOwner, property); } return m; } }
/** * Writes the property values of the given object to the writer. */ public void writeTo(T object, DataWriter writer) throws IOException { writeTo(object, 0, writer); }
/** * Writes the property values of the given object to the writer. * * @param pruner * Controls which portion of the object graph will be sent to the writer. */ public void writeTo(T object, TreePruner pruner, DataWriter writer) throws IOException { writer.startObject(); writeNestedObjectTo(object,pruner,writer); writer.endObject(); }
for (Property p : m.getProperties()) { Class t = p.getType(); final boolean isCollection;
public String getJavadoc() { return parent.getJavadoc().getProperty(field.getName()); }
/** * Writes the property values of the given object to the writer. */ public void writeTo(T object, DataWriter writer) throws IOException { writeTo(object, 0, writer); }
/** * Writes the property values of the given object to the writer. * * @param pruner * Controls which portion of the object graph will be sent to the writer. */ public void writeTo(T object, TreePruner pruner, DataWriter writer) throws IOException { writer.type(null,object.getClass()); writer.startObject(); writeNestedObjectTo(object, pruner, writer); writer.endObject(); }