Renders using {@link JsonRenderer} with {"code": int}.

@param code the specified code
@return this context
345794
public RequestContext renderJSON(final int code) {
        final JsonRenderer jsonRenderer = new JsonRenderer();
        final JSONObject ret = new JSONObject().put(Keys.CODE, code);
        jsonRenderer.setJSONObject(ret);

        this.renderer = jsonRenderer;

        return this;
    }
119236
CharSequence render()
	{
		StringBuilder stringBuilder = new StringBuilder();
		for (JsStatement statement : statements)
		{
			stringBuilder.append("\t");
			stringBuilder.append(statement.render());
			stringBuilder.append("\n");
		}
		return stringBuilder;
	}
308251
public RenderScript getRenderScript() {
        if (renderScript == null) {
            renderScript = RenderScript.create(context, renderScriptContextType);
        }
        return renderScript;
    }
1026981
function evaluate(code) {
  const context = {
    module: {
      exports: {},
    },
  };

  // eslint-disable-next-line no-new-func
  const renderFunction = new Function('module', code);
  renderFunction(context.module);

  const template = context.module.exports;

  return template;
}
1255889
@NotNull
    @ObjectiveCName("validateCodeCommand:")
    public Command<AuthState> validateCode(final String code) {
        return modules.getAuthModule().requestValidateCode(code);
    }
179364
protected void response( int code, String data )
    {    
        /*
         * send the json content type and the charset 
        */
        response.setContentType("application/json;charset="+config.getCharset());
        
        JSONWriter json = JSONWriter.create()
                    .put("code", code)
                        .put("data", data);
        
        /*IStringBuffer sb = new IStringBuffer();
        sb.append("{\n");
        sb.append("\"status\": ").append(status).append(",\n");
        sb.append("\"errcode\": ").append(errcode).append(",\n");
        sb.append("\"data\": ");
        if ( data.charAt(0) == '{' || data.charAt(0) == '[' ) {
            sb.append(data).append('\n');
        } else {
            sb.append('"').append(data).append("\"\n");
        }
        sb.append("}\n");*/
        
        output.println(json.toString());
        output.flush();
        
        //let the gc do its work
        json = null;
    }
129643
@Override
	public void paint(final RenderContext renderContext) {
		WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
		PrintWriter writer = webRenderContext.getWriter();

		beforePaint(writer);
		getBackingComponent().paint(renderContext);
		afterPaint(writer);
	}
1038745
function(code)
        {
            if (code === null)
                code = '';

            this.code = code;

            var div = this.create('div');

            // create main HTML
            div.innerHTML = this.getHtml(code);

            // set up click handlers
            if (this.getParam('toolbar'))
                attachEvent(findElement(div, '.toolbar'), 'click', sh.toolbar.handler);

            if (this.getParam('quick-code'))
                attachEvent(findElement(div, '.code'), 'dblclick', quickCodeHandler);

            return div;
        }
355408
public RunParams templateCode(String templateCode) {
        if (templateCode == null) {
            throw new NullPointerException("\"templateCode\" parameter can not be null");
        }
        this.reportTemplate = report.getReportTemplates().get(templateCode);
        if (reportTemplate == null) {
            throw new NullPointerException(String.format("Report template not found for code [%s]", templateCode));
        }
        return this;
    }
1023184
private ModelAndView generateErrorView(final String code, final Object[] args) {
        val modelAndView = new ModelAndView(this.failureView);
        val convertedDescription = getMessageSourceAccessor().getMessage(code, args, code);
        modelAndView.addObject("code", StringEscapeUtils.escapeHtml4(code));
        modelAndView.addObject("description", StringEscapeUtils.escapeHtml4(convertedDescription));
        return modelAndView;
    }
364499
public String format(final String code, @Nullable final Object... args) {
    String pattern = getMessage(code);
    if (args != null) {
      return String.format(pattern, args);
    }
    else {
      return pattern;
    }
  }
331570
public AccessToken getAccessToken(String code) {
        String url = WxEndpoint.get("url.oauth.accesstoken.get");
        String formatUrl = String.format(url, wxClient.getClientId(), wxClient.getClientSecret(), code);
        logger.debug("get access token: {}", formatUrl);
        String response = wxClient.get(formatUrl, false);
        return JsonMapper.defaultMapper().fromJson(response, AccessToken.class);
    }
1349566
@Override
	public void paint(final RenderContext renderContext) {
		AjaxOperation operation = AjaxHelper.getCurrentOperation();
		if (operation == null) {
			// the request attribute that we place in the ui context in the action phase can't be null
			throw new SystemException(
					"Can't paint AJAX response. Couldn't find the expected reference to the AjaxOperation.");
		}

		if (operation.getTargetContainerId() != null) {
			paintContainerResponse(renderContext, operation);
		} else {
			paintResponse(renderContext, operation);
		}
	}
1211223
public static JCGLPrimitives primitiveFromGL(
    final int code)
  {
    switch (code) {
      case GL11.GL_LINES:
        return JCGLPrimitives.PRIMITIVE_LINES;
      case GL11.GL_LINE_LOOP:
        return JCGLPrimitives.PRIMITIVE_LINE_LOOP;
      case GL11.GL_POINTS:
        return JCGLPrimitives.PRIMITIVE_POINTS;
      case GL11.GL_TRIANGLES:
        return JCGLPrimitives.PRIMITIVE_TRIANGLES;
      case GL11.GL_TRIANGLE_STRIP:
        return JCGLPrimitives.PRIMITIVE_TRIANGLE_STRIP;
      default:
        throw new UnreachableCodeException();
    }
  }
409674
public RequestContext renderJSONPretty(final JSONObject json) {
        final JsonRenderer jsonRenderer = new JsonRenderer();
        jsonRenderer.setJSONObject(json);
        jsonRenderer.setPretty(true);

        this.renderer = jsonRenderer;

        return this;
    }
861841
@Override
    public InputStream render(Context context, Result result) throws RenderableException {
        byte[] bytes;

        // We have a result, charset have to be provided
        if (result != null) {
            if (result.getCharset() == null) {
                // No charset provided, use default encoding (UTF-8).
                result.with(Charsets.UTF_8);
            }
            bytes = rendered.getBytes(result.getCharset());
        } else {
            //No Result, use the default encoding
            bytes = rendered.getBytes(Charsets.UTF_8);
        }

        return new ByteArrayInputStream(bytes);
    }
213616
public String reindent(String code) {
    try {
      // Remove indention from each line.
      StringBuilder sb = new StringBuilder();
      LineReader lr = new LineReader(new StringReader(code));
      String line = lr.readLine();
      while (line != null) {
        sb.append(line.trim());
        line = lr.readLine();
        if (line != null) {
          sb.append('\n');
        }
      }
      String strippedCode = sb.toString();

      // Now indent it again.
      int indent = indention * DEFAULT_INDENTION;
      sb.setLength(0);  // reset buffer
      lr = new LineReader(new StringReader(strippedCode));
      line = lr.readLine();
      while (line != null) {
        if (line.startsWith("}")) {
          indent -= DEFAULT_INDENTION;
        }
        if (!line.startsWith("#line")) {
          sb.append(pad(indent));
        }
        sb.append(line);
        if (line.endsWith("{")) {
          indent += DEFAULT_INDENTION;
        }
        line = lr.readLine();
        if (line != null) {
          sb.append('\n');
        }
      }
      return sb.toString();
    } catch (IOException e) {
      // Should never happen with string readers.
      throw new AssertionError(e);
    }
  }