Class JsonFragment
java.lang.Object
com.northconcepts.datapipeline.json.builder.JsonNode
com.northconcepts.datapipeline.json.builder.JsonFragment
- Direct Known Subclasses:
JsonConditionalNode,JsonDetailMarker,JsonTemplate
Base class for template nodes that write only their children, not JSON of their own, and take their type from
the parent node.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetail()Adds and returns the detail marker; the nodes added to it are written once for each record.protected DataExceptionWraps the throwable in aDataExceptionwith this node's type, class and children; subclasses add their own details.getType()Returns the kind of JSON this node represents, which determines the child nodes it accepts.Adds and returns a fragment whose nodes are written only when the given logical expression is true.protected voidwriteEndImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator) Writes this node's closing output, if any (such as an end-object or end-array token), after its children.protected voidwriteStartImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator) Writes this node's opening output, if any: a start-object or start-array token, a field name or a scalar value.
-
Constructor Details
-
JsonFragment
-
-
Method Details
-
getParentNode
-
getType
Description copied from class:JsonNodeReturns the kind of JSON this node represents, which determines the child nodes it accepts. -
writeStartImpl
protected void writeStartImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator) throws Throwable Description copied from class:JsonNodeWrites this node's opening output, if any: a start-object or start-array token, a field name or a scalar value.- Specified by:
writeStartImplin classJsonNode- Throws:
Throwable
-
writeEndImpl
protected void writeEndImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator) throws Throwable Description copied from class:JsonNodeWrites this node's closing output, if any (such as an end-object or end-array token), after its children.- Specified by:
writeEndImplin classJsonNode- Throws:
Throwable
-
when
Description copied from class:JsonNodeAdds and returns a fragment whose nodes are written only when the given logical expression is true. -
detail
Description copied from class:JsonNodeAdds and returns the detail marker; the nodes added to it are written once for each record. -
exception
Description copied from class:JsonNodeWraps the throwable in aDataExceptionwith this node's type, class and children; subclasses add their own details.
-