本文整理了Java中org.jboss.errai.codegen.meta.MetaClass.getName()
方法的一些代码示例,展示了MetaClass.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MetaClass.getName()
方法的具体详情如下:
包路径:org.jboss.errai.codegen.meta.MetaClass
类名称:MetaClass
方法名:getName
暂无
代码示例来源:origin: errai/errai
@Override
public String getDeclaringClassName() {
return declaringClass.getName();
}
代码示例来源:origin: errai/errai
@Override
public String getDeclaringClassName() {
return declaringClass.getName();
}
代码示例来源:origin: errai/errai
private static String getTypeName(final MetaClass type) {
if (type.isArray()) {
return type.getName().replace("[]", "_array");
} else {
return type.getName();
}
}
代码示例来源:origin: org.jboss.errai/errai-codegen
private static String getTypeName(final MetaClass type) {
if (type.isArray()) {
return type.getName().replace("[]", "_array");
} else {
return type.getName();
}
}
代码示例来源:origin: errai/errai
/**
* @return A unique name for this injection site.
*/
public String getUniqueName() {
return enclosingType.getName() + "_" + annotatedName();
}
代码示例来源:origin: errai/errai
/**
* Ensured the provided type is bindable and throws a
* {@link GenerationException} in case it's not.
*
* @param type
* the type to check
*/
private static void assertTypeIsBindable(final MetaClass type) {
if (!isBindableType(type)) {
throw new GenerationException(type.getName() + " must be a @Bindable type when used as @Model");
}
}
代码示例来源:origin: org.jboss.errai/errai-data-binding
/**
* Ensured the provided type is bindable and throws a
* {@link GenerationException} in case it's not.
*
* @param type
* the type to check
*/
private static void assertTypeIsBindable(final MetaClass type) {
if (!isBindableType(type)) {
throw new GenerationException(type.getName() + " must be a @Bindable type when used as @Model");
}
}
代码示例来源:origin: errai/errai
private List<Statement> contextLocalVarDeclarations(final Collection<MetaClass> scopeContextTypes) {
final List<Statement> declarations = new ArrayList<>();
for (final MetaClass scopeContextImpl : scopeContextTypes) {
if (!scopeContextImpl.isDefaultInstantiable()) {
throw new RuntimeException(
"The @ScopeContext " + scopeContextImpl.getName() + " must have a public, no-args constructor.");
}
declarations.add(declareFinalVariable(getContextVarName(scopeContextImpl), Context.class,
newInstanceOf(scopeContextImpl)));
}
return declarations;
}
代码示例来源:origin: errai/errai
private AnnotationWrapper createNamed(final HasAnnotations annotated) {
final String rawName;
if (annotated instanceof MetaClassMember) {
rawName = ((MetaClassMember) annotated).getName();
} else if (annotated instanceof MetaClass) {
rawName = ((MetaClass) annotated).getName();
} else if (annotated instanceof MetaParameter) {
rawName = ((MetaParameter) annotated).getName();
} else {
throw new RuntimeException("Unrecognized annotated type " + annotated.getClass().getName());
}
return createNamed(CDIAnnotationUtils.formatDefaultElName(rawName));
}
代码示例来源:origin: errai/errai
private static void _doRunnableTasks(final Collection<MetaClass> classes, final BlockBuilder<?> blockBuilder) {
for (final MetaClass clazz : classes) {
if (!clazz.isAssignableTo(Runnable.class)) {
throw new RuntimeException("annotated @IOCBootstrap task: " + clazz.getName() + " is not of type: "
+ Runnable.class.getName());
}
blockBuilder.append(Stmt.nestedCall(Stmt.newObject(clazz)).invoke("run"));
}
}
代码示例来源:origin: errai/errai
public static BuildMetaClass makeProxy(final MetaClass toProxy,
final String privateAccessorType,
final Map<String, ProxyProperty> proxyProperties,
final Map<MetaMethod, Map<WeaveType, Collection<Statement>>> weavingStatements) {
return makeProxy(
PrivateAccessUtil.condensify(toProxy.getPackageName()) + "_" + toProxy.getName() + "_proxy",
toProxy,
privateAccessorType, proxyProperties, weavingStatements);
}
代码示例来源:origin: errai/errai
public static String getPrivateFieldAccessorName(final MetaField field) {
return field.getDeclaringClass().getName()
+ "_" + getTypeName(field.getType())
+ "_" + field.getName();
}
代码示例来源:origin: org.jboss.errai/errai-codegen
public static String getPrivateFieldAccessorName(final MetaField field) {
return field.getDeclaringClass().getName()
+ "_" + getTypeName(field.getType())
+ "_" + field.getName();
}
代码示例来源:origin: errai/errai
protected boolean isProxiable(MetaClassMember member) {
if(member != null) {
if (!member.isFinal() && member.isPublic()) {
return true;
} else {
logger.log(DEBUG, "Member " + member.getName() + " in " + bindable.getName() +
" is " + (member.isFinal() ? "final" : "not public") + ", cannot be proxied.");
}
}
return false;
}
}
代码示例来源:origin: org.jboss.errai/errai-data-binding
protected boolean isProxiable(MetaClassMember member) {
if(member != null) {
if (!member.isFinal() && member.isPublic()) {
return true;
} else {
logger.log(DEBUG, "Member " + member.getName() + " in " + bindable.getName() +
" is " + (member.isFinal() ? "final" : "not public") + ", cannot be proxied.");
}
}
return false;
}
}
代码示例来源:origin: errai/errai
public static String getPrivateMethodName(final MetaMethod method) {
final MetaClass declaringClass = method.getDeclaringClass();
String name = declaringClass.getName() + "_" + method.getName();
if (method.getParameters() != null) {
for (final MetaParameter p : method.getParameters()) {
name += "_" + getTypeName(p.getType());
}
}
return name;
}
代码示例来源:origin: org.jboss.errai/errai-codegen
public static String getPrivateMethodName(final MetaMethod method) {
final MetaClass declaringClass = method.getDeclaringClass();
String name = declaringClass.getName() + "_" + method.getName();
if (method.getParameters() != null) {
for (final MetaParameter p : method.getParameters()) {
name += "_" + getTypeName(p.getType());
}
}
return name;
}
代码示例来源:origin: errai/errai
@Test
public void testNamingMethods() throws Exception {
final MetaClass child = getMetaClass(Child.class);
assertEquals(Child.class.getSimpleName(), child.getName());
assertEquals(Child.class.getName(), child.getFullyQualifiedName());
assertEquals(Child.class.getName(), child.getCanonicalName());
assertEquals("L" + Child.class.getName().replace('.', '/') + ";", child.getInternalName());
}
代码示例来源:origin: errai/errai
@Test
public void testIsAssignableFromComparisonForNested() {
final MetaClass interfaceClass = getMetaClass(TestInterface.class);
final MetaClass metaHolderClass = getMetaClass(ObjectWithNested.class);
// dig out the nested interface from the holder class and ensure it's what we were looking for
final MetaClass nestedInterface = metaHolderClass.getDeclaredClasses()[0];
assertEquals("MyNestedInterface", nestedInterface.getName());
assertEquals(getTypeOfMetaClassBeingTested(), nestedInterface.getClass());
assertTrue("MyNestedInterface should be assignable from TestInterface",
interfaceClass.isAssignableFrom(nestedInterface));
}
代码示例来源:origin: errai/errai
@Test
public void testEraseParameterizedTopLevelType() throws Exception {
final MetaClass parameterized = getMetaClass(ParameterizedClass.class);
assertEquals("ParameterizedClass", parameterized.getName());
assertEquals("org.jboss.errai.codegen.test.model.ParameterizedClass", parameterized.getFullyQualifiedName());
assertNull(parameterized.getParameterizedType());
// I think this would be correct, but right now we get the raw type name
//assertEquals("org.jboss.errai.codegen.test.model.ParameterizedClass<T>", parameterized.getFullyQualifiedNameWithTypeParms());
assertEquals("org.jboss.errai.codegen.test.model.ParameterizedClass", parameterized.getErased().getFullyQualifiedNameWithTypeParms());
}
内容来源于网络,如有侵权,请联系作者删除!