Example usage for org.apache.commons.lang3 ClassUtils getSimpleName

List of usage examples for org.apache.commons.lang3 ClassUtils getSimpleName

Introduction

In this page you can find the example usage for org.apache.commons.lang3 ClassUtils getSimpleName.

Prototype

public static String getSimpleName(final Object object, final String valueIfNull) 

Source Link

Document

Null-safe version of aClass.getSimpleName()

Usage

From source file:de.unentscheidbar.validation.swing.trigger.UnsupportedClassException.java

public UnsupportedClassException(Object instance) {

    super("Unsupported class: " + ClassUtils.getSimpleName(instance, "NULL"));
}

From source file:de.unentscheidbar.validation.swing.trigger.DocumentChangeTrigger.java

@Override
public void propertyChange(PropertyChangeEvent evt) {

    if (evt.getSource() instanceof JComponent) {
        JComponent src = (JComponent) evt.getSource();
        forgetDocument((Document) evt.getOldValue(), src);
        observeDocument(src);/*from ww  w .j  a  va 2 s  .  com*/
    } else {
        /* JComponent correctly reports itself as the event source, so this should never happen */
        throw new IllegalStateException("Received a PropertyChangeEvent with unexpected source type: "
                + ClassUtils.getSimpleName(evt.getSource(), "NULL"));
    }
}

From source file:org.openehealth.ipf.platform.camel.ihe.hl7v2.intercept.producer.ProducerAdaptingInterceptor.java

/**
 * Converts outgoing request to a {@link MessageAdapter}  
 * and performs some exchange configuration.
 *//*from  ww  w.java 2 s .  co  m*/
@Override
public void process(Exchange exchange) throws Exception {
    if (charsetName != null) {
        exchange.setProperty(Exchange.CHARSET_NAME, charsetName);
    }
    MessageAdapter<?> msg = Hl7v2MarshalUtils.extractMessageAdapter(exchange.getIn(), characterSet(exchange),
            getHl7v2TransactionConfiguration().getParser());

    if (msg == null) {
        throw new Hl7v2AdaptingException("Cannot create HL7v2 message from the given "
                + ClassUtils.getSimpleName(exchange.getIn().getBody(), "<null>"));
    }

    exchange.getIn().setBody(msg);
    exchange.setPattern(ExchangePattern.InOut);

    // run the route
    getWrappedProcessor().process(exchange);
}