Java 类com.fasterxml.jackson.databind.DatabindContext 实例源码

项目:OHMS    文件:OdataTypeResolver.java   
@Override
public JavaType typeFromId( DatabindContext context, String id )
{
    JavaType detectedClass = tryMatchRedfishResource( id );
    if ( detectedClass != null )
    {
        return detectedClass;
    }

    detectedClass = tryMatchRedfishCollection( id );
    if ( detectedClass != null )
    {
        return detectedClass;
    }

    throw new UnsupportedOperationException(
        "Could not determine class to deserialize into for \"@odata.type\": \"" + id + "\"" );
}
项目:registry    文件:Schema.java   
@Override
public JavaType typeFromId(DatabindContext databindContext, String s) {
    Type fieldType = Schema.Type.valueOf(s);
    JavaType javaType;
    switch (fieldType) {
        case NESTED:
            javaType = TypeFactory.defaultInstance().constructType(NestedField.class);
            break;
        case ARRAY:
            javaType = TypeFactory.defaultInstance().constructType(ArrayField.class);
            break;
        default:
            javaType = TypeFactory.defaultInstance().constructType(Field.class);
    }
    return javaType;
}
项目:credhub    文件:GenerateRequestTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) throws IOException {
  Class<?> subType = DefaultCredentialGenerateRequest.class;

  switch (id.toLowerCase()) {
    case CertificateCredentialVersionData.CREDENTIAL_TYPE:
      subType = CertificateGenerateRequest.class;
      break;
    case PasswordCredentialVersionData.CREDENTIAL_TYPE:
      subType = PasswordGenerateRequest.class;
      break;
    case RsaCredentialVersionData.CREDENTIAL_TYPE:
      subType = RsaGenerateRequest.class;
      break;
    case SshCredentialVersionData.CREDENTIAL_TYPE:
      subType = SshGenerateRequest.class;
      break;
    case UserCredentialVersionData.CREDENTIAL_TYPE:
      subType = UserGenerateRequest.class;
      break;
  }

  return context.constructSpecializedType(baseType, subType);
}
项目:secucard-connect-java-sdk    文件:ObjectIdTypeResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
  DeserializationContext ctx = (DeserializationContext) context;
  Map<String, Class> map = (Map) ctx.getAttribute("secucardobjectmap");

  Class type = map.get(id);

  JavaType javatype;
  if (type == null) {
    javatype = MapType.construct(HashMap.class, SimpleType.construct(String.class), SimpleType.construct(Object.class));
  } else {
    javatype = SimpleType.construct(type);
  }

  if (JsonToken.END_ARRAY.equals(ctx.getParser().getCurrentToken())) {
    // it is expected to get called here when reading the last token.
    javatype = CollectionType.construct(ArrayList.class, javatype);
  }

  return javatype;
}
项目:dremio-oss    文件:EnumTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
  JavaType type = nameToType.get(id.toLowerCase());
  if (type == null) {
    throw new NullPointerException(
        format("no subtype of %s found for enum value %s. existing mappings:\n%s",
            baseType, id, description));

  }
  return type;
}
项目:haven-platform    文件:CustomTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) throws IOException {
    try {
        Class<?> type = Class.forName(id);
        return context.constructType(type);
    } catch (ClassNotFoundException e) {
        if(!(context instanceof DeserializationContext)) {
            throw new RuntimeException(e);
        }
        //see magic from ClassNameIdResolver._typeFromId()
        return ((DeserializationContext) context).handleUnknownTypeId(_baseType, id, this,
          "Class '" + id + "' not found.");
    }
}
项目:credhub    文件:SetRequestTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) throws IOException {
  Class<?> subType;
  id = id.toLowerCase();

  switch (id) {
    case CertificateCredentialVersionData.CREDENTIAL_TYPE:
      subType = CertificateSetRequest.class;
      break;
    case ValueCredentialVersionData.CREDENTIAL_TYPE:
      subType = ValueSetRequest.class;
      break;
    case JsonCredentialVersionData.CREDENTIAL_TYPE:
      subType = JsonSetRequest.class;
      break;
    case PasswordCredentialVersionData.CREDENTIAL_TYPE:
      subType = PasswordSetRequest.class;
      break;
    case RsaCredentialVersionData.CREDENTIAL_TYPE:
      subType = RsaSetRequest.class;
      break;
    case SshCredentialVersionData.CREDENTIAL_TYPE:
      subType = SshSetRequest.class;
      break;
    case UserCredentialVersionData.CREDENTIAL_TYPE:
      subType = UserSetRequest.class;
      break;
    default:
      String message = String.format("Could not resolve type id '%s' into a subtype of %s", id, baseType);
      throw new InvalidTypeIdException(null, message, baseType, id);
  }

  return context.constructSpecializedType(baseType, subType);
}
项目:logsniffer    文件:ConfiguredBean.java   
@SuppressWarnings("unchecked")
@Override
public JavaType typeFromId(final DatabindContext context,
        final String id) {
    return context.constructType(beanTypeResolver.resolveTypeClass(id,
            (Class<ConfiguredBean>) baseType.getRawClass()));
}
项目:archie    文件:OpenEHRTypeNaming.java   
@Override
protected JavaType _typeFromId(String typeName, DatabindContext ctxt) {
    Class result = rmInfoLookup.getClass(typeName);
    if(result == null) {
        //AOM class?
        result = aomInfoLookup.getClass(typeName);
    }
    if(result != null) {
        TypeFactory typeFactory = (ctxt == null) ? _typeFactory : ctxt.getTypeFactory();
        return typeFactory.constructSpecializedType(_baseType, result);
    }
    return super._typeFromId(typeName, ctxt);
}
项目:omise-java    文件:ModelTypeResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
    Class klass = KNOWN_TYPES.get(id);
    if (klass == null) {
        return null;
    }

    JavaType[] typeArgs = klass.equals(Event.class) ?
            new JavaType[]{context.getTypeFactory().constructSimpleType(Model.class, new JavaType[]{})} :
            new JavaType[]{};

    return context.getTypeFactory().constructSimpleType(klass, typeArgs);
}
项目:components    文件:NsTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
    Class<?> clazz = basicMetaData.getTypeClass(id);
    if (clazz == null) {
        return null;
    }
    JavaType javaType = SimpleType.construct(clazz);
    return javaType;
}
项目:oap    文件:TypeIdFactory.java   
@Override
public JavaType typeFromId( DatabindContext context, String id ) {
    final Class<?> clazz = idToClass.computeIfAbsent( id, ( k ) -> {
        throw new IllegalStateException( "cannot find id '" + k + "'" );
    } );
    return TypeFactory.defaultInstance().constructSpecializedType( baseType, clazz );
}
项目:depgraph-maven-plugin    文件:NodeTypeResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
  try {
    return SimpleType.constructUnsafe(Class.forName(getClass().getPackage().getName() + "." + id.substring(0, 1).toUpperCase() + id.substring(1)));
  } catch (ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
}
项目:simple-spring-memcached    文件:ClassAliasIdResolver.java   
@Override
protected JavaType _typeFromId(final String id, final DatabindContext ctxt) throws IOException {
    Class<?> clazz = idToClass.get(id);
    if (clazz != null) {
        return _typeFactory.constructSpecializedType(_baseType, clazz);
    }

    return super._typeFromId(id, ctxt);
}
项目:ovsdb    文件:OvsdbTypesIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
    if ("set".equals(id)) {
        return context.getTypeFactory().constructCollectionType(OvsdbSet.class, Object.class);
    } else if ("uuid".equals(id) || "named-uuid".equals(id)) {
        return context.constructType(UUID.class);
    }
    return null;
}
项目:goodees    文件:ImmutableEventTypeResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) throws IOException {
    TypeFactory typeFactory = context.getTypeFactory();
    return typeFromId(id, typeFactory);
}
项目:koryphe    文件:SimpleClassNameIdResolver.java   
@Override
public JavaType typeFromId(final DatabindContext context, final String id) {
    return defaultResolver.typeFromId(context, getClassName(id, baseType));
}
项目:spring4-understanding    文件:SpringHandlerInstantiatorTests.java   
public JavaType typeFromId(DatabindContext context, String id) {
    return null;
}
项目:step    文件:ArtefactTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext arg0, String arg1) {
    return typeFromId(arg1);
}
项目:archie    文件:OpenEHRTypeNaming.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
    return _typeFromId(id, context);
}
项目:codec    文件:CodecTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
    return _typeFromId(id, context.getTypeFactory());
}
项目:buildhealth    文件:BuildHealthWebServer.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
    return null;
}
项目:timbuctoo    文件:LoginTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
  return JAVA_TYPE;
}
项目:timbuctoo    文件:UserTypeIdResolver.java   
@Override
public JavaType typeFromId(DatabindContext context, String id) {
  return JAVA_TYPE;
}