コード例 #1
0
 public TinyTypesKeyDeserializer(Class<?> type) {
   if (type == null || !MetaTinyTypes.isTinyType(type)) {
     throw new IllegalArgumentException(
         String.format("not a tinytype: %s", type == null ? "null" : type.getCanonicalName()));
   }
   this.type = type;
 }
コード例 #2
0
  @Override
  public KeyDeserializer findKeyDeserializer(
      JavaType type, DeserializationConfig config, BeanDescription beanDesc)
      throws JsonMappingException {
    final Class<?> candidateTT = type.getRawClass();
    if (MetaTinyTypes.isTinyType(candidateTT)) {
      return new TinyTypesKeyDeserializer(candidateTT);
    }

    return null;
  }
コード例 #3
0
 @Override
 public Object deserializeKey(String key, DeserializationContext ctxt)
     throws IOException, JsonProcessingException {
   return MetaTinyTypes.metaFor(type).fromString(type, key);
 }