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

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

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

Annotated.getGenericType介绍

[英]JDK declared generic type of the annotated element; definition of what exactly this means depends on sub-class. Note that such type cannot be reliably resolved without TypeResolutionContext, and as a result use of this method was deprecated in Jackson 2.7: see #getType for replacement.
[中]JDK声明了注释元素的泛型类型;定义这到底意味着什么取决于子类。请注意,如果没有TypeResolutionContext,则无法可靠地解析此类类型,因此Jackson 2.7中不推荐使用此方法:请参见#getType for replacement。

代码示例

代码示例来源:origin: br.com.anteros/Anteros-Persistence-Serialization

@Override
public Type getGenericType() {
  return annotated.getGenericType();
}

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

private Type getTypeForAnnotated(Annotated a) {
  if (a instanceof AnnotatedMethod) {
    return ((AnnotatedMethod) a).getGenericParameterType(0);
  } else {
    return a.getGenericType();
  }
}

代码示例来源:origin: com.hubspot.rosetta/RosettaCore

private Type getType(Annotated a) {
  try {
   // Jackson 2.7+
   return a.getType();
  } catch (Throwable t) {
   return a.getGenericType();
  }
 }
}

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

/**
 * Full generic type of the annotated element; definition
 * of what exactly this means depends on sub-class.
 */
public JavaType getType(TypeBindings context) {
  return context.resolveType(getGenericType());
}

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

/**
 * Full generic type of the annotated element; definition
 * of what exactly this means depends on sub-class.
 */
public JavaType getType(TypeBindings context) {
  return context.resolveType(getGenericType());
}

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

/**
 * Full generic type of the annotated element; definition
 * of what exactly this means depends on sub-class.
 */
public JavaType getType(TypeBindings context) {
  return context.resolveType(getGenericType());
}

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

/**
 * Full generic type of the annotated element; definition
 * of what exactly this means depends on sub-class.
 */
public JavaType getType(TypeBindings context) {
  return context.resolveType(getGenericType());
}

相关文章