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

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

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

AnnotatedMember.getGenericType介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-druid

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

  Annotation guiceAnnotation = null;
  for (Annotation annotation : m.annotations()) {
   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: com.eclipsesource.jaxrs/jersey-all

/**
 * @since 2.1.2
 */
protected JavaType _fullSerializationType(AnnotatedMember am)
{
  return getTypeFactory().constructType(am.getGenericType(),
      am.getDeclaringClass());
}

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

/**
 * @since 2.1.2
 */
protected JavaType _fullSerializationType(AnnotatedMember am)
{
  return getTypeFactory().constructType(am.getGenericType(),
      am.getDeclaringClass());
}

代码示例来源: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: org.apache.druid/druid-common

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

  Annotation guiceAnnotation = null;
  for (Annotation annotation : m.annotations()) {
   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: com.eclipsesource.jaxrs/jersey-all

/**
 * @since 2.1.2
 */
protected JavaType _fullDeserializationType(AnnotatedMember am)
{
  if (am instanceof AnnotatedMethod) {
    AnnotatedMethod method = (AnnotatedMethod) am;
    // 27-Nov-2012, tatu: Bit nasty, as we are assuming
    //    things about method signatures here... but has to do
    if (method.getParameterCount() == 1) {
      return getTypeFactory().constructType(((AnnotatedMethod) am).getGenericParameterType(0),
          am.getDeclaringClass());
    }
  }
  return getTypeFactory().constructType(am.getGenericType(),
      am.getDeclaringClass());
}

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

/**
 * @since 2.1.2
 */
protected JavaType _fullDeserializationType(AnnotatedMember am)
{
  if (am instanceof AnnotatedMethod) {
    AnnotatedMethod method = (AnnotatedMethod) am;
    // 27-Nov-2012, tatu: Bit nasty, as we are assuming
    //    things about method signatures here... but has to do
    if (method.getParameterCount() == 1) {
      return getTypeFactory().constructType(((AnnotatedMethod) am).getGenericParameterType(0),
          am.getDeclaringClass());
    }
  }
  return getTypeFactory().constructType(am.getGenericType(),
      am.getDeclaringClass());
}

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

/**
 * Method called locate all members used for value injection (if any),
 * constructor {@link com.fasterxml.jackson.databind.deser.impl.ValueInjector} instances, and add them to builder.
 */
protected void addInjectables(DeserializationContext ctxt,
    BeanDescription beanDesc, BeanDeserializerBuilder builder)
  throws JsonMappingException
{
  Map<Object, AnnotatedMember> raw = beanDesc.findInjectables();
  if (raw != null) {
    boolean fixAccess = ctxt.canOverrideAccessModifiers();
    for (Map.Entry<Object, AnnotatedMember> entry : raw.entrySet()) {
      AnnotatedMember m = entry.getValue();
      if (fixAccess) {
        m.fixAccess(); // to ensure we can call it
      }
      builder.addInjectable(m.getName(), beanDesc.resolveType(m.getGenericType()),
          beanDesc.getClassAnnotations(), m, entry.getKey());
    }
  }
}

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

/**
 * Method called locate all members used for value injection (if any),
 * constructor {@link com.fasterxml.jackson.databind.deser.impl.ValueInjector} instances, and add them to builder.
 */
protected void addInjectables(DeserializationContext ctxt,
    BeanDescription beanDesc, BeanDeserializerBuilder builder)
  throws JsonMappingException
{
  Map<Object, AnnotatedMember> raw = beanDesc.findInjectables();
  if (raw != null) {
    boolean fixAccess = ctxt.canOverrideAccessModifiers();
    for (Map.Entry<Object, AnnotatedMember> entry : raw.entrySet()) {
      AnnotatedMember m = entry.getValue();
      if (fixAccess) {
        m.fixAccess(); // to ensure we can call it
      }
      builder.addInjectable(m.getName(), beanDesc.resolveType(m.getGenericType()),
          beanDesc.getClassAnnotations(), m, entry.getKey());
    }
  }
}

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

/**
 * Method called locate all members used for value injection (if any),
 * constructor {@link com.fasterxml.jackson.databind.deser.impl.ValueInjector} instances, and add them to builder.
 */
protected void addInjectables(DeserializationContext ctxt,
    BeanDescription beanDesc, BeanDeserializerBuilder builder)
  throws JsonMappingException
{
  Map<Object, AnnotatedMember> raw = beanDesc.findInjectables();
  if (raw != null) {
    boolean fixAccess = ctxt.canOverrideAccessModifiers();
    for (Map.Entry<Object, AnnotatedMember> entry : raw.entrySet()) {
      AnnotatedMember m = entry.getValue();
      if (fixAccess) {
        m.fixAccess(); // to ensure we can call it
      }
      builder.addInjectable(new PropertyName(m.getName()),
          beanDesc.resolveType(m.getGenericType()),
          beanDesc.getClassAnnotations(), m, entry.getKey());
    }
  }
}

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

/**
 * Method called locate all members used for value injection (if any),
 * constructor {@link com.fasterxml.jackson.databind.deser.impl.ValueInjector} instances, and add them to builder.
 */
protected void addInjectables(DeserializationContext ctxt,
    BeanDescription beanDesc, BeanDeserializerBuilder builder)
  throws JsonMappingException
{
  Map<Object, AnnotatedMember> raw = beanDesc.findInjectables();
  if (raw != null) {
    boolean fixAccess = ctxt.canOverrideAccessModifiers();
    for (Map.Entry<Object, AnnotatedMember> entry : raw.entrySet()) {
      AnnotatedMember m = entry.getValue();
      if (fixAccess) {
        m.fixAccess(); // to ensure we can call it
      }
      builder.addInjectable(new PropertyName(m.getName()),
          beanDesc.resolveType(m.getGenericType()),
          beanDesc.getClassAnnotations(), m, entry.getKey());
    }
  }
}

相关文章