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

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

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

AnnotatedMember.addOrOverride介绍

[英]Method called to override an annotation, usually due to a mix-in annotation masking or overriding an annotation 'real' constructor has.
[中]方法来重写注释,通常是由于注释掩蔽或重写注释“real”构造函数中的混合。

代码示例

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

private void _addOrOverrideAnnotations(AnnotatedMember target, Annotation[] anns)
{
  if (anns != null) {
    List<Annotation[]> bundles = null;
    for (Annotation ann : anns) { // first: direct annotations
      if (_isAnnotationBundle(ann)) {
        if (bundles == null) {
          bundles = new LinkedList<Annotation[]>();
        }
        bundles.add(ann.annotationType().getDeclaredAnnotations());
      } else { // note: no filtering by jackson-annotations
        target.addOrOverride(ann);
      }
    }
    if (bundles != null) { // and then bundles, if any: important for precedence
      for (Annotation[] annotations : bundles) {
        _addOrOverrideAnnotations(target, annotations);
      }
    }
  }
}

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

private void _addOrOverrideAnnotations(AnnotatedMember target, Annotation[] anns)
{
  if (anns != null) {
    List<Annotation[]> bundles = null;
    for (Annotation ann : anns) { // first: direct annotations
      if (_isAnnotationBundle(ann)) {
        if (bundles == null) {
          bundles = new LinkedList<Annotation[]>();
        }
        bundles.add(ann.annotationType().getDeclaredAnnotations());
      } else { // note: no filtering by jackson-annotations
        target.addOrOverride(ann);
      }
    }
    if (bundles != null) { // and then bundles, if any: important for precedence
      for (Annotation[] annotations : bundles) {
        _addOrOverrideAnnotations(target, annotations);
      }
    }
  }
}

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

private void _addOrOverrideAnnotations(AnnotatedMember target, Annotation[] anns)
{
  if (anns != null) {
    List<Annotation> fromBundles = null;
    for (Annotation ann : anns) { // first: direct annotations
      boolean wasModified = target.addOrOverride(ann);
      if (wasModified && _isAnnotationBundle(ann)) {
        fromBundles = _addFromBundle(ann, fromBundles);
      }
    }
    if (fromBundles != null) { // and then bundles, if any: important for precedence
      _addOrOverrideAnnotations(target, fromBundles.toArray(new Annotation[fromBundles.size()]));
    }
  }
}

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

private void _addOrOverrideAnnotations(AnnotatedMember target, Annotation[] anns)
{
  if (anns != null) {
    List<Annotation> fromBundles = null;
    for (Annotation ann : anns) { // first: direct annotations
      boolean wasModified = target.addOrOverride(ann);
      if (wasModified && _isAnnotationBundle(ann)) {
        fromBundles = _addFromBundle(ann, fromBundles);
      }
    }
    if (fromBundles != null) { // and then bundles, if any: important for precedence
      _addOrOverrideAnnotations(target, fromBundles.toArray(new Annotation[fromBundles.size()]));
    }
  }
}

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

private void _addOrOverrideAnnotations(AnnotatedMember target, Annotation[] anns)
{
  if (anns != null) {
    List<Annotation> fromBundles = null;
    for (Annotation ann : anns) { // first: direct annotations
      boolean wasModified = target.addOrOverride(ann);
      if (wasModified && _isAnnotationBundle(ann)) {
        fromBundles = _addFromBundle(ann, fromBundles);
      }
    }
    if (fromBundles != null) { // and then bundles, if any: important for precedence
      _addOrOverrideAnnotations(target, fromBundles.toArray(new Annotation[fromBundles.size()]));
    }
  }
}

相关文章