Class XmlNodeConverter
Converts XML to and from JSON.
Inherited Members
Namespace: Bayat.Json.Converters
Assembly: Bayat.Json.Runtime.dll
Syntax
public class XmlNodeConverter : JsonConverter
Properties
| Improve this Doc View SourceDeserializeRootElementName
Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements.
Declaration
public string DeserializeRootElementName { get; set; }
Property Value
| Type | Description |
|---|---|
| System. |
The name of the deserialize root element. |
OmitRootObject
Gets or sets a value indicating whether to write the root JSON object.
Declaration
public bool OmitRootObject { get; set; }
Property Value
| Type | Description |
|---|---|
| System. |
|
WriteArrayAttribute
Gets or sets a flag to indicate whether to write the Json.NET array attribute. This attribute helps preserve arrays when converting the written XML back to JSON.
Declaration
public bool WriteArrayAttribute { get; set; }
Property Value
| Type | Description |
|---|---|
| System. |
|
Methods
| Improve this Doc View SourceCanConvert(Type)
Determines whether this instance can convert the specified value type.
Declaration
public override bool CanConvert(Type valueType)
Parameters
| Type | Name | Description |
|---|---|---|
| System. |
valueType | Type of the value. |
Returns
| Type | Description |
|---|---|
| System. |
|
Overrides
| Improve this Doc View SourceReadJson(JsonReader, Type, Object, JsonSerializerReader)
Reads the JSON representation of the object.
Declaration
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializerReader internalReader)
Parameters
| Type | Name | Description |
|---|---|---|
| Json |
reader | The Json |
| System. |
objectType | Type of the object. |
| System. |
existingValue | The existing value of object being read. |
| Json |
internalReader |
Returns
| Type | Description |
|---|---|
| System. |
The object value. |
Overrides
| Improve this Doc View SourceWriteJson(JsonWriter, Object, JsonSerializerWriter)
Writes the JSON representation of the object.
Declaration
public override void WriteJson(JsonWriter writer, object value, JsonSerializerWriter internalWriter)
Parameters
| Type | Name | Description |
|---|---|---|
| Json |
writer | The Json |
| System. |
value | The value. |
| Json |
internalWriter |