[#BloombergLP-baljsn-EncodeImplUtil_ElementVisitor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::EncodeImplUtil&lowbar;ElementVisitor
:relfileprefix: ../../
:mrdocs:

This component&hyphen;private class provides a function object that closes over the `formatter`, `logStream`, and `options` parameters that are shared between all encoding operations provided in this component&period; The function&hyphen;call operator of this class provides an overload set that accepts an &quot;element&quot; object that satisfies one of the `bdlat` type&hyphen;category concepts&period;

== Synopsis

Declared in `&lt;baljsn&lowbar;encodeimplutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FORMATTER&gt;
class EncodeImplUtil&lowbar;ElementVisitor;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baljsn/EncodeImplUtil_ElementVisitor/2constructor.adoc[`EncodeImplUtil&lowbar;ElementVisitor`]         [.small]#[constructor]#
| Construct an `EncodeImplUtil&lowbar;ElementVisitor` object having the specified `formatter`, `logStream`, `isNextElementFirst`, and `options` attributes&period;
| xref:BloombergLP/baljsn/EncodeImplUtil_ElementVisitor/isNextElementFirst.adoc[`isNextElementFirst`] 
| Return the value of the `isNextElementFirst` attribute of this object&period;
| xref:BloombergLP/baljsn/EncodeImplUtil_ElementVisitor/operator_call.adoc[`operator()`] 
| Encode the JSON representation of the specified `value` to the JSON `formatter` attribute of this object, according to the `formattingMode` attribute of this object&period; If the `isNextElementFirst` attribute of this object is `true`, then the representation of the value contains no leading sequence delimiter, and does contain such a delimiter otherwise&period; The `options` attribute of this object configures aspects of the JSON representation of the `value`&period; If this operation is not successful, load an unspecified, human&hyphen;readable description of the error condition to the `logStream` attribute of this object&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; The behavior is undefined unless the specified `TYPE` satisfies both the static and dynamic requirements of the specified `category` `bdlat` type&hyphen;category concept&period; See the component&hyphen;level documentation of &lcub;`baljsn&lowbar;encoderoptions`&rcub; for a description of the effects, if any, of each option in the `options` on the JSON representation of the `value`&period; See the package&hyphen;level documentation of &lcub;`bdlat`&rcub; for an introduction to the requirements of `bdlat` type&hyphen;category concepts&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
