Package sk.antons.json.literal.impl
Class JsonLiteralImpl
- java.lang.Object
-
- sk.antons.json.impl.JsonValueImpl
-
- sk.antons.json.literal.impl.JsonLiteralImpl
-
- All Implemented Interfaces:
JsonMember,JsonValue,JsonLiteral
- Direct Known Subclasses:
JsonBoolLiteralImpl,JsonExpLiteralImpl,JsonFracLiteralImpl,JsonIntLiteralImpl,JsonNullLiteralImpl,JsonStringLiteralImpl
public abstract class JsonLiteralImpl extends JsonValueImpl implements JsonLiteral
- Author:
- antons
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonLiteralImpl.Type
-
Field Summary
Fields Modifier and Type Field Description protected StringcachedValueStringprotected intlengthprotected Stringliteralprotected intoffset-
Fields inherited from class sk.antons.json.impl.JsonValueImpl
group
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJsonLiteralImpl(String literal)protectedJsonLiteralImpl(String literal, int offset, int length)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidfindAll(PathMatcher matcher, List<JsonValue> values, List<String> path)JsonValuefindFirst(PathMatcher matcher, List<String> path)static JsonLiteralImplinstance(String literal, int offset, int length)Stringliteral()String representing literal.voidremove()Removes this instance from parent object.StringstringValue()String value of this literal.voidtoCompactString(StringBuilder sb)voidtoPrettyString(StringBuilder sb, String prefix, String indent)abstract JsonLiteralImpl.Typetype()-
Methods inherited from class sk.antons.json.impl.JsonValueImpl
asArray, asBoolLiteral, asExpLiteral, asFracLiteral, asIntLiteral, asLiteral, asNullLiteral, asObject, asStringLiteral, findAll, findAllLiterals, findFirst, findFirstLiteral, group, isArray, isBoolLiteral, isDescendantOf, isExpLiteral, isFracLiteral, isIntLiteral, isLiteral, isNullLiteral, isObject, isStringLiteral, name, parent, parentIndex, path, pathAsString, replaceBy, setGroup, toCompactString, toPrettyString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface sk.antons.json.JsonValue
asArray, asBoolLiteral, asExpLiteral, asFracLiteral, asIntLiteral, asLiteral, asNullLiteral, asObject, asStringLiteral, asTemplateParam, copy, findAll, findAllLiterals, findFirst, findFirstLiteral, isArray, isBoolLiteral, isDescendantOf, isExpLiteral, isFracLiteral, isIntLiteral, isLiteral, isNullLiteral, isObject, isStringLiteral, name, parent, parentIndex, path, pathAsString, replaceBy, toCompactString, toPrettyString
-
-
-
-
Method Detail
-
type
public abstract JsonLiteralImpl.Type type()
-
instance
public static JsonLiteralImpl instance(String literal, int offset, int length)
-
literal
public String literal()
Description copied from interface:JsonLiteralString representing literal. ("foo", 123, true, null, 12.3....)- Specified by:
literalin interfaceJsonLiteral- Returns:
- literal string
-
stringValue
public String stringValue()
Description copied from interface:JsonLiteralString value of this literal. (for string literal "foo" it returns foo)- Specified by:
stringValuein interfaceJsonLiteral- Returns:
- string value of this literal
-
toCompactString
public void toCompactString(StringBuilder sb)
- Specified by:
toCompactStringin classJsonValueImpl
-
toPrettyString
public void toPrettyString(StringBuilder sb, String prefix, String indent)
- Specified by:
toPrettyStringin classJsonValueImpl
-
findFirst
public JsonValue findFirst(PathMatcher matcher, List<String> path)
- Specified by:
findFirstin classJsonValueImpl
-
findAll
public void findAll(PathMatcher matcher, List<JsonValue> values, List<String> path)
- Specified by:
findAllin classJsonValueImpl
-
remove
public void remove()
Description copied from interface:JsonValueRemoves this instance from parent object.- Specified by:
removein interfaceJsonValue- Overrides:
removein classJsonValueImpl
-
-