@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 + "\"" ); }
@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; }
@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); }
@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; }
@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; }
@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."); } }
@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); }
@SuppressWarnings("unchecked") @Override public JavaType typeFromId(final DatabindContext context, final String id) { return context.constructType(beanTypeResolver.resolveTypeClass(id, (Class<ConfiguredBean>) baseType.getRawClass())); }
@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); }
@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); }
@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; }
@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 ); }
@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); } }
@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); }
@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; }
@Override public JavaType typeFromId(DatabindContext context, String id) throws IOException { TypeFactory typeFactory = context.getTypeFactory(); return typeFromId(id, typeFactory); }
@Override public JavaType typeFromId(final DatabindContext context, final String id) { return defaultResolver.typeFromId(context, getClassName(id, baseType)); }
public JavaType typeFromId(DatabindContext context, String id) { return null; }
@Override public JavaType typeFromId(DatabindContext arg0, String arg1) { return typeFromId(arg1); }
@Override public JavaType typeFromId(DatabindContext context, String id) { return _typeFromId(id, context); }
@Override public JavaType typeFromId(DatabindContext context, String id) { return _typeFromId(id, context.getTypeFactory()); }
@Override public JavaType typeFromId(DatabindContext context, String id) { return null; }
@Override public JavaType typeFromId(DatabindContext context, String id) { return JAVA_TYPE; }