当前位置: 首页>>代码示例>>Java>>正文


Java ClassUtils.getShortClassName方法代码示例

本文整理汇总了Java中org.apache.commons.lang.ClassUtils.getShortClassName方法的典型用法代码示例。如果您正苦于以下问题:Java ClassUtils.getShortClassName方法的具体用法?Java ClassUtils.getShortClassName怎么用?Java ClassUtils.getShortClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang.ClassUtils的用法示例。


在下文中一共展示了ClassUtils.getShortClassName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dump

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
/**
 * 记录请求信息
 * 
 * @param methodInvocation
 * @param take
 */
private void dump(MethodInvocation methodInvocation, Object result, long take) {
    // 取得日志打印对象
    Logger log = getLogger(methodInvocation.getMethod().getDeclaringClass());
    Object[] args = methodInvocation.getArguments();
    StringBuffer buffer = getArgsString(args);

    if (log.isInfoEnabled()) {
        String className = ClassUtils.getShortClassName(methodInvocation.getMethod().getDeclaringClass());
        String methodName = methodInvocation.getMethod().getName();
        String resultStr = getResultString(result);

        String now = new SimpleDateFormat(DATA_FORMAT).format(new Date());
        log.info(MessageFormat.format(MESSAGE, new Object[] { className, methodName, now, take, buffer.toString(),
                resultStr }));
    }
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:23,代码来源:LogInterceptor.java

示例2: findAnnotation

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private AnnotationExpr findAnnotation(final BodyDeclaration n, String fullyQualifiedName, boolean foundAnnImport) {
    final String simpleName = ClassUtils.getShortClassName(fullyQualifiedName);
    final List<AnnotationExpr> annotations = n.getAnnotations() != null ? n.getAnnotations() : new ArrayList<AnnotationExpr>();

    for (AnnotationExpr ae : annotations) {
        final String name = ae.getName().toString();
        if ((simpleName.equals(name) && foundAnnImport)) {
            LOG.info("found " + ae + " on " + getTypeOrFieldNameForMsg(n) + ".");
            return ae;
        }

        if (fullyQualifiedName.equals(name)) {
            LOG.info("found " + ae + " on " + getTypeOrFieldNameForMsg(n) + ".");
            return ae;
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:AnnotationHelper.java

示例3: getInvoker

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
/**
 * Get the method invoker's class name
 * 
 * @param depth
 * @return
 */
private String getInvoker(int depth) {
    Exception e = new Exception();
    StackTraceElement[] stes = e.getStackTrace();
    if (stes.length > depth) {
        return ClassUtils.getShortClassName(stes[depth].getClassName());
    }
    return getClass().getSimpleName();
}
 
开发者ID:baidu,项目名称:uid-generator,代码行数:15,代码来源:NamingThreadFactory.java

示例4: toString

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
/**
 * <p>Human readable description of this <code>Enum</code> item.</p>
 *
 * @return String in the form <code>type[name=value]</code>, for example:
 *  <code>JavaVersion[Java 1.0=100]</code>. Note that the package name is
 *  stripped from the type name.
 */
public String toString() {
    if (iToString == null) {
        String shortName = ClassUtils.getShortClassName(getEnumClass());
        iToString = shortName + "[" + getName() + "=" + getValue() + "]";
    }
    return iToString;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:ValuedEnum.java

示例5: toString

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
/**
 * <p>Human readable description of this Enum item.</p>
 * 
 * @return String in the form <code>type[name]</code>, for example:
 * <code>Color[Red]</code>. Note that the package name is stripped from
 * the type name.
 */
public String toString() {
    if (iToString == null) {
        String shortName = ClassUtils.getShortClassName(getEnumClass());
        iToString = shortName + "[" + getName() + "]";
    }
    return iToString;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:Enum.java

示例6: getMessage

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
public static String getMessage(Throwable th)
{
  if (th == null) {
    return "";
  }
  String clsName = ClassUtils.getShortClassName(th, null);
  String msg = th.getMessage();
  return clsName + ": " + StringUtils.defaultString(msg);
}
 
开发者ID:thinking-github,项目名称:nbone,代码行数:10,代码来源:ExceptionUtils.java

示例7: endWindow

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void endWindow()
{
  super.endWindow();
  tuplesInCurrentStreamWindow = new LinkedList<T>();
  if (lastExpiredWindowState == null) {
    // not ready to emit value or empty in a certain window
    return;
  }
  // Assumption: the expiring tuple and any tuple before are already sorted. So it's safe to emit tuples from sortedListInSlidingWin till the expiring tuple
  for (T expiredTuple : lastExpiredWindowState) {
    // Find sorted list for the given key
    PriorityQueue<T> sortedListForE = sortedListInSlidingWin.get(function.apply(expiredTuple));
    for (Iterator<T> iterator = sortedListForE.iterator(); iterator.hasNext();) {
      T minElemInSortedList = iterator.next();
      int k = 0;
      if (comparator == null) {
        if (expiredTuple instanceof Comparable) {
          k = ((Comparable<T>)expiredTuple).compareTo(minElemInSortedList);
        } else {
          errorOutput.emit(expiredTuple);
          throw new IllegalArgumentException("Operator \"" + ClassUtils.getShortClassName(this.getClass()) + "\" encounters an invalid tuple " + expiredTuple + "\nNeither the tuple is comparable Nor Comparator is specified!");
        }
      } else {
        k = comparator.compare(expiredTuple, minElemInSortedList);
      }
      if (k < 0) {
        // If the expiring tuple is less than the first element of the sorted list. No more tuples to emit
        break;
      } else {
        // Emit the element in sorted list if it's less than the expiring tuple
        outputPort.emit(minElemInSortedList);
        // remove the element from the sorted list
        iterator.remove();
      }
    }
  }
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:40,代码来源:SortedMovingWindow.java

示例8: getAnnotationNodes

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
/** gets the annotation but also adds an import in the process if a Convert annotation is required. */
@Override
protected NodeData getAnnotationNodes(String enclosingClass, String fieldName, String mappedClass) {
    final FieldDescriptor fd = OjbUtil.findFieldDescriptor(mappedClass, fieldName, descriptorRepositories);

    if (fd != null) {
        final FieldConversion fc = fd.getFieldConversion();
        //in ojb all columns have at least the default field conversion
        if (fc != null && FieldConversionDefaultImpl.class != fc.getClass()) {
            LOG.info(enclosingClass + "." + fieldName + " for the mapped class " + mappedClass + " field has a converter " + fc.getClass().getName());

            final String jpaConverter = getJpaConverterForOjbClass(fc.getClass().getName());
            if (jpaConverter == null) {
                LOG.error(ResolverUtil.logMsgForField(enclosingClass, fieldName, mappedClass) + " field has a converter " + fc.getClass().getName()
                    + " but a replacement converter was not configured, unable to set Convert class");
                return new NodeData(new NormalAnnotationExpr(new NameExpr(SIMPLE_NAME), Collections.singletonList(new MemberValuePair("converter", new NameExpr(null)))),
                        new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false));
            } else if ( StringUtils.isBlank(jpaConverter) ) {
                LOG.info(ResolverUtil.logMsgForField(enclosingClass, fieldName, mappedClass) + " field has a converter " + fc.getClass().getName()
                        + " But no converter definition is needed due to default converter configuration." );
            } else {
                final String shortClassName = ClassUtils.getShortClassName(jpaConverter);
                final String packageName = ClassUtils.getPackageName(jpaConverter);
                return new NodeData(new NormalAnnotationExpr(new NameExpr(SIMPLE_NAME),  Collections.singletonList(new MemberValuePair("converter", new NameExpr(shortClassName + ".class")))),
                        new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false),
                        Collections.singletonList(new ImportDeclaration(new QualifiedNameExpr(new NameExpr(packageName), shortClassName), false, false)));
            }
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:ConvertResolver.java

示例9: generateColumnSpec

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private ColumnSpec generateColumnSpec(FieldMapping fieldMapping) {
	ColumnSpec columnSpec = new AffiliatesImportSpec.ColumnSpec();
	columnSpec.attributeClass = ClassUtils.getShortClassName(fieldMapping.accessor.getAttributeClass());
	columnSpec.columnName = fieldMapping.columnName;
	columnSpec.required = fieldMapping.required;
	columnSpec.example = getExampleValue(fieldMapping);
	columnSpec.options = fieldMapping.getOptions();
	return columnSpec;
}
 
开发者ID:IHTSDO,项目名称:MLDS,代码行数:10,代码来源:AffiliatesExporterService.java

示例10: assertAuthenticationClassIs

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
@Then("authentication failure is <failure>")
@Alias("authentication failure is $failure")
public void assertAuthenticationClassIs(@Named("failure") String failure) {
  assertNotNull(authException);
  String expectedClassName = failure + "Exception";
  String actualClassName = ClassUtils.getShortClassName(authException.getClass());
  assertEquals(expectedClassName, actualClassName);
}
 
开发者ID:vactowb,项目名称:jbehave-core,代码行数:9,代码来源:AuthenticationSteps.java

示例11: exceptionToErrorCode

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
public static String exceptionToErrorCode( Throwable e ) {
    if ( e == null ) {
        return "service_error";
    }
    String s = ClassUtils.getShortClassName( e.getClass() );
    s = StringUtils.removeEnd( s, "Exception" );
    s = InflectionUtils.underscore( s ).toLowerCase();
    return s;
}
 
开发者ID:apache,项目名称:usergrid,代码行数:10,代码来源:ApiResponse.java

示例12: getName

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
/**
 * It returns the full test name.
 * @see junit.framework.TestCase#getName()
 */
public String getName()
{
    return ClassUtils.getShortClassName(this.getClass()) + "::" + super.getName();
}
 
开发者ID:dvorka,项目名称:mindraider,代码行数:9,代码来源:MRBaseTest.java

示例13: toString

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
public String toString() {

		return getSide() + " " + getQuantity() + " " + ClassUtils.getShortClassName(this.getClass()) + " " + getSecurity().getSymbol() + " trailingAmount "
				+ getTrailingAmount();
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:6,代码来源:TrailingStopOrderImpl.java

示例14: toString

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
public String toString() {

		return getSide() + " " + getQuantity() + " " + ClassUtils.getShortClassName(this.getClass()) + " " + getSecurity().getSymbol() + " stop " + getStop()
				+ " limit " + getLimit();
	}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:6,代码来源:StopLimitOrderImpl.java

示例15: toString

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
public String toString()
{
    return ClassUtils.getShortClassName(this.getClass()) + "[references-size="
            + (references != null ? "" + references.size() : "undefined") + "]";
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:6,代码来源:Image.java


注:本文中的org.apache.commons.lang.ClassUtils.getShortClassName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。