本文整理了Java中java.lang.annotation.Annotation
类的一些代码示例,展示了Annotation
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation
类的具体详情如下:
包路径:java.lang.annotation.Annotation
类名称:Annotation
[英]Defines the interface implemented by all annotations. Note that the interface itself is not an annotation, and neither is an interface that simply extends this one. Only the compiler is able to create proper annotation types.
[中]定义由所有注释实现的接口。请注意,接口本身不是注释,也不是简单扩展此注释的接口。只有编译器才能创建正确的注释类型。
代码示例来源:origin: spring-projects/spring-framework
public Class<? extends Annotation> getAnnotationType() {
return this.annotation.annotationType();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public String toString() {
return this.annotation.toString();
}
}
代码示例来源:origin: prestodb/presto
protected final boolean _add(Annotation ann) {
if (_annotations == null) {
_annotations = new HashMap<Class<?>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous == null) || !previous.equals(ann);
}
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
AnnotationConverterKey otherKey = (AnnotationConverterKey) other;
return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation));
}
代码示例来源:origin: redisson/redisson
/**
* {@inheritDoc}
*/
public boolean represents(Object value) {
return annotation.equals(value);
}
代码示例来源:origin: libgdx/libgdx
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () {
return annotation.annotationType();
}
}
代码示例来源:origin: redisson/redisson
protected final boolean _add(Annotation ann) {
if (_annotations == null) {
_annotations = new HashMap<Class<?>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous == null) || !previous.equals(ann);
}
}
代码示例来源:origin: org.springframework/spring-context
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
AnnotationConverterKey otherKey = (AnnotationConverterKey) other;
return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation));
}
代码示例来源:origin: redisson/redisson
@Override
public String toString() {
return annotation.toString();
}
}
代码示例来源:origin: libgdx/libgdx
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () {
return annotation.annotationType();
}
}
代码示例来源:origin: spring-projects/spring-framework
private boolean annotationEquals(Annotation ann, Annotation otherAnn) {
// Annotation.equals is reflective and pretty slow, so let's check identity and proxy type first.
return (ann == otherAnn || (ann.getClass() == otherAnn.getClass() && ann.equals(otherAnn)));
}
代码示例来源:origin: libgdx/libgdx
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () {
return annotation.annotationType();
}
}
代码示例来源:origin: redisson/redisson
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (!(other instanceof AnnotationValue.Loaded<?>)) {
return false;
}
AnnotationValue.Loaded<?> annotationValue = (AnnotationValue.Loaded<?>) other;
return annotationValue.getState().isResolved() && annotation.equals(annotationValue.resolve());
}
代码示例来源:origin: libgdx/libgdx
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () {
return annotation.annotationType();
}
}
代码示例来源:origin: redisson/redisson
/**
* Creates a new annotation description for a loaded annotation.
*
* @param annotation The annotation to represent.
*/
@SuppressWarnings("unchecked")
protected ForLoadedAnnotation(S annotation) {
this(annotation, (Class<S>) annotation.annotationType());
}
代码示例来源:origin: prestodb/presto
@Override
public boolean isPresent(Annotation ann) {
return ann.annotationType() == _type;
}
代码示例来源:origin: redisson/redisson
@Override
public boolean isPresent(Annotation ann) {
return ann.annotationType() == _type;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@SuppressWarnings("unchecked")
@Nullable
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
for (Annotation ann : annotations) {
if (ann.annotationType() == annotationClass) {
return (T) ann;
}
}
return null;
}
@Override
代码示例来源:origin: spring-projects/spring-framework
/**
* Construct a new {@code DefaultAnnotationAttributeExtractor}.
* @param annotation the annotation to synthesize; never {@code null}
* @param annotatedElement the element that is annotated with the supplied
* annotation; may be {@code null} if unknown
*/
DefaultAnnotationAttributeExtractor(Annotation annotation, @Nullable Object annotatedElement) {
super(annotation.annotationType(), annotatedElement, annotation);
}
代码示例来源:origin: spring-projects/spring-framework
@Nullable
public Class<? extends Annotation> getComposedAnnotationType() {
return (this.composedAnnotation != null ? this.composedAnnotation.annotationType() : null);
}
内容来源于网络,如有侵权,请联系作者删除!