Table of Contents

Class JConstructor

Namespace
Newtonsoft.Json.Linq
Assembly
Newtonsoft.Json.dll

Represents a JSON constructor.

public class JConstructor : JContainer, IJEnumerable<JToken>, IJsonLineInfo, ICloneable, IList<JToken>, ICollection<JToken>, IEnumerable<JToken>, ITypedList, IBindingList, IList, ICollection, IEnumerable
Inheritance
JConstructor
Implements
Inherited Members
Extension Methods

Constructors

JConstructor()

Initializes a new instance of the JConstructor class.

public JConstructor()

JConstructor(JConstructor)

Initializes a new instance of the JConstructor class from another JConstructor object.

public JConstructor(JConstructor other)

Parameters

other JConstructor

A JConstructor object to copy from.

JConstructor(string)

Initializes a new instance of the JConstructor class with the specified name.

public JConstructor(string name)

Parameters

name string

The constructor name.

JConstructor(string, object)

Initializes a new instance of the JConstructor class with the specified name and content.

public JConstructor(string name, object content)

Parameters

name string

The constructor name.

content object

The contents of the constructor.

JConstructor(string, params object[])

Initializes a new instance of the JConstructor class with the specified name and content.

public JConstructor(string name, params object[] content)

Parameters

name string

The constructor name.

content object[]

The contents of the constructor.

Properties

ChildrenTokens

Gets the container's children tokens.

protected override IList<JToken> ChildrenTokens { get; }

Property Value

IList<JToken>

The container's children tokens.

this[object]

Gets the JToken with the specified key.

public override JToken this[object key] { get; set; }

Parameters

key object

Property Value

JToken

The JToken with the specified key.

Name

Gets or sets the name of this constructor.

public string Name { get; set; }

Property Value

string

The constructor name.

Type

Gets the node type for this JToken.

public override JTokenType Type { get; }

Property Value

JTokenType

The type.

Methods

Load(JsonReader)

Loads an JConstructor from a JsonReader.

public static JConstructor Load(JsonReader reader)

Parameters

reader JsonReader

A JsonReader that will be read for the content of the JConstructor.

Returns

JConstructor

A JConstructor that contains the JSON that was read from the specified JsonReader.

WriteTo(JsonWriter, params JsonConverter[])

Writes this token to a JsonWriter.

public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)

Parameters

writer JsonWriter

A JsonWriter into which this method will write.

converters JsonConverter[]

A collection of JsonConverter which will be used when writing the token.