Package io.bit3.jsass.type
Class SassString
- java.lang.Object
-
- io.bit3.jsass.type.SassString
-
-
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()
-
-
-
Field Detail
-
TYPE
public static final int TYPE
- See Also:
- Constant Field Values
-
DEFAULT_QUOTE_CHARACTER
public static final char DEFAULT_QUOTE_CHARACTER
The default quote character.- See Also:
- Constant Field Values
-
-
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 interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfacejava.lang.CharSequence
-
chars
public java.util.stream.IntStream chars()
- Specified by:
chars
in interfacejava.lang.CharSequence
-
codePoints
public java.util.stream.IntStream codePoints()
- Specified by:
codePoints
in interfacejava.lang.CharSequence
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.lang.CharSequence
- Overrides:
toString
in classjava.lang.Object
-
-