本文整理汇总了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;
}
示例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;
}
示例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);
}
示例4: getSamplesDir
import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private String getSamplesDir(){
String pckName = ClassUtils.getPackageName(this.getClass());
return StringUtils.replace(pckName, ".", "/") + "/";
}
示例5: getSamplesDir
import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private static String getSamplesDir(){
String pckName = ClassUtils.getPackageName(ApplicationContextLoaderMain.class);
return StringUtils.replace(pckName, ".", "/") + "/";
}
示例6: getDirBasedUponPackage
import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
protected String getDirBasedUponPackage(){
String pckName = ClassUtils.getPackageName(this.getClass());
return StringUtils.replace(pckName, ".", "/") + "/";
}
示例7: getSamplesDir
import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private static String getSamplesDir(){
String pckName = ClassUtils.getPackageName(JavaProcessorTest.class);
return StringUtils.replace(pckName, ".", "/") + "/";
}
示例8: getDirBasedUponPackage
import org.apache.commons.lang.ClassUtils; //导入方法依赖的package包/类
private String getDirBasedUponPackage() {
String pckName = ClassUtils.getPackageName(this.getClass());
return StringUtils.replace(pckName, ".", "/") + "/";
}