com.fasterxml.jackson.annotation.JsonTypeInfo#Id ( )源码实例Demo

下面列出了com.fasterxml.jackson.annotation.JsonTypeInfo#Id ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: StdTypeResolverBuilder.java
/**
 * @since 2.9
 */
protected StdTypeResolverBuilder(JsonTypeInfo.Id idType,
        JsonTypeInfo.As idAs, String propName) {
    _idType = idType;
    _includeAs = idAs;
    _typeProperty = propName;
}
 
源代码2 项目: lams   文件: StdTypeResolverBuilder.java
@Override
public StdTypeResolverBuilder init(JsonTypeInfo.Id idType, TypeIdResolver idRes)
{
    // sanity checks
    if (idType == null) {
        throw new IllegalArgumentException("idType cannot be null");
    }
    _idType = idType;
    _customIdResolver = idRes;
    // Let's also initialize property name as per idType default
    _typeProperty = idType.getDefaultPropertyName();
    return this;
}
 
源代码3 项目: haven-platform   文件: NodeMapping.java
private String getPropertyName(JsonTypeInfo typeInfo) {
    String property = typeInfo.property();
    if (property.isEmpty()) {
        JsonTypeInfo.Id use = typeInfo.use();
        property = use.getDefaultPropertyName();
    }
    return property;
}
 
源代码4 项目: haven-platform   文件: NodeMapping.java
private String getJsonType(Class<?> clazz, JsonTypeInfo typeInfo) {
    String value;
    JsonTypeInfo.Id use = typeInfo.use();
    switch (use) {
        case CLASS:
            value = clazz.getName();
            break;
        case NAME: {
            JsonSubTypes.Type needed = null;
            JsonSubTypes subTypes = AnnotationUtils.findAnnotation(clazz, JsonSubTypes.class);
            if(subTypes != null) {
                for(JsonSubTypes.Type type: subTypes.value()) {
                    if(type.value().equals(clazz)) {
                        needed = type;
                        break;
                    }
                }
            }
            if(needed == null) {
                throw new IllegalArgumentException("On " + clazz + " can not find 'JsonSubTypes' record for current type.");
            }
            value = needed.name();
            break;
        }
        default:
            throw new IllegalArgumentException("On " + clazz + " find unexpected 'JsonTypeInfo.use' value: " + use);
    }
    return value;
}
 
@Override
public JsonTypeInfo.Id getMechanism() {
	return JsonTypeInfo.Id.CUSTOM;
}
 
@Override
public JsonTypeInfo.Id getMechanism() {
	return JsonTypeInfo.Id.CUSTOM;
}
 
@Override
public JsonTypeInfo.Id getMechanism() {
	return JsonTypeInfo.Id.CUSTOM;
}
 
源代码8 项目: omise-java   文件: ModelTypeResolver.java
@Override
public JsonTypeInfo.Id getMechanism() {
    return JsonTypeInfo.Id.CUSTOM;
}
 
源代码9 项目: Cardshifter   文件: MessageTypeResolver.java
@Override
public JsonTypeInfo.Id getMechanism() {
    return JsonTypeInfo.Id.CUSTOM;
}
 
源代码10 项目: WavesJ   文件: DataEntryTypeResolver.java
@Override
public JsonTypeInfo.Id getMechanism() {
    return JsonTypeInfo.Id.CUSTOM;
}
 
源代码11 项目: spring-5-examples   文件: CustomClassIdResolver.java
@Override
public JsonTypeInfo.Id getMechanism() {
  return JsonTypeInfo.Id.CUSTOM;
}
 
@Override
public JsonTypeInfo.Id getMechanism() {
    return JsonTypeInfo.Id.CUSTOM;
}
 
public JsonTypeInfo.Id getMechanism() {
    return JsonTypeInfo.Id.NAME;
}
 
源代码14 项目: POC   文件: LowerCaseClassNameResolver.java
/** {@inheritDoc} */
@Override
public JsonTypeInfo.Id getMechanism() {
	return JsonTypeInfo.Id.CUSTOM;
}
 
源代码15 项目: lams   文件: TypeNameIdResolver.java
@Override
public JsonTypeInfo.Id getMechanism() { return JsonTypeInfo.Id.NAME; }
 
源代码16 项目: lams   文件: ClassNameIdResolver.java
@Override
public JsonTypeInfo.Id getMechanism() { return JsonTypeInfo.Id.CLASS; }
 
源代码17 项目: lams   文件: MinimalClassNameIdResolver.java
@Override
public JsonTypeInfo.Id getMechanism() { return JsonTypeInfo.Id.MINIMAL_CLASS; }
 
@Override
public JsonTypeInfo.Id getMechanism() {
	return JsonTypeInfo.Id.CUSTOM;
}
 
源代码19 项目: components   文件: NsTypeIdResolver.java
@Override
public JsonTypeInfo.Id getMechanism() {
    return JsonTypeInfo.Id.NAME;
}
 
源代码20 项目: haven-platform   文件: CustomTypeIdResolver.java
@Override
public JsonTypeInfo.Id getMechanism() {
    return JsonTypeInfo.Id.CLASS;
}