本文整理了Java中com.google.inject.internal.Annotations.resolveMembers()
方法的一些代码示例,展示了Annotations.resolveMembers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotations.resolveMembers()
方法的具体详情如下:
包路径:com.google.inject.internal.Annotations
类名称:Annotations
方法名:resolveMembers
暂无
代码示例来源:origin: com.google.inject/guice
private static <T extends Annotation> T generateAnnotationImpl(final Class<T> annotationType) {
final Map<String, Object> members = resolveMembers(annotationType);
return annotationType.cast(
Proxy.newProxyInstance(
annotationType.getClassLoader(),
new Class<?>[] {annotationType},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
String name = method.getName();
if (name.equals("annotationType")) {
return annotationType;
} else if (name.equals("toString")) {
return annotationToString(annotationType, members);
} else if (name.equals("hashCode")) {
return annotationHashCode(annotationType, members);
} else if (name.equals("equals")) {
return annotationEquals(annotationType, members, args[0]);
} else {
return members.get(name);
}
}
}));
}
代码示例来源:origin: org.sonatype.sisu/sisu-guice
private static <T extends Annotation> T generateAnnotationImpl(final Class<T> annotationType) {
final Map<String, Object> members = resolveMembers(annotationType);
return annotationType.cast(
Proxy.newProxyInstance(
annotationType.getClassLoader(),
new Class<?>[] {annotationType},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
String name = method.getName();
if (name.equals("annotationType")) {
return annotationType;
} else if (name.equals("toString")) {
return annotationToString(annotationType, members);
} else if (name.equals("hashCode")) {
return annotationHashCode(annotationType, members);
} else if (name.equals("equals")) {
return annotationEquals(annotationType, members, args[0]);
} else {
return members.get(name);
}
}
}));
}
代码示例来源:origin: org.xbib/guice
private static <T extends Annotation> T generateAnnotationImpl(final Class<T> annotationType) {
final Map<String, Object> members = resolveMembers(annotationType);
return annotationType.cast(Proxy.newProxyInstance(
annotationType.getClassLoader(),
new Class<?>[]{annotationType},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
String name = method.getName();
if (name.equals("annotationType")) {
return annotationType;
} else if (name.equals("toString")) {
return annotationToString(annotationType, members);
} else if (name.equals("hashCode")) {
return annotationHashCode(annotationType, members);
} else if (name.equals("equals")) {
return annotationEquals(annotationType, members, args[0]);
} else {
return members.get(name);
}
}
}));
}
代码示例来源:origin: com.jwebmp.inject/guice
private static <T extends Annotation> T generateAnnotationImpl(final Class<T> annotationType) {
final Map<String, Object> members = resolveMembers(annotationType);
return annotationType.cast(
Proxy.newProxyInstance(
annotationType.getClassLoader(),
new Class<?>[] {annotationType},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
String name = method.getName();
if (name.equals("annotationType")) {
return annotationType;
} else if (name.equals("toString")) {
return annotationToString(annotationType, members);
} else if (name.equals("hashCode")) {
return annotationHashCode(annotationType, members);
} else if (name.equals("equals")) {
return annotationEquals(annotationType, members, args[0]);
} else {
return members.get(name);
}
}
}));
}
内容来源于网络,如有侵权,请联系作者删除!