Package railo.runtime.converter

Examples of railo.runtime.converter.JSONConverter


    // Params
    Map<String, String> params=new HashMap<String, String>();
    params.put("method",methodName);
    params.put("returnFormat","json");
    try {
      params.put("argumentCollection",new JSONConverter(true).serialize(pc, args, false));
   
   
      HTTPResponse res = HTTPEngine4Impl.post(
        HTTPUtil.toURL(url,true),
        client.getServerUsername(),
View Full Code Here


          String strQF=((String) queryFormat).trim();
          if(strQF.equalsIgnoreCase("row"));
          else if(strQF.equalsIgnoreCase("column"))byColumn=true;
          else throw new ApplicationException("invalid queryformat definition ["+strQF+"], valid formats are [row,column]");
        }
        JSONConverter converter = new JSONConverter(false);
        String prefix="";
        if(props.secureJson) {
          prefix=pc.getApplicationContext().getSecureJsonPrefix();
          if(prefix==null)prefix="";
        }
        pc.forceWrite(prefix+converter.serialize(pc,rtn,byColumn));
    }
    // CFML
    else if(UDF.RETURN_FORMAT_SERIALIZE==props.format) {
      ScriptConverter converter = new ScriptConverter(false);
      pc.forceWrite(converter.serialize(rtn));
    }
      // XML
    else if(UDF.RETURN_FORMAT_XML==props.format) {
      XMLConverter converter = new XMLConverter(pc.getTimeZone(),false);
            converter.setTimeZone(pc.getTimeZone());
            pc.forceWrite(converter.serialize(rtn));
    }
    // Plain
    else if(UDF.RETURN_FORMAT_PLAIN==props.format) {
      pc.forceWrite(Caster.toString(rtn));
    }
View Full Code Here

    }
   
        // JSON
    else if(UDF.RETURN_FORMAT_JSON==format) {
          boolean byColumn = false;
        JSONConverter converter = new JSONConverter(false);
        String str = converter.serialize(pc,rtn,byColumn);
            cs = getCharset(pc);
            is = new ByteArrayInputStream(str.getBytes(cs));
       
        }
        // CFML
    else if(UDF.RETURN_FORMAT_SERIALIZE==format) {
      ScriptConverter converter = new ScriptConverter(false);
      String str=converter.serialize(rtn);
            cs = getCharset(pc);
            is = new ByteArrayInputStream(str.getBytes(cs));
    }
      // XML
    else if(UDF.RETURN_FORMAT_XML==format) {
      XMLConverter converter = new XMLConverter(pc.getTimeZone(),false);
            converter.setTimeZone(pc.getTimeZone());
            String str=converter.serialize(rtn);
            cs = getCharset(pc);
            is = new ByteArrayInputStream(str.getBytes(cs));
    }
    // Plain
    else if(UDF.RETURN_FORMAT_PLAIN==format) {
View Full Code Here

  public static String call(PageContext pc, Object var) throws PageException {
      return call(pc,var,false);
  }
  public static String call(PageContext pc, Object var,boolean serializeQueryByColumns) throws PageException {
    try {
            return new JSONConverter(true).serialize(pc,var,serializeQueryByColumns);
        } catch (ConverterException e) {
            throw Caster.toPageException(e);
        }
    //throw new FunctionNotSupported("SerializeJSON");
  }
View Full Code Here

   
   
    String str;
    try {
      if(UDF.RETURN_FORMAT_JSON==argumentsCollectionFormat)  {
        str = new JSONConverter(true).serialize(pc,args,false);
        formfields.put("argumentCollectionFormat", "json");
      }
      else if(UDF.RETURN_FORMAT_SERIALIZE==argumentsCollectionFormat)  {
        str = new ScriptConverter().serialize(args);
        formfields.put("argumentCollectionFormat", "cfml");
View Full Code Here

TOP

Related Classes of railo.runtime.converter.JSONConverter

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.