Class SassString

  • All Implemented Interfaces:
    SassValue, java.lang.CharSequence

    public class SassString
    extends java.lang.Object
    implements java.lang.CharSequence, SassValue
    A sass probably quoted string value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static char DEFAULT_QUOTE_CHARACTER
      The default quote character.
      static int TYPE  
    • Constructor Summary

      Constructors 
      Constructor Description
      SassString​(java.lang.String value)
      Create a new single quoted string value.
      SassString​(java.lang.String value, boolean quoted)
      Create a new potentially quoted string value.
      SassString​(java.lang.String value, boolean quoted, char quote)
      Create a new potentially quoted string value with specific quotation character.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      char charAt​(int index)  
      java.util.stream.IntStream chars()  
      java.util.stream.IntStream codePoints()  
      static java.lang.String escape​(java.lang.String value)
      Escape the string with default quote character.
      static java.lang.String escape​(java.lang.String value, char quote)
      Escape the string with given quote character.
      char getQuote()
      Return the quotation character.
      java.lang.String getValue()
      Return the string value.
      boolean isQuoted()
      Determine if the string is quoted.
      int length()  
      void setQuote​(char quote)
      Set the quotation character.
      void setQuoted​(boolean quoted)
      Set if the string is quoted.
      void setValue​(java.lang.String value)
      Set the string value.
      java.lang.CharSequence subSequence​(int start, int end)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SassString

        public SassString​(java.lang.String value)
        Create a new single quoted string value.
        Parameters:
        value - The string value.
      • SassString

        public SassString​(java.lang.String value,
                          boolean quoted)
        Create a new potentially quoted string value.
        Parameters:
        value - The string value.
        quoted - Flag if the string is quoted.
      • SassString

        public SassString​(java.lang.String value,
                          boolean quoted,
                          char quote)
        Create a new potentially quoted string value with specific quotation character.
        Parameters:
        value - The string value.
        quoted - Flag if the string is quoted.
        quote - The quotation character.
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Return the string value.
        Returns:
        The string value.
      • setValue

        public void setValue​(java.lang.String value)
        Set the string value.
        Parameters:
        value - The string value.
      • isQuoted

        public boolean isQuoted()
        Determine if the string is quoted.
        Returns:
        true if the string is quoted.
      • setQuoted

        public void setQuoted​(boolean quoted)
        Set if the string is quoted.
        Parameters:
        quoted - The quotation state.
      • getQuote

        public char getQuote()
        Return the quotation character.
        Returns:
        The quotation character.
      • setQuote

        public void setQuote​(char quote)
        Set the quotation character.
        Parameters:
        quote - The quotation character.
      • escape

        public static java.lang.String escape​(java.lang.String value)
        Escape the string with default quote character.
      • escape

        public static java.lang.String escape​(java.lang.String value,
                                              char quote)
        Escape the string with given quote character.
      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • subSequence

        public java.lang.CharSequence subSequence​(int start,
                                                  int end)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • chars

        public java.util.stream.IntStream chars()
        Specified by:
        chars in interface java.lang.CharSequence
      • codePoints

        public java.util.stream.IntStream codePoints()
        Specified by:
        codePoints in interface java.lang.CharSequence
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object