Example usage for org.apache.commons.lang ClassUtils getShortClassName

List of usage examples for org.apache.commons.lang ClassUtils getShortClassName

Introduction

In this page you can find the example usage for org.apache.commons.lang ClassUtils getShortClassName.

Prototype

public static String getShortClassName(String className) 

Source Link

Document

Gets the class name minus the package name from a String.

The string passed in is assumed to be a class name - it is not checked.

Usage

From source file:com.algoTrader.entity.trade.StopOrderImpl.java

public String toString() {

    return getSide() + " " + getQuantity() + " " + ClassUtils.getShortClassName(this.getClass()) + " "
            + getSecurity().getSymbol() + " stop " + getStop();
}

From source file:com.algoTrader.entity.trade.OrderImpl.java

public String toString() {

    return getSide() + " " + getQuantity() + " " + ClassUtils.getShortClassName(this.getClass()) + " "
            + getSecurity().getSymbol();
}

From source file:com.algoTrader.entity.trade.LimitOrderImpl.java

public String toString() {

    return getSide() + " " + getQuantity() + " " + ClassUtils.getShortClassName(this.getClass()) + " "
            + getSecurity().getSymbol() + " limit " + getLimit();
}

From source file:com.algoTrader.entity.trade.StopLimitOrderImpl.java

public String toString() {

    return getSide() + " " + getQuantity() + " " + ClassUtils.getShortClassName(this.getClass()) + " "
            + getSecurity().getSymbol() + " stop " + getStop() + " limit " + getLimit();
}

From source file:com.algoTrader.entity.trade.TrailingStopOrderImpl.java

public String toString() {

    return getSide() + " " + getQuantity() + " " + ClassUtils.getShortClassName(this.getClass()) + " "
            + getSecurity().getSymbol() + " trailingAmount " + getTrailingAmount();
}

From source file:com.neusoft.clw.common.dao.impl.ExtendSqlMapDao.java

public Object getObject(Class clazz, Object obj) throws DataAccessException {
    try {// ww  w.ja  v  a 2  s.c  om
        String statement = getFindQuery(ClassUtils.getShortClassName(clazz));
        if (obj instanceof String) {
            statement = statement + "ById";
        }
        return getSqlMapClientTemplate().queryForObject(statement, obj);
    } catch (Exception e) {
        throw new DataAccessException(e);
    }
}

From source file:com.bstek.dorado.view.registry.ComponentTypeRegisterInfo.java

/**
 * @param classType/*from w  w  w .ja v a2s  .  com*/
 */
public void setClassType(Class<? extends Component> classType) {
    this.classType = classType;
    if (StringUtils.isEmpty(name)) {
        name = ClassUtils.getShortClassName(classType);
    }
}

From source file:com.neusoft.clw.common.dao.impl.ExtendSqlMapDao.java

public int delete(Class clazz, Object obj) throws DataAccessIntegrityViolationException, DataAccessException {

    int ret = 0;// w  w w  . j av  a2  s  . c o m
    try {
        String statement = getDeleteQuery(ClassUtils.getShortClassName(clazz));
        if (obj instanceof String) {
            statement = statement + "ById";
        }
        ret = getSqlMapClientTemplate().delete(statement, obj);
    } catch (DataIntegrityViolationException e) {
        throw new DataAccessIntegrityViolationException(e);
    } catch (Exception e) {
        throw new DataAccessException(e);
    }
    return ret;

}

From source file:com.emental.mindraider.test.MRBaseTest.java

/**
 * It returns the full test name.// ww  w  . j av a  2 s. co m
 * @see junit.framework.TestCase#getName()
 */
public String getName() {
    return ClassUtils.getShortClassName(this.getClass()) + "::" + super.getName();
}

From source file:au.id.wolfe.stormcloud.core.interceptor.DAOInterceptor.java

@Around("execution(* au.id.wolfe.stormcloud.core.dao..*.*(..))")
public Object logHibernateQueryTimes(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {

    final String targetClass = ClassUtils
            .getShortClassName(proceedingJoinPoint.getTarget().getClass().getName());
    final String methodName = proceedingJoinPoint.getSignature().getName();

    StopWatch stopWatch = new StopWatch();

    stopWatch.start();/* w ww .  j ava  2  s .  co  m*/
    Object retVal = proceedingJoinPoint.proceed();
    stopWatch.stop();

    StringBuilder sb = new StringBuilder();
    sb.append(targetClass).append(" - ").append(methodName).append(": ").append(stopWatch.getTime())
            .append(" ms");

    log.debug(sb.toString());

    return retVal;
}