类com.fasterxml.jackson.databind.util.Annotations源码实例Demo

下面列出了怎么用com.fasterxml.jackson.databind.util.Annotations的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: BeanProperty.java
/**
 * @deprecated Since 2.9
 */
@Deprecated
public Std(PropertyName name, JavaType type, PropertyName wrapperName,
        Annotations contextAnnotations,
        AnnotatedMember member, PropertyMetadata metadata)
{
    this(name, type, wrapperName, member, metadata);
}
 
源代码2 项目: lams   文件: BeanPropertyWriter.java
@Deprecated // Since 2.9
public BeanPropertyWriter(BeanPropertyDefinition propDef,
        AnnotatedMember member, Annotations contextAnnotations,
        JavaType declaredType,
        JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType,
        boolean suppressNulls, Object suppressableValue)
{
    this(propDef, member, contextAnnotations, declaredType,
            ser, typeSer, serType, suppressNulls, suppressableValue,
            null);
}
 
源代码3 项目: lams   文件: AttributePropertyWriter.java
protected AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef,
        Annotations contextAnnotations, JavaType declaredType,
        JsonInclude.Value inclusion)
{
    super(propDef, contextAnnotations, declaredType,
            /* value serializer */ null, /* type serializer */ null, /* ser type */ null,
            inclusion,
            // 10-Oct-2016, tatu: Could enable per-view settings too in future
            null);
    _attrName = attrName;
}
 
源代码4 项目: lams   文件: AttributePropertyWriter.java
public static AttributePropertyWriter construct(String attrName,
        BeanPropertyDefinition propDef,
        Annotations contextAnnotations,
        JavaType declaredType)
{
    return new AttributePropertyWriter(attrName, propDef,
            contextAnnotations, declaredType);
}
 
源代码5 项目: lams   文件: VirtualBeanPropertyWriter.java
/**
 * Constructor used by most sub-types.
 */
protected VirtualBeanPropertyWriter(BeanPropertyDefinition propDef,
        Annotations contextAnnotations, JavaType declaredType)
{
    this(propDef, contextAnnotations, declaredType, null, null, null,
            propDef.findInclusion());
}
 
源代码6 项目: lams   文件: VirtualBeanPropertyWriter.java
/**
 * Pass-through constructor that may be used by sub-classes that
 * want full control over implementation.
 */
protected VirtualBeanPropertyWriter(BeanPropertyDefinition propDef,
        Annotations contextAnnotations, JavaType declaredType,
        JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType,
        JsonInclude.Value inclusion, Class<?>[] includeInViews)
{
    super(propDef, propDef.getPrimaryMember(), contextAnnotations, declaredType,
            ser, typeSer, serType,
            _suppressNulls(inclusion), _suppressableValue(inclusion),
            includeInViews);
}
 
源代码7 项目: lams   文件: VirtualBeanPropertyWriter.java
@Deprecated // since 2.8
protected VirtualBeanPropertyWriter(BeanPropertyDefinition propDef,
        Annotations contextAnnotations, JavaType declaredType,
        JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType,
        JsonInclude.Value inclusion)
{
    this(propDef, contextAnnotations, declaredType, ser, typeSer, serType, inclusion, null);
}
 
源代码8 项目: lams   文件: AnnotatedClass.java
/**
 * Constructor will not do any initializations, to allow for
 * configuring instances differently depending on use cases
 *
 * @param type Fully resolved type; may be `null`, but ONLY if no member fields or
 *    methods are to be accessed
 * @param rawType Type-erased class; pass if no `type` needed or available
 */
AnnotatedClass(JavaType type, Class<?> rawType, List<JavaType> superTypes,
        Class<?> primaryMixIn, Annotations classAnnotations, TypeBindings bindings, 
        AnnotationIntrospector aintr, MixInResolver mir, TypeFactory tf)
{
    _type = type;
    _class = rawType;
    _superTypes = superTypes;
    _primaryMixIn = primaryMixIn;
    _classAnnotations = classAnnotations;
    _bindings = bindings;
    _annotationIntrospector = aintr;
    _mixInResolver = mir;
    _typeFactory = tf;
}
 
源代码9 项目: lams   文件: AnnotationCollector.java
@Override
public Annotations asAnnotations() {
    if (_annotations.size() == 2) {
        Iterator<Map.Entry<Class<?>,Annotation>> it = _annotations.entrySet().iterator();
        Map.Entry<Class<?>,Annotation> en1 = it.next(), en2 = it.next();
        return new TwoAnnotations(en1.getKey(), en1.getValue(),
                en2.getKey(), en2.getValue());
    }
    return new AnnotationMap(_annotations);
}
 
源代码10 项目: lams   文件: AnnotatedClassResolver.java
/**
 * Initialization method that will recursively collect Jackson
 * annotations for this class and all super classes and
 * interfaces.
 */
