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

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

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

AnnotatedConstructor.getAnnotated介绍

暂无

代码示例

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

/**
 * Constructor used with JDK Serialization; needed to handle transient
 * Constructor, wrap/unwrap in/out-of Annotated variant.
 */
protected InnerClassProperty(SettableBeanProperty src, AnnotatedConstructor ann)
{
  super(src);
  _annotated = ann;
  _creator = (_annotated == null) ? null : _annotated.getAnnotated();
  if (_creator == null) {
    throw new IllegalArgumentException("Missing constructor (broken JDK (de)serialization?)");
  }
}

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

@Override
public Object instantiateBean(boolean fixAccess) {
  AnnotatedConstructor ac = _classInfo.getDefaultConstructor();
  if (ac == null) {
    return null;
  }
  if (fixAccess) {
    ac.fixAccess(_config.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS));
  }
  try {
    return ac.getAnnotated().newInstance();
  } catch (Exception e) {
    Throwable t = e;
    while (t.getCause() != null) {
      t = t.getCause();
    }
    ClassUtil.throwIfError(t);
    ClassUtil.throwIfRTE(t);
    throw new IllegalArgumentException("Failed to instantiate bean of type "
        +_classInfo.getAnnotated().getName()+": ("+t.getClass().getName()+") "
        +ClassUtil.exceptionMessage(t), t);
  }
}

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

@Override
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
{
  for (AnnotatedConstructor ac : _classInfo.getConstructors()) {
    // This list is already filtered to only include accessible
    /* (note: for now this is a redundant check; but in future
     * that may change; thus leaving here for now)
     */
    if (ac.getParameterCount() == 1) {
      Class<?> actArg = ac.getRawParameterType(0);
      for (Class<?> expArg : argTypes) {
        if (expArg == actArg) {
          return ac.getAnnotated();
        }
      }
    }
  }
  return null;
}

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

/**
 * Constructor used with JDK Serialization; needed to handle transient
 * Constructor, wrap/unwrap in/out-of Annotated variant.
 */
protected InnerClassProperty(SettableBeanProperty src, AnnotatedConstructor ann)
{
  super(src);
  _annotated = ann;
  _creator = (_annotated == null) ? null : _annotated.getAnnotated();
  if (_creator == null) {
    throw new IllegalArgumentException("Missing constructor (broken JDK (de)serialization?)");
  }
}

代码示例来源:origin: io.paradoxical/jackson-lombok

private ConstructorProperties getConstructorPropertiesAnnotation(AnnotatedConstructor annotatedConstructor) {
  Constructor<?> constructor = annotatedConstructor.getAnnotated();
  return constructor.getAnnotation(ConstructorProperties.class);
}

代码示例来源:origin: xebia/jackson-lombok

private ConstructorProperties getConstructorPropertiesAnnotation(AnnotatedConstructor annotatedConstructor) {
  Constructor<?> constructor = annotatedConstructor.getAnnotated();
  return constructor.getAnnotation(ConstructorProperties.class);
}

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

/**
 * Constructor used with JDK Serialization; needed to handle transient
 * Constructor, wrap/unwrap in/out-of Annotated variant.
 */
protected InnerClassProperty(InnerClassProperty src, AnnotatedConstructor ann)
{
  super(src);
  _delegate = src._delegate;
  _annotated = ann;
  _creator = (_annotated == null) ? null : _annotated.getAnnotated();
  if (_creator == null) {
    throw new IllegalArgumentException("Missing constructor (broken JDK (de)serialization?)");
  }
}

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

/**
 * Constructor used with JDK Serialization; needed to handle transient
 * Constructor, wrap/unwrap in/out-of Annotated variant.
 */
protected InnerClassProperty(InnerClassProperty src, AnnotatedConstructor ann)
{
  super(src);
  _delegate = src._delegate;
  _annotated = ann;
  _creator = (_annotated == null) ? null : _annotated.getAnnotated();
  if (_creator == null) {
    throw new IllegalArgumentException("Missing constructor (broken JDK (de)serialization?)");
  }
}

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

/**
 * Constructor used with JDK Serialization; needed to handle transient
 * Constructor, wrap/unwrap in/out-of Annotated variant.
 */
protected InnerClassProperty(InnerClassProperty src, AnnotatedConstructor ann)
{
  super(src);
  _delegate = src._delegate;
  _annotated = ann;
  _creator = (_annotated == null) ? null : _annotated.getAnnotated();
  if (_creator == null) {
    throw new IllegalArgumentException("Missing constructor (broken JDK (de)serialization?)");
  }
}

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

@Override
public Object instantiateBean(boolean fixAccess)
{
  AnnotatedConstructor ac = _classInfo.getDefaultConstructor();
  if (ac == null) {
    return null;
  }
  if (fixAccess) {
    ac.fixAccess();
  }
  try {
    return ac.getAnnotated().newInstance();
  } catch (Exception e) {
    Throwable t = e;
    while (t.getCause() != null) {
      t = t.getCause();
    }
    if (t instanceof Error) throw (Error) t;
    if (t instanceof RuntimeException) throw (RuntimeException) t;
    throw new IllegalArgumentException("Failed to instantiate bean of type "+_classInfo.getAnnotated().getName()+": ("+t.getClass().getName()+") "+t.getMessage(), t);
  }
}

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

