本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例6: findPOJOBuilderConfig
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
@Override
public JsonPOJOBuilder.Value findPOJOBuilderConfig()
{
return (_annotationIntrospector == null) ?
null : _annotationIntrospector.findPOJOBuilderConfig(_classInfo);
}
示例7: setPOJOBuilder
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
public void setPOJOBuilder(AnnotatedMethod buildMethod,
JsonPOJOBuilder.Value config) {
_buildMethod = buildMethod;
_builderConfig = config;
}
示例8: getBuilderConfig
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
public JsonPOJOBuilder.Value getBuilderConfig() {
return _builderConfig;
}
示例9: findPOJOBuilderConfig
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
/**
* @since 2.0
*/
public JsonPOJOBuilder.Value findPOJOBuilderConfig(AnnotatedClass ac) {
return null;
}
示例10: findPOJOBuilderConfig
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; //导入依赖的package包/类
/**
* Method for finding configuration for POJO Builder class.
*/
public abstract JsonPOJOBuilder.Value findPOJOBuilderConfig();