@Override public JavaType typeFromId(DatabindContext context, String id) throws IOException { return _typeFromId(id, context); }
@Override protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException { if (id.startsWith(".")) { StringBuilder sb = new StringBuilder(id.length() + _basePackageName.length()); if (_basePackageName.length() == 0) { // no package; must remove leading '.' from id sb.append(id.substring(1)); } else { // otherwise just concatenate package, with leading-dot-partial name sb.append(_basePackageName).append(id); } id = sb.toString(); } return super._typeFromId(id, ctxt); } }
@Override public JavaType typeFromId(DatabindContext context, String id) throws IOException { return _typeFromId(id, context); }
@Override public JavaType typeFromId(DatabindContext context, String id) throws IOException { return _typeFromId(id, context); }
@Deprecated // since 2.3 @Override public JavaType typeFromId(String id) { return _typeFromId(id, _typeFactory); }
@Deprecated // since 2.3 @Override public JavaType typeFromId(String id) { return _typeFromId(id, _typeFactory); }
@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 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) { return _typeFromId(id, context.getTypeFactory()); }
@Override public JavaType typeFromId(DatabindContext context, String id) { return _typeFromId(id, context.getTypeFactory()); }
@Override protected JavaType _typeFromId(String id, TypeFactory typeFactory) { if (id.startsWith(".")) { StringBuilder sb = new StringBuilder(id.length() + _basePackageName.length()); if (_basePackageName.length() == 0) { // no package; must remove leading '.' from id sb.append(id.substring(1)); } else { // otherwise just concatenate package, with leading-dot-partial name sb.append(_basePackageName).append(id); } id = sb.toString(); } return super._typeFromId(id, typeFactory); } }
@Override protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException { if (id.startsWith(".")) { StringBuilder sb = new StringBuilder(id.length() + _basePackageName.length()); if (_basePackageName.length() == 0) { // no package; must remove leading '.' from id sb.append(id.substring(1)); } else { // otherwise just concatenate package, with leading-dot-partial name sb.append(_basePackageName).append(id); } id = sb.toString(); } return super._typeFromId(id, ctxt); } }
@Override protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException { if (id.startsWith(".")) { StringBuilder sb = new StringBuilder(id.length() + _basePackageName.length()); if (_basePackageName.length() == 0) { // no package; must remove leading '.' from id sb.append(id.substring(1)); } else { // otherwise just concatenate package, with leading-dot-partial name sb.append(_basePackageName).append(id); } id = sb.toString(); } return super._typeFromId(id, ctxt); } }
@Override protected JavaType _typeFromId(String id, TypeFactory typeFactory) { if (id.startsWith(".")) { StringBuilder sb = new StringBuilder(id.length() + _basePackageName.length()); if (_basePackageName.length() == 0) { // no package; must remove leading '.' from id sb.append(id.substring(1)); } else { // otherwise just concatenate package, with leading-dot-partial name sb.append(_basePackageName).append(id); } id = sb.toString(); } return super._typeFromId(id, typeFactory); } }
@Override protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException { // base types don't have subclasses if (_baseType.isPrimitive()) { return _baseType; } // check if there's a specific type we should be using for this ID Class<?> subType = _idTypes.get(id); if (subType != null) { id = _idFrom(null, subType, _typeFactory); } try { return super._typeFromId(id, ctxt); } catch (InvalidTypeIdException | IllegalArgumentException e) { // AvroTypeDeserializer expects null if we can't map the type ID to a class; It will throw an appropriate error if we can't // find a usable type. return null; } } }