@Override
public Object instantiateBean(boolean fixAccess)
{
  AnnotatedConstructor ac = _classInfo.getDefaultConstructor();
  if (ac == null) {
    return null;
  }
  if (fixAccess) {
    ac.fixAccess();
  }
  try {
    return ac.getAnnotated().newInstance();
  } catch (Exception e) {
    Throwable t = e;
    while (t.getCause() != null) {
      t = t.getCause();
    }
    if (t instanceof Error) throw (Error) t;
    if (t instanceof RuntimeException) throw (RuntimeException) t;
    throw new IllegalArgumentException("Failed to instantiate bean of type "+_classInfo.getAnnotated().getName()+": ("+t.getClass().getName()+") "+t.getMessage(), t);
  }
}

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

@Override
public Object instantiateBean(boolean fixAccess)
{
  AnnotatedConstructor ac = _classInfo.getDefaultConstructor();
  if (ac == null) {
    return null;
  }
  if (fixAccess) {
    ac.fixAccess();
  }
  try {
    return ac.getAnnotated().newInstance();
  } catch (Exception e) {
    Throwable t = e;
    while (t.getCause() != null) {
      t = t.getCause();
    }
    if (t instanceof Error) throw (Error) t;
    if (t instanceof RuntimeException) throw (RuntimeException) t;
    throw new IllegalArgumentException("Failed to instantiate bean of type "+_classInfo.getAnnotated().getName()+": ("+t.getClass().getName()+") "+t.getMessage(), t);
  }
}

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

@Override
public Object instantiateBean(boolean fixAccess) {
  AnnotatedConstructor ac = _classInfo.getDefaultConstructor();
  if (ac == null) {
    return null;
  }
  if (fixAccess) {
    ac.fixAccess(_config.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS));
  }
  try {
    return ac.getAnnotated().newInstance();
  } catch (Exception e) {
    Throwable t = e;
    while (t.getCause() != null) {
      t = t.getCause();
    }
    if (t instanceof Error) throw (Error) t;
    if (t instanceof RuntimeException) throw (RuntimeException) t;
    throw new IllegalArgumentException("Failed to instantiate bean of type "+_classInfo.getAnnotated().getName()+": ("+t.getClass().getName()+") "+t.getMessage(), t);
  }
}

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

private Parameter[] getParameters(AnnotatedWithParams owner) {
  if (owner instanceof AnnotatedConstructor) {
    return parameterExtractor.getParameters(((AnnotatedConstructor) owner).getAnnotated());
  }
  if (owner instanceof AnnotatedMethod) {
    return parameterExtractor.getParameters(((AnnotatedMethod) owner).getAnnotated());
  }
  return null;
}

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

@Override
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
{
  for (AnnotatedConstructor ac : _classInfo.getConstructors()) {
    // This list is already filtered to only include accessible
    /* (note: for now this is a redundant check; but in future
     * that may change; thus leaving here for now)
     */
    if (ac.getParameterCount() == 1) {
      Class<?> actArg = ac.getRawParameterType(0);
      for (Class<?> expArg : argTypes) {
        if (expArg == actArg) {
          return ac.getAnnotated();
        }
      }
    }
  }
  return null;
}

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

@Override
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
{
  for (AnnotatedConstructor ac : _classInfo.getConstructors()) {
    // This list is already filtered to only include accessible
    /* (note: for now this is a redundant check; but in future
     * that may change; thus leaving here for now)
     */
    if (ac.getParameterCount() == 1) {
      Class<?> actArg = ac.getRawParameterType(0);
      for (Class<?> expArg : argTypes) {
        if (expArg == actArg) {
          return ac.getAnnotated();
        }
      }
    }
  }
  return null;
}

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

@Override
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
{
  for (AnnotatedConstructor ac : _classInfo.getConstructors()) {
    // This list is already filtered to only include accessible
    /* (note: for now this is a redundant check; but in future
     * that may change; thus leaving here for now)
     */
    if (ac.getParameterCount() == 1) {
      Class<?> actArg = ac.getRawParameterType(0);
      for (Class<?> expArg : argTypes) {
        if (expArg == actArg) {
          return ac.getAnnotated();
        }
      }
    }
  }
  return null;
}

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

@Override
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
{
  for (AnnotatedConstructor ac : _classInfo.getConstructors()) {
    // This list is already filtered to only include accessible
    /* (note: for now this is a redundant check; but in future
     * that may change; thus leaving here for now)
     */
    if (ac.getParameterCount() == 1) {
      Class<?> actArg = ac.getRawParameterType(0);
      for (Class<?> expArg : argTypes) {
        if (expArg == actArg) {
          return ac.getAnnotated();
        }
      }
    }
  }
  return null;
}

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

@Override
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
{
  for (AnnotatedConstructor ac : _classInfo.getConstructors()) {
    // This list is already filtered to only include accessible
    /* (note: for now this is a redundant check; but in future
     * that may change; thus leaving here for now)
     */
    if (ac.getParameterCount() == 1) {
      Class<?> actArg = ac.getRawParameterType(0);
      for (Class<?> expArg : argTypes) {
        if (expArg == actArg) {
          return ac.getAnnotated();
        }
      }
    }
  }
  return null;
}

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

@Override
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
{
  for (AnnotatedConstructor ac : _classInfo.getConstructors()) {
    // This list is already filtered to only include accessible
    /* (note: for now this is a redundant check; but in future
     * that may change; thus leaving here for now)
     */
    if (ac.getParameterCount() == 1) {
      Class<?> actArg = ac.getRawParameterType(0);
      for (Class<?> expArg : argTypes) {
        if (expArg == actArg) {
          return ac.getAnnotated();
        }
      }
    }
  }
  return null;
}

相关文章