Package org.codehaus.jackson.map

Examples of org.codehaus.jackson.map.ObjectMapper


    if (objectMapper == null && applicationContext != null) {
      try {
        objectMapper = (ObjectMapper)BeanFactoryUtils
          .beanOfTypeIncludingAncestors(applicationContext, ObjectMapper.class);
      } catch (Exception e) {
        objectMapper = new ObjectMapper();
      }
    }

    // create JsonRpcHttpClient
    try {
View Full Code Here


      && applicationContext!=null) {
      try {
        objectMapper = (ObjectMapper)BeanFactoryUtils.beanOfTypeIncludingAncestors(
          applicationContext, ObjectMapper.class);
      } catch(Exception e) {
        objectMapper = new ObjectMapper();
      }
    }

    // create the server
    jsonRpcServer = new JsonRpcServer(
View Full Code Here

     * made to the {@code serviceUrl}.
     *
     * @param serviceUrl the URL
     */
    public JsonRpcClient() {
        this(new ObjectMapper());
    }
View Full Code Here

   * The headers provided in the {@code headers} map are added to every request
   * made to the {@code serviceUrl}.
   * @param serviceUrl the URL
   */
  public JsonRpcHttpClient(URL serviceUrl, Map<String, String> headers) {
    this(new ObjectMapper(), serviceUrl, headers);
  }
View Full Code Here

   * The headers provided in the {@code headers} map are added to every request
   * made to the {@code serviceUrl}.
   * @param serviceUrl the URL
   */
  public JsonRpcHttpClient(URL serviceUrl) {
    this(new ObjectMapper(), serviceUrl, new HashMap<String, String>());
  }
View Full Code Here

   * methods available on the {@code remoteInterface}.
   * @param handler the {@code handler}
   * @param remoteInterface the interface
   */
  public JsonRpcServer(Object handler, Class<?> remoteInterface) {
    this(new ObjectMapper(), handler, remoteInterface);
  }
View Full Code Here

   * Creates the server with a default {@link ObjectMapper} delegating
   * all calls to the given {@code handler}.
   * @param handler the {@code handler}
   */
  public JsonRpcServer(Object handler) {
    this(new ObjectMapper(), handler, null);
  }
View Full Code Here

  private TestException testException;
  private TestException testExceptionWithMessage;

  @Before
  public void setup() {
    mapper = new ObjectMapper();
    baos = new ByteArrayOutputStream();
    testException = new TestException();
    testExceptionWithMessage = new TestException("exception message");
  }
View Full Code Here

  }
 
  public JsonDataSource(InputStream jsonStream, String selectExpression) throws JRException {
    try {
      this.jsonStream = jsonStream;
      this.mapper = new ObjectMapper();
     
      mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
      mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
      mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
     
View Full Code Here

    HRegion r = null;
    synchronized (this.onlineRegions) {
      r = this.onlineRegions.get(encodedRegionName);
    }
    if (r == null) return null;
    ObjectMapper mapper = new ObjectMapper();
    int stores = 0;
    int storefiles = 0;
    int storefileSizeMB = 0;
    int memstoreSizeMB = (int) (r.memstoreSize.get() / 1024 / 1024);
    int storefileIndexSizeMB = 0;
    long totalCompactingKVs = 0;
    long currentCompactedKVs = 0;
    synchronized (r.stores) {
      stores += r.stores.size();
      for (Store store : r.stores.values()) {
        storefiles += store.getStorefilesCount();
        storefileSizeMB += (int) (store.getStorefilesSize() / 1024 / 1024);
        storefileIndexSizeMB += (int) (store.getStorefilesIndexSize() / 1024 / 1024);
      }
    }
    Map<String, Integer> map = new TreeMap<String, Integer>();
    map.put("stores", stores);
    map.put("storefiles", storefiles);
    map.put("storefileSizeMB", storefileIndexSizeMB);
    map.put("memstoreSizeMB", memstoreSizeMB);
    StringWriter w = new StringWriter();
    mapper.writeValue(w, map);
    w.close();
    return Bytes.toBytes(w.toString());
  }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.ObjectMapper

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.