Class Token
- java.lang.Object
-
- net.morimekta.util.CharSlice
-
- net.morimekta.providence.serializer.pretty.Token
-
- All Implemented Interfaces:
java.lang.CharSequence
,java.lang.Comparable<net.morimekta.util.CharSlice>
,net.morimekta.util.Stringable
public class Token extends net.morimekta.util.CharSlice
Pretty token.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
B64
static java.lang.String
HEX
static char
kCarriageReturn
static char
kFieldValueSep
static char
kGenericEnd
static char
kGenericStart
static char
kIdentifierSep
static char
kKeyValueSep
static char
kLineSep1
static char
kLineSep2
static char
kListEnd
static char
kListStart
static char
kLiteralDoubleQuote
static char
kLiteralEscape
static char
kLiteralQuote
static char
kMessageEnd
static char
kMessageStart
static char
kNewLine
static char
kParamsEnd
static char
kParamsStart
static char
kShellComment
static char
kSpace
static java.lang.String
kSymbols
static char
kTab
-
Constructor Summary
Constructors Constructor Description Token(char[] fb, int off, int len, int lineNo, int linePos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
decodeLiteral(boolean strict)
Get the whole slice as a string.boolean
equals(java.lang.Object o)
int
getLineNo()
int
getLinePos()
int
getOffset()
int
hashCode()
boolean
isDoubleQualifiedIdentifier()
boolean
isIdentifier()
boolean
isInteger()
boolean
isQualifiedIdentifier()
boolean
isReal()
boolean
isReferenceIdentifier()
boolean
isStringLiteral()
boolean
isSymbol(char symbol)
boolean
strEquals(java.lang.String str)
java.lang.String
toString()
-
-
-
Field Detail
-
kGenericStart
public static final char kGenericStart
- See Also:
- Constant Field Values
-
kGenericEnd
public static final char kGenericEnd
- See Also:
- Constant Field Values
-
kMessageStart
public static final char kMessageStart
- See Also:
- Constant Field Values
-
kMessageEnd
public static final char kMessageEnd
- See Also:
- Constant Field Values
-
kKeyValueSep
public static final char kKeyValueSep
- See Also:
- Constant Field Values
-
kFieldValueSep
public static final char kFieldValueSep
- See Also:
- Constant Field Values
-
kParamsStart
public static final char kParamsStart
- See Also:
- Constant Field Values
-
kParamsEnd
public static final char kParamsEnd
- See Also:
- Constant Field Values
-
kListStart
public static final char kListStart
- See Also:
- Constant Field Values
-
kListEnd
public static final char kListEnd
- See Also:
- Constant Field Values
-
kLineSep1
public static final char kLineSep1
- See Also:
- Constant Field Values
-
kLineSep2
public static final char kLineSep2
- See Also:
- Constant Field Values
-
kIdentifierSep
public static final char kIdentifierSep
- See Also:
- Constant Field Values
-
kLiteralEscape
public static final char kLiteralEscape
- See Also:
- Constant Field Values
-
kLiteralQuote
public static final char kLiteralQuote
- See Also:
- Constant Field Values
-
kLiteralDoubleQuote
public static final char kLiteralDoubleQuote
- See Also:
- Constant Field Values
-
kShellComment
public static final char kShellComment
- See Also:
- Constant Field Values
-
kNewLine
public static final char kNewLine
- See Also:
- Constant Field Values
-
kCarriageReturn
public static final char kCarriageReturn
- See Also:
- Constant Field Values
-
kSpace
public static final char kSpace
- See Also:
- Constant Field Values
-
kTab
public static final char kTab
- See Also:
- Constant Field Values
-
B64
public static final java.lang.String B64
- See Also:
- Constant Field Values
-
HEX
public static final java.lang.String HEX
- See Also:
- Constant Field Values
-
kSymbols
public static final java.lang.String kSymbols
- See Also:
- Constant Field Values
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classnet.morimekta.util.CharSlice
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classnet.morimekta.util.CharSlice
-
getLineNo
public int getLineNo()
-
getLinePos
public int getLinePos()
-
isSymbol
public boolean isSymbol(char symbol)
-
isStringLiteral
public boolean isStringLiteral()
-
isIdentifier
public boolean isIdentifier()
-
isQualifiedIdentifier
public boolean isQualifiedIdentifier()
-
isDoubleQualifiedIdentifier
public boolean isDoubleQualifiedIdentifier()
-
isReferenceIdentifier
public boolean isReferenceIdentifier()
-
isInteger
public boolean isInteger()
-
isReal
public boolean isReal()
-
strEquals
public boolean strEquals(java.lang.String str)
-
decodeLiteral
public java.lang.String decodeLiteral(boolean strict)
Get the whole slice as a string.- Parameters:
strict
- If it should validate string content strictly.- Returns:
- Slice decoded as UTF_8 string.
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.lang.CharSequence
- Overrides:
toString
in classnet.morimekta.util.CharSlice
-
getOffset
public int getOffset()
-
-