com.vaadin.sass.internal.util
Class StringUtil

java.lang.Object
  extended by com.vaadin.sass.internal.util.StringUtil

public class StringUtil
extends java.lang.Object


Constructor Summary
StringUtil()
           
 
Method Summary
static java.lang.String cleanPath(java.lang.String path)
           
static java.lang.String collectionToDelimitedString(java.util.Collection coll, java.lang.String delim)
           
static java.lang.String collectionToDelimitedString(java.util.Collection coll, java.lang.String delim, java.lang.String prefix, java.lang.String suffix)
           
static boolean containsSubString(java.lang.String text, java.lang.String sub)
          Check if a String contains a sub string, using whole word match.
static boolean containsVariable(java.lang.String text, java.lang.String varName)
          Check if a String contains a SCSS variable, using whole word match.
static java.lang.String[] delimitedListToStringArray(java.lang.String str, java.lang.String delimiter)
           
static java.lang.String removeDuplicatedSubString(java.lang.String motherString, java.lang.String splitter)
          Remove duplicated sub string in a String given a splitter.
static java.lang.String replace(java.lang.String inString, java.lang.String oldPattern, java.lang.String newPattern)
           
static java.lang.String replaceSubString(java.lang.String text, java.lang.String sub, java.lang.String value)
          Replace the sub string in a String to a value, using whole word match.
static java.lang.String replaceVariable(java.lang.String text, java.lang.String varName, java.lang.String value)
          Replace the SCSS variable in a String to its corresponding value, using whole word match.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

cleanPath

public static java.lang.String cleanPath(java.lang.String path)

replace

public static java.lang.String replace(java.lang.String inString,
                                       java.lang.String oldPattern,
                                       java.lang.String newPattern)

delimitedListToStringArray

public static java.lang.String[] delimitedListToStringArray(java.lang.String str,
                                                            java.lang.String delimiter)

collectionToDelimitedString

public static java.lang.String collectionToDelimitedString(java.util.Collection coll,
                                                           java.lang.String delim,
                                                           java.lang.String prefix,
                                                           java.lang.String suffix)

collectionToDelimitedString

public static java.lang.String collectionToDelimitedString(java.util.Collection coll,
                                                           java.lang.String delim)

containsVariable

public static boolean containsVariable(java.lang.String text,
                                       java.lang.String varName)
Check if a String contains a SCSS variable, using whole word match.

Parameters:
text - text to be checked
Returns:
true if the text contains the SCSS variable, false if not

replaceVariable

public static java.lang.String replaceVariable(java.lang.String text,
                                               java.lang.String varName,
                                               java.lang.String value)
Replace the SCSS variable in a String to its corresponding value, using whole word match.

Parameters:
text - text which contains the SCSS variable
varName - SCSS variable name (Without '$' sign)
value - the value of the SCSS variable
Returns:
the String after replacing

containsSubString

public static boolean containsSubString(java.lang.String text,
                                        java.lang.String sub)
Check if a String contains a sub string, using whole word match.

Parameters:
text - text to be checked
Returns:
true if the text contains the sub string, false if not

replaceSubString

public static java.lang.String replaceSubString(java.lang.String text,
                                                java.lang.String sub,
                                                java.lang.String value)
Replace the sub string in a String to a value, using whole word match.

Parameters:
text - text which contains the sub string
sub - the sub string
value - the new value
Returns:
the String after replacing

removeDuplicatedSubString

public static java.lang.String removeDuplicatedSubString(java.lang.String motherString,
                                                         java.lang.String splitter)
Remove duplicated sub string in a String given a splitter. Can be used to removed duplicated selectors, e.g., in ".error.error", one duplicated ".error" can be removed.

Parameters:
motherString - string which may contains duplicated sub strings
splitter - the splitter splits the mother string to sub strings
Returns:
the mother string with duplicated sub strings removed


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.