Package com.dotcms.repackage.org.apache.commons.lang.text

Examples of com.dotcms.repackage.org.apache.commons.lang.text.StrBuilder


    /**
     * @since 1.5
     */
    public String toString()
    {
        StrBuilder str = new StrBuilder();
       
        boolean first = true;
        for(Token t : tokens) {
            str.append("[").append(t.image).append("]");
           
            if(first) first=false; else str.append(", ");
        }
       
        return new ToStringBuilder(this)
            .append("id", getType())
            .append("info", getInfo())
View Full Code Here


            (literalQuoteChar == '\'' && s.indexOf("'") == -1) )
        {
            return s;
        }
   
        StrBuilder result = new StrBuilder(s.length());
        char prev = ' ';
        for(int i = 0, is = s.length(); i < is; i++)
        {
            char c = s.charAt(i);
            if( i + 1 < is )
            {
                char next =  s.charAt(i + 1);
               
                // escaped "/'
                if( (literalQuoteChar == '"' && (next == '"' && c=='\\')) ||
                    (literalQuoteChar == '\'' && (next == '\'' && c=='\\')))
                {
                    i++;
                    c=literalQuoteChar;
                }
           }
           result.append(c);
        }
        return result.toString();
    }
View Full Code Here

    public static String unescape(final String string)
    {
        int u = string.indexOf("\\u");
        if (u < 0) return string;

        StrBuilder result = new StrBuilder();
       
        int lastCopied = 0;

        for (;;)
        {
            result.append(string.substring(lastCopied, u));

            /* we don't worry about an exception here,
             * because the lexer checked that string is correct */
            char c = (char) Integer.parseInt(string.substring(u + 2, u + 6), 16);
            result.append(c);

            lastCopied = u + 6;

            u = string.indexOf("\\u", lastCopied);
            if (u < 0)
            {
                result.append(string.substring(lastCopied));
                return result.toString();
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.commons.lang.text.StrBuilder

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.