Package io.crums.model.json
Class CrumTrailParser
java.lang.Object
io.crums.model.json.CrumTrailParser
public class CrumTrailParser
extends java.lang.Object
JSON crum trail parser.
- See Also:
proofParser()
,crumParser()
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CRUM
static CrumTrailParser
INSTANCE
Instances of this class are immutable and stateless.static java.lang.String
PROOF
-
Constructor Summary
Constructors Constructor Description CrumTrailParser()
CrumTrailParser(ProofParser proofParser, CrumParser crumParser)
-
Method Summary
Modifier and Type Method Description CrumParser
crumParser()
ProofParser
proofParser()
CrumRecord
toCrumRecord(org.json.simple.JSONObject jtrail)
Returns the optionally trailed CrumRecord.java.util.List<CrumRecord>
toCrumRecords(java.lang.Object oa)
java.util.List<CrumRecord>
toCrumRecords(java.lang.String json)
Converts and returns the given string as a list of CrumRecords.CrumTrail
toCrumTrail(java.lang.String json)
CrumTrail
toCrumTrail(org.json.simple.JSONObject jtrail)
org.json.simple.JSONObject
toJsonObject(CrumTrail trail)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
INSTANCE
Instances of this class are immutable and stateless. -
PROOF
public static final java.lang.String PROOF- See Also:
- Constant Field Values
-
CRUM
public static final java.lang.String CRUM- See Also:
- Constant Field Values
-
-
Constructor Details
-
CrumTrailParser
public CrumTrailParser() -
CrumTrailParser
-
-
Method Details
-
toJsonObject
-
toCrumTrail
-
toCrumTrail
-
toCrumRecord
Returns the optionally trailed CrumRecord.- Parameters:
jtrail
-- Returns:
-
toCrumRecords
Converts and returns the given string as a list of CrumRecords. In the case of a single record, there is flexibility in the input: it may either be a singleton JSON array, or just a JSON object.- Parameters:
json
-- Returns:
-
toCrumRecords
-
proofParser
-
crumParser
-