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


Java ClassUtils.getPackageName方法代码示例

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


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

示例1: imported

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private boolean imported(List<ImportDeclaration> imports, String fullyQualifiedName) {
    final String packageName = ClassUtils.getPackageName(fullyQualifiedName);

    for (final ImportDeclaration i : imports) {
        if (!i.isStatic()) {
            final String importName = i.getName().toString();
            if (i.isAsterisk()) {
                if (packageName.equals(importName)) {
                    if ( LOG.isDebugEnabled() ) {
                        LOG.debug("found import " + packageName + ".* on " + getTypeNameForMsg(i) + ".");
                    }
                    return true;
                }
            } else {
                if (fullyQualifiedName.equals(importName)) {
                    if ( LOG.isDebugEnabled() ) {
                        LOG.debug("found import " + fullyQualifiedName + " on " + getTypeNameForMsg(i) + ".");
                    }
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:AnnotationHelper.java

示例2: 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

示例3: InMemoryClassBuilder

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
public InMemoryClassBuilder(Class<?> domainClass) {
    //TODO JL: Konfiguration aus gengui lesen:
    //  - Soll die dynamische Erzeugung überhaupt passieren? 
    //  - Soll sie auch passieren, wenn noch nicht mal das HTML existiert?
    //TODO L: Prüfung auf Serializable der domainClass
    this.domainClass = domainClass;
    this.packageName = ClassUtils.getPackageName(domainClass);
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:9,代码来源:InMemoryClassBuilder.java

示例4: getSamplesDir

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private String getSamplesDir(){
	String pckName = ClassUtils.getPackageName(this.getClass());
	return StringUtils.replace(pckName, ".", "/") + "/";
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:5,代码来源:ApplicationContextConfigurationReaderTest.java

示例5: getSamplesDir

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private static String getSamplesDir(){
	String pckName = ClassUtils.getPackageName(ApplicationContextLoaderMain.class);
	return StringUtils.replace(pckName, ".", "/") + "/";
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:5,代码来源:ApplicationContextLoaderMain.java

示例6: getDirBasedUponPackage

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
protected String getDirBasedUponPackage(){
	String pckName = ClassUtils.getPackageName(this.getClass());
	return StringUtils.replace(pckName, ".", "/") + "/";
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:5,代码来源:BusinessActionTestCase.java

示例7: getSamplesDir

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private static String getSamplesDir(){
	String pckName = ClassUtils.getPackageName(JavaProcessorTest.class);
	return StringUtils.replace(pckName, ".", "/") + "/";
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:5,代码来源:JavaProcessorTest.java

示例8: getDirBasedUponPackage

import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private String getDirBasedUponPackage() {
	String pckName = ClassUtils.getPackageName(this.getClass());
	return StringUtils.replace(pckName, ".", "/") + "/";
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:5,代码来源:StatementsReaderTest.java


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