Package io.bit3.jsass.type
Class SassString
java.lang.Object
io.bit3.jsass.type.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 charDEFAULT_QUOTE_CHARACTERThe default quote character.static intTYPE -
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
Modifier and Type Method Description charcharAt(int index)java.util.stream.IntStreamchars()java.util.stream.IntStreamcodePoints()static java.lang.Stringescape(java.lang.String value)Escape the string with default quote character.static java.lang.Stringescape(java.lang.String value, char quote)Escape the string with given quote character.chargetQuote()Return the quotation character.java.lang.StringgetValue()Return the string value.booleanisQuoted()Determine if the string is quoted.intlength()voidsetQuote(char quote)Set the quotation character.voidsetQuoted(boolean quoted)Set if the string is quoted.voidsetValue(java.lang.String value)Set the string value.java.lang.CharSequencesubSequence(int start, int end)java.lang.StringtoString()
-
Field Details
-
TYPE
public static final int TYPE- See Also:
- Constant Field Values
-
DEFAULT_QUOTE_CHARACTER
public static final char DEFAULT_QUOTE_CHARACTERThe default quote character.- See Also:
- Constant Field Values
-
-
Constructor Details
-
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 Details
-
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:
lengthin interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)- Specified by:
charAtin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)- Specified by:
subSequencein interfacejava.lang.CharSequence
-
chars
public java.util.stream.IntStream chars()- Specified by:
charsin interfacejava.lang.CharSequence
-
codePoints
public java.util.stream.IntStream codePoints()- Specified by:
codePointsin interfacejava.lang.CharSequence
-
toString
public java.lang.String toString()- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object
-