Package railo.commons.lang

Examples of railo.commons.lang.StringList


  public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException {
    Argument arg = bif.getArguments()[0];
    Expression value = arg.getValue();
    if(value instanceof LitString) {
      String str=((LitString)value).getString();
      StringList sl = VariableInterpreter.parse(str,false);
      if(sl!=null){
        // scope
        str=sl.next();
        int scope = VariableInterpreter.scopeString2Int(str);
        if(scope==Scope.SCOPE_UNDEFINED)sl.reset();
       
        // keys
        String[] arr=sl.toArray();
        ArrayUtil.trim(arr);
       
        // update first arg
        arg.setValue(LitDouble.toExprDouble(scope),"number");
       
View Full Code Here


            path=path.substring(0,sqIndex);
          }
         
          StringBuilder res=new StringBuilder();
         
          StringList list = ListUtil.toListTrim(path, '/');
          String str;
         
          while(list.hasNext()){
            str=list.next();
            //str=URLDecoder.decode(str);
           
            if(StringUtil.isEmpty(str)) continue;
            res.append("/");
            res.append(escapeQSValue(str));
View Full Code Here

   
    private static String decodeQuery(String query,char startDelimiter) {
      if(!StringUtil.isEmpty(query)) {
        StringBuilder res=new StringBuilder();
         
          StringList list = ListUtil.toList(query, '&');
          String str;
          int index;
          char del=startDelimiter;
          while(list.hasNext()){
            res.append(del);
            del='&';
            str=list.next();
            index=str.indexOf('=');
            if(index==-1)res.append(escapeQSValue(str));
            else {
              res.append(escapeQSValue(str.substring(0,index)));
              res.append('=');
View Full Code Here

          }
         
         
          StringBuilder res=new StringBuilder();
         
          StringList list = ListUtil.toListTrim(path, '/');
          String str;
         
          while(list.hasNext()){
            str=list.next();
            //str=URLDecoder.decode(str);
           
            if(StringUtil.isEmpty(str)) continue;
            res.append("/");
            res.append(escapeQSValue(str));
View Full Code Here

     
   
        // query
        if(!StringUtil.isEmpty(query)){
         
          StringList list = ListUtil.toList(query, '&');
          String str;
          int index;
          char del='?';
          while(list.hasNext()){
            res.append(del);
            del='&';
            str=list.next();
            index=str.indexOf('=');
            if(index==-1)res.append(escapeQSValue(str));
            else {
              res.append(escapeQSValue(str.substring(0,index)));
              res.append('=');
View Full Code Here

 

  public static Map<String, String> parseParameterList(String _str, boolean decode,String charset) {
    //return railo.commons.net.HTTPUtil.toURI(strUrl,port);
    Map<String,String> data=new HashMap<String, String>();
    StringList list = ListUtil.toList(_str, '&');
      String str;
      int index;
      while(list.hasNext()){
        str=list.next();
        index=str.indexOf('=');
        if(index==-1){
          data.put(decode(str,decode), "");
        }
        else {
View Full Code Here

     * @param delimiter delimter of the list
     * @return Array Object
     */
    public static StringList listToStringListRemoveEmpty(String list, char delimiter) {
        int len=list.length();
        StringList rtn=new StringList();
        if(len==0) return rtn.reset();
        int last=0;
       
        for(int i=0;i<len;i++) {
            if(list.charAt(i)==delimiter) {
                if(last<i)rtn.add(list.substring(last,i));
                last=i+1;
            }
        }
        if(last<len)rtn.add(list.substring(last));

        return rtn.reset();
    }
View Full Code Here

     * @param list
     * @param delimiter
     * @return trimmed list
     */
    public static StringList toListTrim(String list, char delimiter) {
        if(list.length()==0) return new StringList();
        // remove at start
        while(list.indexOf(delimiter)==0) {
            list=list.substring(1);
        }
        int len=list.length();
        if(len==0) return new StringList();
        while(list.lastIndexOf(delimiter)==len-1) {
            list=list.substring(0,len-1<0?0:len-1);
            len=list.length();
        }
       
View Full Code Here

     * @param list
     * @param delimiter
     * @return list
     */
    public static StringList toList(String list, char delimiter) {
        if(list.length()==0) return new StringList();
        int len=list.length();
        int last=0;
       
        StringList rtn=new StringList();
      
        for(int i=0;i<len;i++) {
            if(list.charAt(i)==delimiter) {
                rtn.add(list.substring(last,i));
                last=i+1;
            }
        }
        if(last<=len)rtn.add(list.substring(last));
        rtn.reset();
        return rtn;
    }
View Full Code Here

        rtn.reset();
        return rtn;
    }
   
    public static StringList toWordList(String list) {
        if(list.length()==0) return new StringList();
        int len=list.length();
        int last=0;
        char c,l=0;
        StringList rtn=new StringList();
      
        for(int i=0;i<len;i++) {
            if(StringUtil.isWhiteSpace(c=list.charAt(i))) {
                rtn.add(list.substring(last,i),l);
                l=c;
                last=i+1;
            }
        }
        if(last<=len)rtn.add(list.substring(last),l);
        rtn.reset();
        return rtn;
    }
View Full Code Here

TOP

Related Classes of railo.commons.lang.StringList

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.