当前位置: 首页>>代码示例>>Java>>正文


Java JsonPOJOBuilder类代码示例

本文整理汇总了Java中com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder的典型用法代码示例。如果您正苦于以下问题:Java JsonPOJOBuilder类的具体用法?Java JsonPOJOBuilder怎么用?Java JsonPOJOBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JsonPOJOBuilder类属于com.fasterxml.jackson.databind.annotation包,在下文中一共展示了JsonPOJOBuilder类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConstructorHavingJsonBuilder

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
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();
}
 
开发者ID:PhoenicisOrg,项目名称:POL-POM-5,代码行数:18,代码来源:DTOContractTest.java

示例2: collectPropertiesWithBuilder

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
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();
}
 
开发者ID:mrenou,项目名称:jacksonatic,代码行数:14,代码来源:JacksonaticClassIntrospector.java

示例3: findPOJOBuilderConfig

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass paramAnnotatedClass)
{
  JsonPOJOBuilder localJsonPOJOBuilder = (JsonPOJOBuilder)paramAnnotatedClass.getAnnotation(JsonPOJOBuilder.class);
  if (localJsonPOJOBuilder == null)
    return null;
  return new JsonPOJOBuilder.Value(localJsonPOJOBuilder);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:8,代码来源:JacksonAnnotationIntrospector.java

示例4: findPOJOBuilderConfig

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
@Override
public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass ac)
{
    JsonPOJOBuilder.Value result = _primary.findPOJOBuilderConfig(ac);
    if (result == null) {
        result = _secondary.findPOJOBuilderConfig(ac);
    }
    return result;
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:10,代码来源:AnnotationIntrospectorPair.java

示例5: collectPropertiesWithBuilder

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
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();
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:11,代码来源:BasicClassIntrospector.java

示例6: findPOJOBuilderConfig

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
@Override
public JsonPOJOBuilder.Value findPOJOBuilderConfig()
{
    return (_annotationIntrospector == null) ?
            null : _annotationIntrospector.findPOJOBuilderConfig(_classInfo);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:7,代码来源:BasicBeanDescription.java

示例7: setPOJOBuilder

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
public void setPOJOBuilder(AnnotatedMethod buildMethod,
        JsonPOJOBuilder.Value config) {
	_buildMethod = buildMethod;
	_builderConfig = config;
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:6,代码来源:BeanDeserializerBuilder.java

示例8: getBuilderConfig

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
public JsonPOJOBuilder.Value getBuilderConfig() {
    return _builderConfig;
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:4,代码来源:BeanDeserializerBuilder.java

示例9: findPOJOBuilderConfig

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
/**
 * @since 2.0
 */
public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass ac) {
    return null;
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:7,代码来源:AnnotationIntrospector.java

示例10: findPOJOBuilderConfig

import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
/**
 * Method for finding configuration for POJO Builder class.
 */
public abstract JsonPOJOBuilder.Value findPOJOBuilderConfig();
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:5,代码来源:BeanDescription.java


注:本文中的com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。