private Annotations resolveClassAnnotations(List<JavaType> superTypes)
{
    // Should skip processing if annotation processing disabled
    if (_intr == null) {
        return NO_ANNOTATIONS;
    }
    AnnotationCollector resolvedCA = AnnotationCollector.emptyCollector();
    // add mix-in annotations first (overrides)
    if (_primaryMixin != null) {
        resolvedCA = _addClassMixIns(resolvedCA, _class, _primaryMixin);
    }
    // then annotations from the class itself:
    resolvedCA = _addAnnotationsIfNotPresent(resolvedCA,
            ClassUtil.findClassAnnotations(_class));

    // and then from super types
    for (JavaType type : superTypes) {
        // and mix mix-in annotations in-between
        if (_mixInResolver != null) {
            Class<?> cls = type.getRawClass();
            resolvedCA = _addClassMixIns(resolvedCA, cls,
                    _mixInResolver.findMixInClassFor(cls));
        }
        resolvedCA = _addAnnotationsIfNotPresent(resolvedCA,
                ClassUtil.findClassAnnotations(type.getRawClass()));
    }
    /* and finally... any annotations there might be for plain
     * old Object.class: separate because for all other purposes
     * it is just ignored (not included in super types)
     */
    // 12-Jul-2009, tatu: Should this be done for interfaces too?
    //  For now, yes, seems useful for some cases, and not harmful for any?
    if (_mixInResolver != null) {
        resolvedCA = _addClassMixIns(resolvedCA, Object.class,
                _mixInResolver.findMixInClassFor(Object.class));
    }
    return resolvedCA.asAnnotations();
}
 
源代码11 项目: lams   文件: SettableBeanProperty.java
protected SettableBeanProperty(PropertyName propName, JavaType type, PropertyName wrapper,
        TypeDeserializer typeDeser, Annotations contextAnnotations,
        PropertyMetadata metadata)
{
    super(metadata);
    // 09-Jan-2009, tatu: Intern()ing makes sense since Jackson parsed
    //  field names are (usually) interned too, hence lookups will be faster.
    // 23-Oct-2009, tatu: should this be disabled wrt [JACKSON-180]?
    //   Probably need not, given that namespace of field/method names
    //   is not unbounded, unlike potential JSON names.
    if (propName == null) {
        _propName = PropertyName.NO_NAME;
    } else {
        _propName = propName.internSimpleName();
    }
    _type = type;
    _wrapperName = wrapper;
    _contextAnnotations = contextAnnotations;
    _viewMatcher = null;

    // 30-Jan-2012, tatu: Important: contextualize TypeDeserializer now...
    if (typeDeser != null) {
        typeDeser = typeDeser.forProperty(this);
    }
    _valueTypeDeserializer = typeDeser;
    _valueDeserializer = MISSING_VALUE_DESERIALIZER;
    _nullProvider = MISSING_VALUE_DESERIALIZER;
}
 
源代码12 项目: lams   文件: BeanDeserializerBuilder.java
public void addInjectable(PropertyName propName, JavaType propType,
        Annotations contextAnnotations, AnnotatedMember member,
        Object valueId)
{
    if (_injectables == null) {
        _injectables = new ArrayList<ValueInjector>();
    }
    boolean fixAccess = _config.canOverrideAccessModifiers();
    boolean forceAccess = fixAccess && _config.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS);
    if (fixAccess) {
        member.fixAccess(forceAccess);
    }
    _injectables.add(new ValueInjector(propName, propType, member, valueId));
}
 
源代码13 项目: lams   文件: FieldProperty.java
public FieldProperty(BeanPropertyDefinition propDef, JavaType type,
        TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedField field)
{
    super(propDef, type, typeDeser, contextAnnotations);
    _annotated = field;
    _field = field.getAnnotated();
    _skipNulls = NullsConstantProvider.isSkipper(_nullProvider);
}
 
源代码14 项目: lams   文件: MethodProperty.java
public MethodProperty(BeanPropertyDefinition propDef,
        JavaType type, TypeDeserializer typeDeser,
        Annotations contextAnnotations, AnnotatedMethod method)
{
    super(propDef, type, typeDeser, contextAnnotations);
    _annotated = method;
    _setter = method.getAnnotated();
    _skipNulls = NullsConstantProvider.isSkipper(_nullProvider);
}
 
源代码15 项目: lams   文件: SetterlessProperty.java
public SetterlessProperty(BeanPropertyDefinition propDef, JavaType type,
        TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedMethod method)
{
    super(propDef, type, typeDeser, contextAnnotations);
    _annotated = method;
    _getter = method.getAnnotated();
}
 
