Interface StructuredField
- All Known Implementing Classes:
StructuredBoolean,StructuredBytes,StructuredDecimal,StructuredDictionary,StructuredInnerList,StructuredInteger,StructuredItem,StructuredList,StructuredString,StructuredToken
public interface StructuredField
Common interface for all Structured Fields
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StructuredFieldParses given string for Structured Field, according to the specificationSerializes this item to String according to the specification
-
Method Details
-
serialize
String serialize()Serializes this item to String according to the specificationBoth value and parameters are serialized
- Returns:
- Serialized representation of this Structured Field
- See Also:
-
parse
Parses given string for Structured Field, according to the specificationClass of returned value depends on parsed content, and it can be any class implementing
StructuredFieldinterface. In case of ambiguity, the simplest implementation is returned (Item then List then Dictionary). For example:-
ok is a valid Token and single-element List of Tokens and single-element Dictionary with ok key and true value.
Here,
StructuredTokenwill be returned. -
ok, not is a valid List of Tokens and a Dictionary with true values. Here,
StructuredListwill be returned.
- Parameters:
httpHeader- String to parse, e.g. an HTTP header- Returns:
- Parsed Structured Field
- Throws:
StructuredException- Thrown in case of malformatted string- See Also:
-
ok is a valid Token and single-element List of Tokens and single-element Dictionary with ok key and true value.
Here,
-