Example usage for org.apache.commons.lang.builder ToStringBuilder reflectionToString

List of usage examples for org.apache.commons.lang.builder ToStringBuilder reflectionToString

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder ToStringBuilder reflectionToString.

Prototype

public static String reflectionToString(Object object) 

Source Link

Document

Forwards to ReflectionToStringBuilder.

Usage

From source file:com.projity.pm.criticalpath.CriticalPath.java

public static String getTrace() {
    StringBuffer buf = new StringBuffer();
    buf.append(ToStringBuilder.reflectionToString(lastInstance));
    buf.append("\nProject: " + lastInstance.project + " Task: " + traceTask + " reverse="
            + traceTask.isReverseScheduled() + " parent =" + traceTask.isParent());
    return buf.toString();
}

From source file:jp.co.ctc_g.jse.vid.ViewId.java

/**
 * {@inheritDoc}
 */
@Override
public String toString() {

    return ToStringBuilder.reflectionToString(this);
}

From source file:gov.nih.nci.caarray.magetab.MageTabParserTest.java

private void checkFactorsMatch(ExperimentalFactor expectedFactor, ExperimentalFactor factor) {
    checkTermsMatch(expectedFactor.getType(), factor.getType());
    assertTrue(//from  w ww. jav  a2  s  .  c  om
            "Expected factor " + ToStringBuilder.reflectionToString(expectedFactor)
                    + " differs from actual factor" + ToStringBuilder.reflectionToString(factor),
            EqualsBuilder.reflectionEquals(expectedFactor, factor, new String[] { "type" }));
}

From source file:gov.nih.nci.caarray.magetab.MageTabParserTest.java

private void checkPersonsMatch(Person expectedPerson, Person person) {
    assertEquals(expectedPerson.getRoles().size(), person.getRoles().size());
    assertTrue(//from ww  w .ja v a 2 s . c o  m
            "Expected person " + ToStringBuilder.reflectionToString(expectedPerson)
                    + " differs from actual person" + ToStringBuilder.reflectionToString(person),
            EqualsBuilder.reflectionEquals(expectedPerson, person, new String[] { "roles" }));
}

From source file:gov.nih.nci.caarray.magetab.MageTabParserTest.java

private void checkPublicationsMatch(Publication expectedPublication, Publication publication) {
    checkTermsMatch(expectedPublication.getStatus(), publication.getStatus());
    assertTrue(//w  ww .ja va 2s.c  om
            "Expected publication " + ToStringBuilder.reflectionToString(expectedPublication)
                    + " differs from actual publication" + ToStringBuilder.reflectionToString(publication),
            EqualsBuilder.reflectionEquals(expectedPublication, publication, new String[] { "status" }));
}

From source file:gov.nih.nci.caarray.magetab.MageTabParserTest.java

private void checkTermsMatch(OntologyTerm expectedTerm, OntologyTerm term) {
    assertTrue(/*from ww w  . java  2s .  c o  m*/
            "Expected term  " + ToStringBuilder.reflectionToString(expectedTerm) + " differs from actual term"
                    + ToStringBuilder.reflectionToString(term),
            EqualsBuilder.reflectionEquals(expectedTerm, term));
}

From source file:com.projity.field.Field.java

public String dump() {
    return ToStringBuilder.reflectionToString(this);
}

From source file:net.sourceforge.vulcan.ant.io.ByteSerializerTest.java

public static void assertEquals(AntEventSummary expected, AntEventSummary actual) {
    final boolean equal = EqualsBuilder.reflectionEquals(expected, actual);

    final StringBuilder sb = new StringBuilder("expected ");
    sb.append(ToStringBuilder.reflectionToString(expected));
    sb.append(" but was ");
    sb.append(ToStringBuilder.reflectionToString(actual));

    assertTrue(sb.toString(), equal);/* w  w  w. j  a v  a2s  .co m*/
}

From source file:nl.nn.adapterframework.align.Json2Xml.java

