當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。