Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSEncoder


  }
 
  public String escapeJavaScript(Object o) {
    if (o != null) {
      StringBuilder result = new StringBuilder();
      JSEncoder encoder = new JSEncoder();

      char chars[] = o.toString().toCharArray();
            int start = 0;
            int end = chars.length;
      for (int x = start; x < end; x++) {
                char c = chars[x];
               
                if (encoder.compile(c)) {
                    continue;
                }
               
                if (start != x) {
                  result.append(chars, start, x - start );
                }
               
                result.append(encoder.encode(c));
                start = x + 1;
               
                continue;
            }
     
View Full Code Here


        }
  } 
 
  public String escapeJavaScript(Object s) {
    if (s != null) {
      JSEncoder encoder = new JSEncoder();
      StringBuffer result = new StringBuffer();
      String string = s.toString();
      int length = string.length();
     
      for (int i = 0; i < length; i++) {
        result.append(encoder.encode(string.charAt(i)));
      }

      return result.toString();
    } else {
      return null;
View Full Code Here

        }
  } 
 
  public String escapeJavaScript(Object s) {
    if (s != null) {
      JSEncoder encoder = new JSEncoder();
      StringBuffer result = new StringBuffer();
      String string = s.toString();
      int length = string.length();
     
      for (int i = 0; i < length; i++) {
        result.append(encoder.encode(string.charAt(i)));
      }

      return result.toString();
    } else {
      return null;
View Full Code Here

  }
 
  public String escapeJavaScript(Object o) {
    if (o != null) {
      StringBuilder result = new StringBuilder();
      JSEncoder encoder = new JSEncoder();

      char chars[] = o.toString().toCharArray();
            int start = 0;
            int end = chars.length;
      for (int x = start; x < end; x++) {
                char c = chars[x];
               
                if (encoder.compile(c)) {
                    continue;
                }
               
                if (start != x) {
                  result.append(chars, start, x - start );
                }
               
                result.append(encoder.encode(c));
                start = x + 1;
               
                continue;
            }
     
View Full Code Here

  }
 
  public String escapeJavaScript(Object o) {
    if (o != null) {
      StringBuilder result = new StringBuilder();
      JSEncoder encoder = new JSEncoder();

      char chars[] = o.toString().toCharArray();
            int start = 0;
            int end = chars.length;
      for (int x = start; x < end; x++) {
                char c = chars[x];
               
                if (encoder.compile(c)) {
                    continue;
                }
               
                if (start != x) {
                  result.append(chars, start, x - start );
                }
               
                result.append(encoder.encode(c));
                start = x + 1;
               
                continue;
            }
     
View Full Code Here

  }

  protected String getPredefinedMarker(FacesContext context, Object facetName) {
    if (MARKERS_PREDEFINED.contains(facetName)) {
      StringBuffer buff = new StringBuffer();
      JSEncoder encoder = new JSEncoder();
      String source = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\""  +
        getResource("/org/richfaces/renderkit/html/images/" + facetName + ".gif").getUri(context, null) +"\" />";
            char chars[] = source.toString().toCharArray();
            for (int i = 0; i < chars.length; i++) {
                    char c = chars[i];
                    if (!encoder.compile(c)) {
                            buff.append(encoder.encode(c));
                    } else {
                            buff.append(c);
                    }
            }
      return buff.toString();
View Full Code Here

    return HtmlUtil.expandIdSelector(selector, component, context);
  }
 
  public String escapeJavaScript(Object o) {
    if (o != null) {
      JSEncoder encoder = new JSEncoder();
      StringBuffer result = new StringBuffer();
      String string = o.toString();
      int length = string.length();
     
      for (int i = 0; i < length; i++) {
        result.append(encoder.encode(string.charAt(i)));
      }

      return result.toString();
    } else {
      return null;
View Full Code Here

TOP

Related Classes of org.ajax4jsf.javascript.JSEncoder

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.