Package org.mvel2.util

Examples of org.mvel2.util.StringAppender


        outstream.write('}');
    }

    private static void encodeMap(Map<Object, Object> map, OutputStream outstream, EncodingContext ctx) throws IOException {
        StringAppender mapBuild = new StringAppender("{");
        outstream.write('{');
        boolean first = true;

        for (Map.Entry<Object, Object> entry : map.entrySet()) {
            if (!first) {
View Full Code Here


    }

    private static void encodeCollection(Collection col, OutputStream outstream, EncodingContext ctx) throws IOException {
        outstream.write('[');

        StringAppender buildCol = new StringAppender("[");
        Iterator iter = col.iterator();
        while (iter.hasNext()) {
            _encode(iter.next(), outstream, ctx);
            if (iter.hasNext()) outstream.write(',');
        }
View Full Code Here

        outstream.write(']');
    }

    private static void encodeArray(Object array, OutputStream outstream, EncodingContext ctx) throws IOException {
        StringAppender buildCol = new StringAppender("[");

        int len = Array.getLength(array);
        for (int i = 0; i < len; i++) {
            _encode(Array.get(array, 1), outstream, ctx);
            if ((i + 1) < len) outstream.write(',');
View Full Code Here

        final QueueSession session = sessionProvider.getSession(request.getSession(),
                request.getHeader(ClientMessageBus.REMOTE_QUEUE_ID_HEADER));

        BufferedReader reader = request.getReader();
        StringAppender sb = new StringAppender(request.getContentLength());
        CharBuffer buffer = CharBuffer.allocate(10);

        int read;
        while ((read = reader.read(buffer)) > 0) {
            buffer.rewind();
            for (; read > 0; read--) {
                sb.append(buffer.get());
            }
            buffer.rewind();
        }

        Message msg = createCommandMessage(session, sb.toString());
        if (msg != null) {
            service.store(msg);
        }

        pollQueue(service.getBus().getQueue(session), request, response);
View Full Code Here

        final QueueSession session = sessionProvider.getSession(httpServletRequest.getSession(),
                httpServletRequest.getHeader(ClientMessageBus.REMOTE_QUEUE_ID_HEADER));

        BufferedReader reader = httpServletRequest.getReader();
        StringAppender sb = new StringAppender(httpServletRequest.getContentLength());
        CharBuffer buffer = CharBuffer.allocate(10);

        int read;
        while ((read = reader.read(buffer)) > 0) {
            buffer.rewind();
            for (; read > 0; read--) {
                sb.append(buffer.get());
            }
            buffer.rewind();
        }

        Message m = createCommandMessage(session, sb.toString());
        if (m != null) {
            service.store(m);
        }

        pollQueue(service.getBus().getQueue(session), httpServletRequest, httpServletResponse);
View Full Code Here

    private int readInRequest(QueueSession session, HttpServletRequest request) {
        try {

            BufferedReader reader = request.getReader();
            if (!reader.ready()) return 0;
            StringAppender sb = new StringAppender(request.getContentLength());
            CharBuffer buffer = CharBuffer.allocate(10);
            int read;
            while ((read = reader.read(buffer)) > 0) {
                buffer.rewind();
                for (; read > 0; read--) {
                    sb.append(buffer.get());
                }
                buffer.rewind();
            }


            Message msg = createCommandMessage(sessionProvider.getSession(request.getSession(),
                    request.getHeader(ClientMessageBus.REMOTE_QUEUE_ID_HEADER)), sb.toString());
            if (msg != null) {
                service.store(msg);
                return 1;
            } else {
                return 0;
View Full Code Here

    }

    private int readInRequest(HttpServletRequest request) throws IOException {
        BufferedReader reader = request.getReader();
        if (!reader.ready()) return 0;
        StringAppender sb = new StringAppender(request.getContentLength());
        CharBuffer buffer = CharBuffer.allocate(10);
        int read;
        while ((read = reader.read(buffer)) > 0) {
            buffer.rewind();
            for (; read > 0; read--) {
                sb.append(buffer.get());
            }
            buffer.rewind();
        }

        Message msg = createCommandMessage(sessionProvider.getSession(request.getSession(),
                request.getHeader(REMOTE_QUEUE_ID_HEADER)), sb.toString());
        if (msg != null) {
            service.store(msg);
            return 1;
        } else {
            return 0;
View Full Code Here

import java.lang.reflect.Method;

public class RebindUtils {
    public static String createCallSignature(Method m) {
        StringAppender append = new StringAppender(m.getName()).append(':');
        for (Class c : m.getParameterTypes()) {
            append.append(c.getCanonicalName()).append(':');
        }
        return append.toString();
    }
View Full Code Here

                  new DefaultMutableTreeNode("Callpoints (" + endpoints.size() + ")");

          for (String endpoint : endpoints) {
            String[] epParts = endpoint.split(":");

            StringAppender appender = new StringAppender(epParts[0]).append('(');
            for (int i = 1; i < epParts.length; i++) {
              appender.append(epParts[i]);
              if ((i + 1) < epParts.length) appender.append(", ");
            }

            remoteCPs.add(UiHelper.createIconEntry("database_connect.png", appender.append(')').toString()));
          }

          node.add(remoteCPs);
        }
      }
View Full Code Here

  }

  public static String renderMessage(Object value) {

    if (value instanceof Message) {
      StringAppender appender = new StringAppender();
      Map<String, Object> vars = ((Message) value).getParts();

      boolean first = true;
      for (Map.Entry<String, Object> entry : vars.entrySet()) {
        if (first) {
          first = false;
        }
        else {
          appender.append(", ");
        }

        appender.append(entry.getKey()).append('=').append(entry.getValue());
      }

      return appender.toString();
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.mvel2.util.StringAppender

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.