Examples of TypeToken


Examples of com.google.gson.reflect.TypeToken

    $Gson.Preconditions.checkArgument(((paramObject instanceof JsonSerializer)) || ((paramObject instanceof JsonDeserializer)) || ((paramObject instanceof InstanceCreator)) || ((paramObject instanceof TypeAdapter)));
    if ((paramObject instanceof InstanceCreator))
      this.instanceCreators.put(paramType, (InstanceCreator)paramObject);
    if (((paramObject instanceof JsonSerializer)) || ((paramObject instanceof JsonDeserializer)))
    {
      TypeToken localTypeToken = TypeToken.get(paramType);
      this.factories.add(TreeTypeAdapter.newFactoryWithMatchRawType(localTypeToken, paramObject));
    }
    if ((paramObject instanceof TypeAdapter))
      this.factories.add(TypeAdapters.newFactory(TypeToken.get(paramType), (TypeAdapter)paramObject));
    return this;
View Full Code Here

Examples of org.structr.common.error.TypeToken

            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entityType.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

Examples of org.structr.common.error.TypeToken

            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entityType.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

Examples of org.structr.common.error.TypeToken

            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entityType.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

Examples of org.structr.common.error.TypeToken

            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entity.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

Examples of org.structr.common.error.TypeToken

        } catch(ClassCastException cce) {

          cce.printStackTrace();

          throw new FrameworkException(entity.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
        }

      } else {

        inputTypedProperties.put(propertyKey.jsonName(), entry.getValue());
View Full Code Here

Examples of org.structr.common.error.TypeToken

    if(value != null && type.isAssignableFrom(value)) {
      return true;
    }

    // set error
    errorBuffer.add(object.getType(), new TypeToken(key, type.getName()));

    return false;
  }
View Full Code Here

Examples of org.structr.common.error.TypeToken

        return true;

      } else {

        errorBuffer.add(object.getType(), new TypeToken(key, "long"));
      }

    } else {

      errorBuffer.add(object.getType(), new EmptyPropertyToken(key));
View Full Code Here

Examples of org.structr.common.error.TypeToken

  private T getTypedResult(Result<T> result, Class<T> type) throws FrameworkException {
   
    GraphObject obj = result.get(0);

    if(!type.isAssignableFrom(obj.getClass())) {
      throw new FrameworkException(type.getSimpleName(), new TypeToken(AbstractNode.base, type.getSimpleName()));
    }

    return result.get(0);
  }
View Full Code Here

Examples of org.structr.common.error.TypeToken

      case 1 :
       
        T obj = result.get(0);
        //if(!type.getSimpleName().equals(node.getType())) {
        if (!type.isAssignableFrom(obj.getClass())) {
          throw new FrameworkException("base", new TypeToken(propertyKey, type.getSimpleName()));
        }
        return obj;
    }

    if (convertedSource != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.