com.fasterxml.jackson.databind.introspect.AnnotatedMember.getAllAnnotations()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中com.fasterxml.jackson.databind.introspect.AnnotatedMember.getAllAnnotations()方法的一些代码示例,展示了AnnotatedMember.getAllAnnotations()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AnnotatedMember.getAllAnnotations()方法的具体详情如下:
包路径:com.fasterxml.jackson.databind.introspect.AnnotatedMember
类名称:AnnotatedMember
方法名:getAllAnnotations

AnnotatedMember.getAllAnnotations介绍

[英]NOTE: promoted in 2.9 from Annotated up
[中]注:在2.9中从注释'升级到注释'

代码示例

代码示例来源:origin: redisson/redisson

/**
 * Replacement, as per [databind#868], of simple access to annotations, which
 * does "deep merge" if an as necessary.
 *<pre>
 * nodes[index].value.getAllAnnotations()
 *</pre>
 * 
 * @since 2.6
 */
private <T extends AnnotatedMember> AnnotationMap _getAllAnnotations(Linked<T> node) {
  AnnotationMap ann = node.value.getAllAnnotations();
  if (node.next != null) {
    ann = AnnotationMap.merge(ann, _getAllAnnotations(node.next));
  }
  return ann;
}

代码示例来源:origin: leangen/graphql-spqr

private Annotation[] annotations(BeanProperty beanProperty) {
  if (beanProperty == null) {
    return new Annotation[0];
  }
  List<Annotation> annotations = new ArrayList<>();
  beanProperty.getMember().getAllAnnotations().annotations().forEach(annotations::add);
  return annotations.toArray(new Annotation[0]);
}

代码示例来源:origin: com.fasterxml.jackson.core/com.springsource.com.fasterxml.jackson.core.jackson-databind

private AnnotationMap _mergeAnnotations(int index, Linked<? extends AnnotatedMember>... nodes)
{
  AnnotationMap ann = nodes[index].value.getAllAnnotations();
  ++index;
  for (; index < nodes.length; ++index) {
    if (nodes[index] != null) {
     return AnnotationMap.merge(ann, _mergeAnnotations(index, nodes));
    }
  }
  return ann;
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

private AnnotationMap _mergeAnnotations(int index, Linked<? extends AnnotatedMember>... nodes)
{
  AnnotationMap ann = nodes[index].value.getAllAnnotations();
  ++index;
  for (; index < nodes.length; ++index) {
    if (nodes[index] != null) {
     return AnnotationMap.merge(ann, _mergeAnnotations(index, nodes));
    }
  }
  return ann;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

private AnnotationMap _mergeAnnotations(int index, Linked<? extends AnnotatedMember>... nodes)
{
  AnnotationMap ann = nodes[index].value.getAllAnnotations();
  ++index;
  for (; index < nodes.length; ++index) {
    if (nodes[index] != null) {
     return AnnotationMap.merge(ann, _mergeAnnotations(index, nodes));
    }
  }
  return ann;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

private AnnotationMap _mergeAnnotations(int index, Linked<? extends AnnotatedMember>... nodes)
{
  AnnotationMap ann = nodes[index].value.getAllAnnotations();
  ++index;
  for (; index < nodes.length; ++index) {
    if (nodes[index] != null) {
     return AnnotationMap.merge(ann, _mergeAnnotations(index, nodes));
    }
  }
  return ann;
}

代码示例来源:origin: com.jwebmp.jackson.core/jackson-databind

/**
 * Replacement, as per [databind#868], of simple access to annotations, which
 * does "deep merge" if an as necessary.
 *<pre>
 * nodes[index].value.getAllAnnotations()
 *</pre>
 * 
 * @since 2.6
 */
private <T extends AnnotatedMember> AnnotationMap _getAllAnnotations(Linked<T> node) {
  AnnotationMap ann = node.value.getAllAnnotations();
  if (node.next != null) {
    ann = AnnotationMap.merge(ann, _getAllAnnotations(node.next));
  }
  return ann;
}

代码示例来源:origin: Nextdoor/bender

/**
 * Replacement, as per [databind#868], of simple access to annotations, which
 * does "deep merge" if an as necessary.
 *<pre>
 * nodes[index].value.getAllAnnotations()
 *</pre>
 * 
 * @since 2.6
 */
private <T extends AnnotatedMember> AnnotationMap _getAllAnnotations(Linked<T> node) {
  AnnotationMap ann = node.value.getAllAnnotations();
  if (node.next != null) {
    ann = AnnotationMap.merge(ann, _getAllAnnotations(node.next));
  }
  return ann;
}

代码示例来源:origin: com.n3twork.druid/druid-common

@Override
 public Object findInjectableValueId(AnnotatedMember m)
 {
  if (m.getAnnotation(JacksonInject.class) == null) {
   return null;
  }

  Annotation guiceAnnotation = null;
  for (Annotation annotation : m.getAllAnnotations()._annotations.values()) {
   if (annotation.annotationType().isAnnotationPresent(BindingAnnotation.class)) {
    guiceAnnotation = annotation;
    break;
   }
  }

  if (guiceAnnotation == null) {
   if (m instanceof AnnotatedMethod) {
    throw new IAE("Annotated methods don't work very well yet...");
   }
   return Key.get(m.getGenericType());
  }
  return Key.get(m.getGenericType(), guiceAnnotation);
 }
}

代码示例来源:origin: FasterXML/jackson-modules-base

AnnotationMap anns = ((AnnotatedMember) m).getAllAnnotations();
  guiceAnnotation = findBindingAnnotation(anns.annotations());
} else if (m instanceof AnnotatedMethod) {

代码示例来源:origin: com.fasterxml.jackson.module/jackson-module-guice

AnnotationMap anns = ((AnnotatedMember) m).getAllAnnotations();
  guiceAnnotation = findBindingAnnotation(anns.annotations());
} else if (m instanceof AnnotatedMethod) {

相关文章