/**
 * This constructor should not be invoked directly and should only be used within
 * {@link #withConfig(MapperConfig, AnnotatedClass, BeanPropertyDefinition, JavaType)} call.
 *
 * @param propDef property definition created by {@code by com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector}
 * @param annotations contains only @JsonAppend at the moment
 * @param type {@link VirtualProperty}[]
 * @param virtualProperties {@link VirtualProperty}-ies to append
 * @param valueResolver {@link ValueResolver} dynamic variables resolver
 * @param filters {@link VirtualPropertyFilter} inclusion filters. Allow to include/exclude
 * {@link VirtualProperty} by name or value returned by {@link ValueResolver}
 */
VirtualPropertiesWriter(
        BeanPropertyDefinition propDef,
        Annotations annotations,
        JavaType type,
        VirtualProperty[] virtualProperties,
        ValueResolver valueResolver,
        VirtualPropertyFilter[] filters
) {
    super(propDef, annotations, type);
    this.virtualProperties = virtualProperties;
    this.valueResolver = valueResolver;
    this.filters = filters;
}
 
源代码17 项目: lams   文件: AttributePropertyWriter.java
protected AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef,
        Annotations contextAnnotations, JavaType declaredType) {
    this(attrName, propDef, contextAnnotations, declaredType, propDef.findInclusion());
}
 
源代码18 项目: lams   文件: BasicBeanDescription.java
@Override
public Annotations getClassAnnotations() {
    return _classInfo.getAnnotations();
}
 
源代码19 项目: lams   文件: AnnotatedClass.java
public Annotations getAnnotations() {
    return _classAnnotations;
}
 
源代码20 项目: lams   文件: AnnotationCollector.java
@Override
public Annotations asAnnotations() {
    return NO_ANNOTATIONS;
}
 
源代码21 项目: lams   文件: AnnotationCollector.java
@Override
public Annotations asAnnotations() {
    return new OneAnnotation(_type, _value);
}
 
源代码22 项目: lams   文件: SettableBeanProperty.java
protected SettableBeanProperty(BeanPropertyDefinition propDef,
        JavaType type, TypeDeserializer typeDeser, Annotations contextAnnotations)
{
    this(propDef.getFullName(), type, propDef.getWrapperName(), typeDeser,
            contextAnnotations, propDef.getMetadata());
}
 
private CustomVProperty(BeanPropertyDefinition propDef,
        Annotations ctxtAnn, JavaType type) {
    super(propDef, ctxtAnn, type);
}
 
源代码24 项目: jackson-modules-base   文件: JsonAppendTest.java
protected MyVirtualPropertyWriter(BeanPropertyDefinition propDef, Annotations contextAnnotations,
        JavaType declaredType) {
    super(propDef, contextAnnotations, declaredType);
}
 
源代码25 项目: lams   文件: CreatorProperty.java
/**
 * @param name Name of the logical property
 * @param type Type of the property, used to find deserializer
 * @param typeDeser Type deserializer to use for handling polymorphic type
 *    information, if one is needed
 * @param contextAnnotations Contextual annotations (usually by class that
 *    declares creator [constructor, factory method] that includes
 *    this property)
 * @param param Representation of property, constructor or factory
 *    method parameter; used for accessing annotations of the property
 * @param index Index of this property within creator invocation
 * 
 * @since 2.3
 */
public CreatorProperty(PropertyName name, JavaType type, PropertyName wrapperName,
        TypeDeserializer typeDeser,
        Annotations contextAnnotations, AnnotatedParameter param,
        int index, Object injectableValueId,
        PropertyMetadata metadata)
{
    super(name, type, wrapperName, typeDeser, contextAnnotations, metadata);
    _annotated = param;
    _creatorIndex = index;
    _injectableValueId = injectableValueId;
    _fallbackSetter = null;
}
 
/**
 *
 * @param propDef property definition created by {@code by com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector}
 * @param annotations contains only @JsonAppend at the moment
 * @param type {@link VirtualProperty}[]
 * @param virtualProperties {@link VirtualProperty}-ies to append
 * @param valueResolver {@link ValueResolver} dynamic variables resolver
 *
 * @deprecated This constructor should not be invoked directly and should only be used within
 * {@link #withConfig(MapperConfig, AnnotatedClass, BeanPropertyDefinition, JavaType)} call.
 * It will be removed in future releases.
 */
@Deprecated
public VirtualPropertiesWriter(
        BeanPropertyDefinition propDef,
        Annotations annotations,
        JavaType type,
        VirtualProperty[] virtualProperties,
        ValueResolver valueResolver
) {
    this(propDef, annotations, type, virtualProperties, valueResolver, new VirtualPropertyFilter[0]);
}
 
源代码27 项目: lams   文件: BeanDescription.java
/**
 * Method for accessing collection of annotations the bean
 * class has.
 */
public abstract Annotations getClassAnnotations();
 
源代码28 项目: lams   文件: AnnotationCollector.java
public static Annotations emptyAnnotations() { return NO_ANNOTATIONS; } 
源代码29 项目: lams   文件: AnnotationCollector.java
public abstract Annotations asAnnotations(); 
 同包方法