Package org.jboss.errai.marshalling.client.api.json

Examples of org.jboss.errai.marshalling.client.api.json.EJArray


    }
    else if (toType.equals(String.class.getName())) {
      return key;
    }
    else if (keyMarshaller != null) {
      EJArray eja = ParserFactory.get().parse("[\"" + key + "\"]").isArray();
      if (eja != null && eja.size() == 1) {
        return keyMarshaller.demarshall(eja.get(0), ctx);
      }
    }
    return key;
  }
View Full Code Here


  public Object demarshall(EJValue a0, MarshallingSession a1) {
    if (a0.isNull()) {
      return null;
    }
    else {
      EJArray arr = a0.isArray();

      int[] dims = new int[dimensions];
      dims[0] = arr.size();

      Object arrayInstance = Array.newInstance(arrayType.getOuterComponentType().asClass(), dims);
      _demarshall(dimensions - 1, arrayInstance, arr, a1);
      return arrayInstance;
    }
View Full Code Here

  public Object demarshall(EJValue a0, MarshallingSession a1) {
    if (a0.isNull()) {
      return null;
    }
    else {
      EJArray arr = a0.isArray();

      int[] dims = new int[dimensions];
      dims[0] = arr.size();

      Object arrayInstance = Array.newInstance(arrayType.getOuterComponentType().asClass(), dims);
      _demarshall(dimensions - 1, arrayInstance, arr, a1);
      return arrayInstance;
    }
View Full Code Here

  public Object demarshall(EJValue a0, MarshallingSession a1) {
    if (a0.isNull() != null) {
      return null;
    }
    else {
      EJArray arr = a0.isArray();

      int[] dims = new int[dimensions];
      dims[0] = arr.size();

      Object arrayInstance = Array.newInstance(arrayType.getOuterComponentType().asClass(), dims);
      _demarshall(dimensions - 1, arrayInstance, arr, a1);
      return arrayInstance;
    }
View Full Code Here

    EJValue value = JSONStreamDecoder.decode(inputStream);
    if (value.isObject() != null) {
      return Collections.singletonList(from(getParts(value), session, null));
    }
    else if (value.isArray() != null) {
      EJArray arr = value.isArray();
      List<Message> messages = new ArrayList<Message>(arr.size());
      for (int i = 0; i < arr.size(); i++) {
        messages.add(from(getParts(arr.get(i)), session, null));
      }
      return messages;
    }
    else {
      throw new RuntimeException("bad payload");
View Full Code Here

  public static List<Message> createCommandMessage(QueueSession session, EJValue value) {
    if (value.isObject() != null) {
      return Collections.singletonList(from(getParts(value), session, null));
    }
    else if (value.isArray() != null) {
      EJArray arr = value.isArray();
      List<Message> messages = new ArrayList<Message>(arr.size());
      for (int i = 0; i < arr.size(); i++) {
        messages.add(from(getParts(arr.get(i)), session, null));
      }
      return messages;
    }
    else {
      throw new RuntimeException("bad payload");
View Full Code Here

    EJValue value = JSONStreamDecoder.decode(request.getInputStream());
    if (value.isObject() != null) {
      return Collections.singletonList(from(getParts(value), session, request));
    }
    else if (value.isArray() != null) {
      EJArray arr = value.isArray();
      List<Message> messages = new ArrayList<Message>(arr.size());
      for (int i = 0; i < arr.size(); i++) {
        messages.add(from(getParts(arr.get(i)), session, request));
      }
      return messages;
    }
    else if (value.isNull()) {
      return Collections.<Message>emptyList();
View Full Code Here

    EJValue value = JSONStreamDecoder.decode(request.getInputStream());
    if (value.isObject() != null) {
      return Collections.singletonList(from(getParts(value), session, request));
    }
    else if (value.isArray() != null) {
      EJArray arr = value.isArray();
      List<Message> messages = new ArrayList<Message>(arr.size());
      for (int i = 0; i < arr.size(); i++) {
        messages.add(from(getParts(arr.get(i)), session, request));
      }
      return messages;
    }
    else {
      throw new RuntimeException("bad payload");
View Full Code Here

    EJValue value = JSONStreamDecoder.decode(inputStream);
    if (value.isObject() != null) {
      return Collections.singletonList(from(getParts(value), session, null));
    }
    else if (value.isArray() != null) {
      EJArray arr = value.isArray();
      List<Message> messages = new ArrayList<Message>(arr.size());
      for (int i = 0; i < arr.size(); i++) {
        messages.add(from(getParts(arr.get(i)), session, null));
      }
      return messages;
    }
    else {
      throw new RuntimeException("bad payload");
View Full Code Here

  public static List<Message> createCommandMessage(QueueSession session, EJValue value) {
    if (value.isObject() != null) {
      return Collections.singletonList(from(getParts(value), session, null));
    }
    else if (value.isArray() != null) {
      EJArray arr = value.isArray();
      List<Message> messages = new ArrayList<Message>(arr.size());
      for (int i = 0; i < arr.size(); i++) {
        messages.add(from(getParts(arr.get(i)), session, null));
      }
      return messages;
    }
    else {
      throw new RuntimeException("bad payload");
View Full Code Here

TOP

Related Classes of org.jboss.errai.marshalling.client.api.json.EJArray

Copyright © 2018 www.massapicom. 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.