Class JConstructor
Represents a JSON constructor.
Implements
Inherited Members
Namespace: Bayat.Json.Linq
Assembly: Bayat.Json.Runtime.dll
Syntax
public class JConstructor : JContainer, IJEnumerable<JToken>, IJsonLineInfo, ICloneable, IDynamicMetaObjectProvider, IList<JToken>, ICollection<JToken>, IEnumerable<JToken>, ITypedList, IBindingList, IList, ICollection, IEnumerable, INotifyCollectionChanged
Constructors
| Improve this Doc View SourceJConstructor()
Initializes a new instance of the JConstructor class.
Declaration
public JConstructor()
JConstructor(JConstructor)
Initializes a new instance of the JConstructor class from another JConstructor object.
Declaration
public JConstructor(JConstructor other)
Parameters
| Type | Name | Description |
|---|---|---|
| JConstructor | other | A JConstructor object to copy from. |
JConstructor(String)
Initializes a new instance of the JConstructor class with the specified name.
Declaration
public JConstructor(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The constructor name. |
JConstructor(String, Object)
Initializes a new instance of the JConstructor class with the specified name and content.
Declaration
public JConstructor(string name, object content)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The constructor name. |
| System.Object | content | The contents of the constructor. |
JConstructor(String, Object[])
Initializes a new instance of the JConstructor class with the specified name and content.
Declaration
public JConstructor(string name, params object[] content)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The constructor name. |
| System.Object[] | content | The contents of the constructor. |
Properties
| Improve this Doc View SourceChildrenTokens
Gets the container's children tokens.
Declaration
protected override IList<JToken> ChildrenTokens { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<JToken> | The container's children tokens. |
Overrides
| Improve this Doc View SourceItem[Object]
Gets the JToken with the specified key.
Declaration
public override JToken this[object key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | key |
Property Value
| Type | Description |
|---|---|
| JToken | The JToken with the specified key. |
Overrides
| Improve this Doc View SourceName
Gets or sets the name of this constructor.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The constructor name. |
Type
Gets the node type for this JToken.
Declaration
public override JTokenType Type { get; }
Property Value
| Type | Description |
|---|---|
| JTokenType | The type. |
Overrides
Methods
| Improve this Doc View SourceCloneToken()
Declaration
public override JToken CloneToken()
Returns
| Type | Description |
|---|---|
| JToken |
Overrides
| Improve this Doc View SourceDeepEquals(JToken)
Declaration
public override bool DeepEquals(JToken node)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | node |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
| Improve this Doc View SourceGetDeepHashCode()
Declaration
public override int GetDeepHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
| Improve this Doc View SourceIndexOfItem(JToken)
Declaration
public override int IndexOfItem(JToken item)
Parameters
| Type | Name | Description |
|---|---|---|
| JToken | item |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
| Improve this Doc View SourceLoad(JsonReader)
Loads an JConstructor from a JsonReader.
Declaration
public static JConstructor Load(JsonReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonReader | reader | A JsonReader that will be read for the content of the JConstructor. |
Returns
| Type | Description |
|---|---|
| JConstructor | A JConstructor that contains the JSON that was read from the specified JsonReader. |
Load(JsonReader, JsonLoadSettings)
Loads an JConstructor from a JsonReader.
Declaration
public static JConstructor Load(JsonReader reader, JsonLoadSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonReader | reader | A JsonReader that will be read for the content of the JConstructor. |
| JsonLoadSettings | settings | The JsonLoadSettings used to load the JSON. If this is null, default load settings will be used. |
Returns
| Type | Description |
|---|---|
| JConstructor | A JConstructor that contains the JSON that was read from the specified JsonReader. |
MergeItem(Object, JsonMergeSettings)
Declaration
public override void MergeItem(object content, JsonMergeSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | content | |
| JsonMergeSettings | settings |
Overrides
| Improve this Doc View SourceWriteTo(JsonWriter, JsonConverter[])
Writes this token to a JsonWriter.
Declaration
public override void WriteTo(JsonWriter writer, params JsonConverter[] converters)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonWriter | writer | A JsonWriter into which this method will write. |
| JsonConverter[] | converters | A collection of JsonConverter which will be used when writing the token. |