[#BloombergLP-baljsn-EncodeImplUtil_AttributeVisitor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::EncodeImplUtil&lowbar;AttributeVisitor
: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;attribute&quot; object that satisfies one of the `bdlat` type&hyphen;category concepts, and an &quot;attribute info&quot; object that describes various metadata of the attribute&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;AttributeVisitor;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baljsn/EncodeImplUtil_AttributeVisitor/FormattingMode.adoc[`FormattingMode`] 
| `FormattingMode` is an alias to the type of an `int`&hyphen;valued `bdlat&lowbar;FormattingMode` bit&hyphen;field&period; A `FormattingMode` value is not valid unless it is equal to an enumerator of `bdlat&lowbar;FormattingMode` or a valid bitwise&hyphen;or of two or more such enumerators&period; See the component&hyphen;level documentation of &lcub;`bdlat&lowbar;formattingmode`&rcub; for a description of the set of valid formatting&hyphen;mode values&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baljsn/EncodeImplUtil_AttributeVisitor/2constructor.adoc[`EncodeImplUtil&lowbar;AttributeVisitor`]         [.small]#[constructor]#
| Construct an `EncodeImplUtil&lowbar;AttributeVisitor` object having the specified `formatter`, `logStream`, `isNextAttributeFirst`, and `options` attributes&period;
| xref:BloombergLP/baljsn/EncodeImplUtil_AttributeVisitor/isNextAttributeFirst.adoc[`isNextAttributeFirst`] 
| Return the value of the `isNextAttributeFirst` attribute of this object&period;
| xref:BloombergLP/baljsn/EncodeImplUtil_AttributeVisitor/operator_call.adoc[`operator()`] 
| Encode the JSON representation of the specified `attribute`, having the name equal to the `name` of the specified `attributeInfo`, to the JSON `formatter` attribute of this object according to the `formattingMode` attribute of this object&period; If the `isNextAttributeFirst` attribute of this object is `true`, then the representation of the attribute 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 `attribute`&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 `attribute` satisfies both the static and dynamic requirements of the `bdlat` type&hyphen;category concept corresponding to the specified `category`&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 `attribute`&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]#