@Override
public String getNodeText(XSElementDeclaration elementDeclaration, JsonValue node) {
    String result;//from   w w  w .j  av a 2 s .c  o  m
    if (node instanceof JsonString) {
        result = ((JsonString) node).getString();
    } else if (node instanceof JsonStructure) { // this happens when override key is present without a value
        result = null;
    } else {
        result = node.toString();
    }
    if ("{}".equals(result)) {
        result = "";
    }
    if (DEBUG)
        log.debug("getText() node [" + ToStringBuilder.reflectionToString(node) + "] = [" + result + "]");
    return result;
}

From source file:nl.nn.adapterframework.align.ToXml.java

public void handleElement(XSElementDeclaration elementDeclaration, N node) throws SAXException {
    String name = elementDeclaration.getName();
    String elementNamespace = elementDeclaration.getNamespace();
    String qname = getQName(elementNamespace, name);
    if (DEBUG)//from  www . j a  v a  2s  . co  m
        log.debug("handleNode() name [" + name + "] elementNamespace [" + elementNamespace + "]");
    newLine();
    AttributesImpl attributes = new AttributesImpl();
    Map<String, String> nodeAttributes = getAttributes(elementDeclaration, node);
    if (DEBUG)
        log.debug("node [" + name + "] search for attributeDeclaration");
    XSTypeDefinition typeDefinition = elementDeclaration.getTypeDefinition();
    XSObjectList attributeUses = getAttributeUses(typeDefinition);
    if (attributeUses == null || attributeUses.getLength() == 0) {
        if (nodeAttributes != null && nodeAttributes.size() > 0) {
            log.warn("node [" + name + "] found [" + nodeAttributes.size()
                    + "] attributes, but no declared AttributeUses");
        } else {
            if (DEBUG)
                log.debug("node [" + name + "] no attributeUses, no attributes");
        }
    } else {
        if (nodeAttributes == null || nodeAttributes.isEmpty()) {
            log.warn("node [" + name + "] declared [" + attributeUses.getLength()
                    + "] attributes, but no attributes found");
        } else {
            for (int i = 0; i < attributeUses.getLength(); i++) {
                XSAttributeUse attributeUse = (XSAttributeUse) attributeUses.item(i);
                //if (DEBUG) log.debug("startElement ["+localName+"] attributeUse ["+ToStringBuilder.reflectionToString(attributeUse)+"]");
                XSAttributeDeclaration attributeDeclaration = attributeUse.getAttrDeclaration();
                if (DEBUG)
                    log.debug("node [" + name + "] attributeDeclaration ["
                            + ToStringBuilder.reflectionToString(attributeDeclaration) + "]");
                XSSimpleTypeDefinition attTypeDefinition = attributeDeclaration.getTypeDefinition();
                if (DEBUG)
                    log.debug("node [" + name + "] attTypeDefinition ["
                            + ToStringBuilder.reflectionToString(attTypeDefinition) + "]");
                String attName = attributeDeclaration.getName();
                if (nodeAttributes.containsKey(attName)) {
                    String value = nodeAttributes.remove(attName);
                    String uri = attributeDeclaration.getNamespace();
                    String attqname = getQName(uri, attName);
                    String type = null;
                    if (DEBUG)
                        log.debug(
                                "node [" + name + "] adding attribute [" + attName + "] value [" + value + "]");
                    attributes.addAttribute(uri, attName, attqname, type, value);
                }
            }
        }
    }
    if (isNil(elementDeclaration, node)) {
        validatorHandler.startPrefixMapping(XSI_PREFIX_MAPPING, XML_SCHEMA_INSTANCE_NAMESPACE);
        attributes.addAttribute(XML_SCHEMA_INSTANCE_NAMESPACE, XML_SCHEMA_NIL_ATTRIBUTE,
                XSI_PREFIX_MAPPING + ":" + XML_SCHEMA_NIL_ATTRIBUTE, "xs:boolean", "true");
        validatorHandler.startElement(elementNamespace, name, qname, attributes);
        validatorHandler.endElement(elementNamespace, name, qname);
        validatorHandler.endPrefixMapping(XSI_PREFIX_MAPPING);
    } else {
        validatorHandler.startElement(elementNamespace, name, qname, attributes);
        handleElementContents(elementDeclaration, node);
        validatorHandler.endElement(elementNamespace, name, qname);
    }
    //      if (createdPrefix!=null) {
    //         validatorHandler.endPrefixMapping(createdPrefix);
    //      }
}