public void appendScript(Appendable target) throws IOException { ScriptUtils.appendScript(target, wrapped); } }
public void appendScript(Appendable target) throws IOException { ScriptUtils.appendScript(target, options); }
public void appendScript(Appendable target) throws IOException { ScriptUtils.appendScript(target, options); }
public void appendScript(Appendable target) throws IOException { ScriptUtils.appendScript(target, options); }
public static void appendScript(Appendable appendable, Object obj) throws IOException { appendScript(appendable, obj, new IdentityHashMap<Object, Boolean>()); }
private void appendAjaxFunctionCall(Appendable target) throws IOException { target.append(FUNCTION_NAME); target.append('('); ScriptUtils.appendScript(target, source); target.append(','); ScriptUtils.appendScript(target, event); if (!options.isEmpty()) { target.append(','); ScriptUtils.appendScript(target, options); } target.append(")"); }
private void appendAjaxFunctionCall(Appendable target) throws IOException { target.append(FUNCTION_NAME); target.append('('); ScriptUtils.appendScript(target, source); target.append(','); ScriptUtils.appendScript(target, event); if (!options.isEmpty()) { target.append(','); ScriptUtils.appendScript(target, options); } target.append(")"); }
public void appendScript(Appendable target) throws IOException { target.append(name); if (null != index) { target.append("["); ScriptUtils.appendScript(target, index); target.append("]"); } } }
private void appendAjaxFunctionCall(Appendable target) throws IOException { target.append(FUNCTION_NAME); target.append('('); ScriptUtils.appendScript(target, source); target.append(','); ScriptUtils.appendScript(target, event); if (!options.isEmpty()) { target.append(','); ScriptUtils.appendScript(target, options); } target.append(")"); }
/** * Convert any Java Object to JavaScript representation ( as possible ) and write it to writer immediately * * @param responseWriter * @param obj * @throws IOException */ public static void writeToStream(final ResponseWriter responseWriter, Object obj) throws IOException { appendScript(new ResponseWriterWrapper(responseWriter), obj, new IdentityHashMap<Object, Boolean>()); }
protected void appendConverter(Appendable target, LibraryScriptFunction converter) throws IOException { target.append(LEFT_CURLY_BRACKET).append("f").append(COLON).append(converter.getName()).append(COMMA); target.append(PARAMS).append(COLON); ScriptUtils.appendScript(target, converter.getParameters()); target.append(COMMA); target.append(MESSAGE).append(COLON); ScriptUtils.appendScript(target, converter.getMessage()); target.append(RIGHT_CURLY_BRACKET); }
protected void appendConverter(Appendable target, LibraryScriptFunction converter) throws IOException { target.append(LEFT_CURLY_BRACKET).append("f").append(COLON).append(converter.getName()).append(COMMA); target.append(PARAMS).append(COLON); ScriptUtils.appendScript(target, converter.getParameters()); target.append(COMMA); target.append(MESSAGE).append(COLON); ScriptUtils.appendScript(target, converter.getMessage()); target.append(RIGHT_CURLY_BRACKET); }
public void appendScript(Appendable target) throws IOException { Object chainedToggleHandler = chain(toggleHandler, nodeToggleHandler); Object chainedBeforeToggleHandler = chain(beforeToggleHandler, beforeNodeToggleHandler); if (chainedToggleHandler != null || chainedBeforeToggleHandler != null) { Map<String, Object> map = new HashMap<String, Object>(2); if (chainedToggleHandler != null) { map.put("th", chainedToggleHandler); } if (chainedBeforeToggleHandler != null) { map.put("bth", chainedBeforeToggleHandler); } ScriptUtils.appendScript(target, map); } else { ScriptUtils.appendScript(target, null); } } }
public void appendScript(Appendable target) throws IOException { Object chainedToggleHandler = chain(toggleHandler, nodeToggleHandler); Object chainedBeforeToggleHandler = chain(beforeToggleHandler, beforeNodeToggleHandler); if (chainedToggleHandler != null || chainedBeforeToggleHandler != null) { Map<String, Object> map = new HashMap<String, Object>(2); if (chainedToggleHandler != null) { map.put("th", chainedToggleHandler); } if (chainedBeforeToggleHandler != null) { map.put("bth", chainedBeforeToggleHandler); } ScriptUtils.appendScript(target, map); } else { ScriptUtils.appendScript(target, null); } } }
/** * Convert any Java Object to JavaScript representation ( as possible ). * * @param obj * @return Java Object converted to JavaScript representation */ public static String toScript(Object obj) { StringBuilder sb = new StringBuilder(); if ((obj != null) && (obj instanceof String)) sb.ensureCapacity((int)(((String) obj).length() * 1.66)); try { appendScript(sb, obj, new IdentityHashMap<Object, Boolean>()); } catch (IOException e) { // ignore } return sb.toString(); }
public void appendScript(Appendable target) throws IOException { target.append(name).append('('); boolean first = true; List<?> parameters = getParameters(); if (null != parameters) { for (Iterator<?> param = parameters.iterator(); param.hasNext();) { Object element = param.next(); if (!first) { target.append(','); } if (null != element) { ScriptUtils.appendScript(target, element); } else { target.append("null"); } first = false; } } target.append(")"); }
public void encode(FacesContext context) throws IOException { ScriptUtils.appendScript(context.getExternalContext().getResponseOutputWriter(), getData(context)); }
public void appendScript(Appendable target) throws IOException { if (options.getBeforesubmitHandler() == null) { appendAjaxFunctionCall(target); } else { StringBuilder ajaxCall = new StringBuilder(); appendAjaxFunctionCall(ajaxCall); ScriptUtils.appendScript(target, new JSChainJSFFunction(options.getBeforesubmitHandler(), ajaxCall.toString())); } } }
public void appendScript(Appendable target) throws IOException { if (options.getBeforesubmitHandler() == null) { appendAjaxFunctionCall(target); } else { StringBuilder ajaxCall = new StringBuilder(); appendAjaxFunctionCall(ajaxCall); ScriptUtils.appendScript(target, new JSChainJSFFunction(options.getBeforesubmitHandler(), ajaxCall.toString())); } } }
public void appendScript(Appendable target) throws IOException { if (options.getBeforesubmitHandler() == null) { appendAjaxFunctionCall(target); } else { StringBuilder ajaxCall = new StringBuilder(); appendAjaxFunctionCall(ajaxCall); ScriptUtils.appendScript(target, new JSChainJSFFunction(options.getBeforesubmitHandler(), ajaxCall.toString())); } } }