List of usage examples for org.apache.commons.lang.builder ReflectionToStringBuilder ReflectionToStringBuilder
public ReflectionToStringBuilder(Object object, ToStringStyle style)
Constructor.
From source file:nl.surfnet.coin.api.client.domain.Person.java
@Override public String toString() { return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).toString(); }
From source file:nl.surfnet.coin.janus.domain.EntityMetadata.java
public String toString() { return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).toString(); }
From source file:org.apache.crunch.impl.mr.plan.Vertex.java
@Override public String toString() { return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .setExcludeFieldNames(new String[] { "outgoing", "incoming" }).toString(); }
From source file:org.eclipse.smila.search.HitsPerIndex.java
/** * @see java.lang.Object#toString()/*from w w w.j a v a 2 s .c o m*/ * @return Object as String. */ @Override public String toString() { final String objectAsString = new ReflectionToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).toString(); return objectAsString; }
From source file:org.fornax.cartridges.sculptor.framework.domain.AbstractDomainObject.java
/** * Only "simple" types will be included in toString. Relations to other * domain objects can not be included since we don't know if they are * fetched and we don't wont toString to fetch them. * <p>/*from w w w .j a v a 2s. c om*/ * More intelligent implementation can be done in subclasses if needed. * Subclasses may also override {@link #acceptToString(Field)}. * <p> * The */ @Override public String toString() { try { ReflectionToStringBuilder builder = new ReflectionToStringBuilder(this, toStringStyle()) { @Override protected boolean accept(Field f) { if (super.accept(f)) { return acceptToString(f); } else { return false; } } }; builder.setAppendStatics(false); builder.setAppendTransients(true); return builder.toString(); } catch (RuntimeException e) { // toString is only used for debug purpose and // eventual exceptions should not be "ignored" return "RuntimeException in " + getClass().getName() + ".toString():" + e.getMessage(); } }
From source file:org.nuxeo.launcher.info.CommandInfo.java
/** * Log content of the command info//from w ww.ja va 2 s . c o m * * @since 5.7 */ public void log(boolean debug) { StringBuilder sb = new StringBuilder(); if (pending) { sb.append("* Pending action: " + name); } else { sb.append("* " + name); } if (id != null) { sb.append(" [" + id + "]"); } if (param != null) { sb.append(" (" + param + ")"); } for (PackageInfo packageInfo : packages) { sb.append("\n\t" + new ReflectionToStringBuilder(packageInfo, ToStringStyle.SHORT_PREFIX_STYLE) .setExcludeFieldNames(new String[] { "description" }).toString()); } if (exitCode != 0 || debug) { if (exitCode != 0) { log.error(sb.toString()); } else { log.info(sb.toString()); } for (MessageInfo messageInfo : messages) { messageInfo.log(); } } }
From source file:org.openvpms.web.component.im.edit.act.FinancialActEditor.java
/** * Helper to format an object for debugging purposes, as the toString() method is not helpful. * TODO./*from w w w . j a v a 2s . c o m*/ * * @param object the object * @return the formatted object */ private String format(IMObject object) { return new ReflectionToStringBuilder(object, ToStringStyle.SHORT_PREFIX_STYLE).toString(); }
From source file:org.sonar.api.workflow.internal.DefaultComment.java
@Override public String toString() { return new ReflectionToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).toString(); }
From source file:org.syncope.client.to.UserTO.java
@Override public String toString() { return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) { @Override//w w w. j a v a 2s.c om protected boolean accept(Field f) { return super.accept(f) && !f.getName().equals("password"); } }.toString(); }