Examples of MarshallingSession


Examples of org.jboss.errai.marshalling.client.api.MarshallingSession

    if (obj == null) {
      return "{\"" + SerializationParts.ENCODED_TYPE + "\":\"java.lang.Object\",\""
              + SerializationParts.QUALIFIED_VALUE + "\":null}";
    }

    final MarshallingSession session = MarshallingSessionProviderFactory.getEncoding();

    obj = MarshallUtil.maybeUnwrap(obj);

    if (needsQualification(obj)) {
      return NumbersUtils.qualifiedNumericEncoding(obj);
View Full Code Here

Examples of org.jboss.errai.marshalling.client.api.MarshallingSession

    if (json == null || "null".equals(json)) {
      return null;
    }

    final EJValue parsedValue = ParserFactory.get().parse(json);
    final MarshallingSession session = MarshallingSessionProviderFactory.getDecoding();
    if (assumedElementType != null) {
      session.setAssumedElementType(assumedElementType.getName());
    }
    final Marshaller<Object> marshallerInstance = session.getMarshallerInstance(type.getName());
    if (marshallerInstance == null) {
      throw new RuntimeException("No marshaller for type: " + type.getName());
    }

    return (T) marshallerInstance.demarshall(parsedValue, session);
View Full Code Here

Examples of org.jboss.errai.marshalling.client.api.MarshallingSession

   */
  @SuppressWarnings("unchecked")
  public static <T> T fromJSON(final String json, final Class<T> type, final Class<?> assumedMapKeyType,
      final Class<?> assumedMapValueType) {
    final EJValue parsedValue = ParserFactory.get().parse(json);
    final MarshallingSession session = MarshallingSessionProviderFactory.getDecoding();
    session.setAssumedMapKeyType(assumedMapKeyType.getName());
    session.setAssumedMapValueType(assumedMapValueType.getName());

    final Marshaller<Object> marshallerInstance = session.getMarshallerInstance(type.getName());
    if (marshallerInstance == null) {
      throw new RuntimeException("No marshaller for type: " + type.getName());
    }
    return (T) marshallerInstance.demarshall(parsedValue, session);
  }
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.