Java 类com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder 实例源码

项目:POL-POM-5    文件:DTOContractTest.java   
private static Optional<Constructor<?>> getConstructorHavingJsonBuilder(Class<?> clazz) {
    for (Constructor<?> constructor : clazz.getDeclaredConstructors()) {
        final List<Class<?>> parameterTypes = Arrays.stream(constructor.getParameterTypes())
                .filter(s -> s.getName().contains("Builder")).collect(Collectors.toList());

        if (parameterTypes.size() > 0) {
            final Annotation[] annotations = parameterTypes.get(0).getAnnotations();

            for (Annotation annotation : annotations) {
                if (annotation.annotationType() == JsonPOJOBuilder.class) {
                    return Optional.of(constructor);
                }
            }
        }
    }
    return Optional.empty();
}
项目:jacksonatic    文件:JacksonaticClassIntrospector.java   
protected POJOPropertiesCollector collectPropertiesWithBuilder(MapperConfig<?> config, JavaType type, MixInResolver r, boolean forSerialization) {
    boolean useAnnotations = config.isAnnotationProcessingEnabled();
    AnnotationIntrospector ai = useAnnotations ? config.getAnnotationIntrospector() : null;
    AnnotatedClass ac;
    if (forSerialization) {
        ac = annotatedClassConstructor.constructForSerialization(type.getRawClass(), ai, r);
    } else {
        ac = annotatedClassConstructor.constructForDeserialization(type.getRawClass(), ai, r);
    }
    JsonPOJOBuilder.Value builderConfig = (ai == null) ? null : ai.findPOJOBuilderConfig(ac);
    String mutatorPrefix = (builderConfig == null) ? "with" : builderConfig.withPrefix;
    return constructPropertyCollector(config, ac, type, forSerialization, mutatorPrefix).collect();
}
项目:QuizUpWinner    文件:JacksonAnnotationIntrospector.java   
public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass paramAnnotatedClass)
{
  JsonPOJOBuilder localJsonPOJOBuilder = (JsonPOJOBuilder)paramAnnotatedClass.getAnnotation(JsonPOJOBuilder.class);
  if (localJsonPOJOBuilder == null)
    return null;
  return new JsonPOJOBuilder.Value(localJsonPOJOBuilder);
}
项目:joyplus-tv    文件:AnnotationIntrospectorPair.java   
@Override
public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass ac)
{
    JsonPOJOBuilder.Value result = _primary.findPOJOBuilderConfig(ac);
    if (result == null) {
        result = _secondary.findPOJOBuilderConfig(ac);
    }
    return result;
}
项目:joyplus-tv    文件:BasicClassIntrospector.java   
protected POJOPropertiesCollector collectPropertiesWithBuilder(MapperConfig<?> config,
        JavaType type, MixInResolver r, boolean forSerialization)
{
    boolean useAnnotations = config.isAnnotationProcessingEnabled();
    AnnotationIntrospector ai = useAnnotations ? config.getAnnotationIntrospector() : null;
    AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), ai, r);
    JsonPOJOBuilder.Value builderConfig = (ai == null) ? null : ai.findPOJOBuilderConfig(ac);
    String mutatorPrefix = (builderConfig == null) ? "with" : builderConfig.withPrefix;
    return constructPropertyCollector(config, ac, type, forSerialization, mutatorPrefix).collect();
}
项目:joyplus-tv    文件:BasicBeanDescription.java   
@Override
public JsonPOJOBuilder.Value findPOJOBuilderConfig()
{
    return (_annotationIntrospector == null) ?
            null : _annotationIntrospector.findPOJOBuilderConfig(_classInfo);
}
项目:joyplus-tv    文件:BeanDeserializerBuilder.java   
public void setPOJOBuilder(AnnotatedMethod buildMethod,
        JsonPOJOBuilder.Value config) {
    _buildMethod = buildMethod;
    _builderConfig = config;
}
项目:joyplus-tv    文件:BeanDeserializerBuilder.java   
public JsonPOJOBuilder.Value getBuilderConfig() {
    return _builderConfig;
}
项目:joyplus-tv    文件:AnnotationIntrospector.java   
/**
 * @since 2.0
 */
public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass ac) {
    return null;
}
项目:joyplus-tv    文件:BeanDescription.java   
/**
 * Method for finding configuration for POJO Builder class.
 */
public abstract JsonPOJOBuilder.Value findPOJOBuilderConfig();