![]() | JArray Class |
Namespace: Newtonsoft.Json.Linq
public class JArray : JContainer, IList<JToken>, ICollection<JToken>, IEnumerable<JToken>, IEnumerable
The JArray type exposes the following members.
Name | Description | |
---|---|---|
![]() | JArray |
Initializes a new instance of the JArray class.
|
![]() | JArray(Object) |
Initializes a new instance of the JArray class with the specified content.
|
![]() | JArray(Object) |
Initializes a new instance of the JArray class with the specified content.
|
![]() | JArray(JArray) |
Initializes a new instance of the JArray class from another JArray object.
|
Name | Description | |
---|---|---|
![]() | ChildrenTokens |
Gets the container's children tokens.
(Overrides JContainerChildrenTokens.) |
![]() | Count |
Gets the count of child JSON tokens.
(Inherited from JContainer.) |
![]() | First |
Get the first child token of this token.
(Inherited from JContainer.) |
![]() | HasValues |
Gets a value indicating whether this token has child tokens.
(Inherited from JContainer.) |
![]() | IsReadOnly |
Gets a value indicating whether the JArray is read-only.
|
![]() | ItemInt32 |
Gets or sets the JToken at the specified index.
|
![]() | ItemObject |
Gets the JToken with the specified key.
(Overrides JTokenItemObject.) |
![]() | Last |
Get the last child token of this token.
(Inherited from JContainer.) |
![]() | Next |
Gets the next sibling token of this node.
(Inherited from JToken.) |
![]() | Parent |
Gets or sets the parent.
(Inherited from JToken.) |
![]() | Path |
Gets the path of the JSON token.
(Inherited from JToken.) |
![]() | Previous |
Gets the previous sibling token of this node.
(Inherited from JToken.) |
![]() | Root | (Inherited from JToken.) |
![]() | Type |
Gets the node type for this JToken.
(Overrides JTokenType.) |
Name | Description | |
---|---|---|
![]() | Add(Object) |
Adds the specified content as children of this JToken.
(Inherited from JContainer.) |
![]() | Add(JToken) |
Adds an item to the JArray.
|
![]() | AddAfterSelf |
Adds the specified content immediately after this token.
(Inherited from JToken.) |
![]() | AddAnnotation |
Adds an object to the annotation list of this JToken.
(Inherited from JToken.) |
![]() | AddBeforeSelf |
Adds the specified content immediately before this token.
(Inherited from JToken.) |
![]() | AddFirst |
Adds the specified content as the first children of this JToken.
(Inherited from JContainer.) |
![]() | AfterSelf |
Returns a collection of the sibling tokens after this token, in document order.
(Inherited from JToken.) |
![]() | Ancestors |
Returns a collection of the ancestor tokens of this token.
(Inherited from JToken.) |
![]() | AncestorsAndSelf |
Returns a collection of tokens that contain this token, and the ancestors of this token.
(Inherited from JToken.) |
![]() | Annotation(Type) |
Gets the first annotation object of the specified type from this JToken.
(Inherited from JToken.) |
![]() | AnnotationT |
Get the first annotation object of the specified type from this JToken.
(Inherited from JToken.) |
![]() | Annotations(Type) |
Gets a collection of annotations of the specified type for this JToken.
(Inherited from JToken.) |
![]() | AnnotationsT |
Gets a collection of annotations of the specified type for this JToken.
(Inherited from JToken.) |
![]() | BeforeSelf |
Returns a collection of the sibling tokens before this token, in document order.
(Inherited from JToken.) |
![]() | Children |
Returns a collection of the child tokens of this token, in document order.
(Inherited from JContainer.) |
![]() | Clear |
Removes all items from the JArray.
|
![]() | Contains |
Determines whether the JArray contains a specific value.
|
![]() | CopyTo |
Copies the elements of the JArray to an array, starting at a particular array index.
|
![]() | CreateReader |
Creates a JsonReader for this token.
(Inherited from JToken.) |
![]() | CreateWriter |
Creates a JsonWriter that can be used to add tokens to the JToken.
(Inherited from JContainer.) |
![]() | DeepClone |
Creates a new instance of the JToken. All child tokens are recursively cloned.
(Inherited from JToken.) |
![]() | Descendants |
Returns a collection of the descendant tokens for this token in document order.
(Inherited from JContainer.) |
![]() | DescendantsAndSelf |
Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order.
(Inherited from JContainer.) |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | FromObject(Object) |
Creates a JArray from an object.
|
![]() ![]() | FromObject(Object, JsonSerializer) |
Creates a JArray from an object.
|
![]() | GetEnumerator |
Returns an enumerator that iterates through the collection.
|
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetMetaObject |
Returns the DynamicMetaObject responsible for binding operations performed on this object.
(Inherited from JToken.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IndexOf |
Determines the index of a specific item in the JArray.
|
![]() | Insert |
Inserts an item to the JArray at the specified index.
|
![]() ![]() | Load(JsonReader) |
Loads an JArray from a JsonReader.
|
![]() ![]() | Load(JsonReader, JsonLoadSettings) |
Loads an JArray from a JsonReader.
|
![]() ![]() | LoadAsync(JsonReader, CancellationToken) |
Asynchronously loads a JArray from a JsonReader.
|
![]() ![]() | LoadAsync(JsonReader, JsonLoadSettings, CancellationToken) |
Asynchronously loads a JArray from a JsonReader.
|
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Merge(Object) |
Merge the specified content into this JToken.
(Inherited from JContainer.) |
![]() | Merge(Object, JsonMergeSettings) |
Merge the specified content into this JToken using JsonMergeSettings.
(Inherited from JContainer.) |
![]() | OnAddingNew |
Raises the AddingNew event.
(Inherited from JContainer.) |
![]() | OnCollectionChanged |
Raises the CollectionChanged event.
(Inherited from JContainer.) |
![]() | OnListChanged |
Raises the ListChanged event.
(Inherited from JContainer.) |
![]() ![]() ![]() | Parse(String) |
Load a JArray from a string that contains JSON.
|
![]() ![]() ![]() | Parse(String, JsonLoadSettings) |
Load a JArray from a string that contains JSON.
|
![]() | Remove |
Removes this token from its parent.
(Inherited from JToken.) |
![]() | Remove(JToken) |
Removes the first occurrence of a specific object from the JArray.
|
![]() | RemoveAll |
Removes the child nodes from this token.
(Inherited from JContainer.) |
![]() | RemoveAnnotations(Type) |
Removes the annotations of the specified type from this JToken.
(Inherited from JToken.) |
![]() | RemoveAnnotationsT |
Removes the annotations of the specified type from this JToken.
(Inherited from JToken.) |
![]() | RemoveAt |
Removes the JArray item at the specified index.
|
![]() | Replace |
Replaces this token with the specified token.
(Inherited from JToken.) |
![]() | ReplaceAll |
Replaces the child nodes of this token with the specified content.
(Inherited from JContainer.) |
![]() | SelectToken(String) |
Selects a JToken using a JPath expression. Selects the token that matches the object path.
(Inherited from JToken.) |
![]() | SelectToken(String, Boolean) |
Selects a JToken using a JPath expression. Selects the token that matches the object path.
(Inherited from JToken.) |
![]() | SelectTokens(String) |
Selects a collection of elements using a JPath expression.
(Inherited from JToken.) |
![]() | SelectTokens(String, Boolean) |
Selects a collection of elements using a JPath expression.
(Inherited from JToken.) |
![]() | ToObject(Type) |
Creates an instance of the specified .NET type from the JToken.
(Inherited from JToken.) |
![]() | ToObject(Type, JsonSerializer) |
Creates an instance of the specified .NET type from the JToken using the specified JsonSerializer.
(Inherited from JToken.) |
![]() | ToObjectT |
Creates an instance of the specified .NET type from the JToken.
(Inherited from JToken.) |
![]() | ToObjectT(JsonSerializer) |
Creates an instance of the specified .NET type from the JToken using the specified JsonSerializer.
(Inherited from JToken.) |
![]() | ToString |
Returns the indented JSON for this token.
(Inherited from JToken.) |
![]() | ToString(Formatting, JsonConverter) |
Returns the JSON for this token using the given formatting and converters.
(Inherited from JToken.) |
![]() | ValueT |
Gets the JToken with the specified key converted to the specified type.
(Inherited from JToken.) |
![]() | ValuesT |
Returns a collection of the child values of this token, in document order.
(Inherited from JContainer.) |
![]() | WriteTo |
Writes this token to a JsonWriter.
(Overrides JTokenWriteTo(JsonWriter, JsonConverter).) |
![]() | WriteToAsync(JsonWriter, JsonConverter) |
Writes this token to a JsonWriter asynchronously.
(Inherited from JToken.) |
![]() | WriteToAsync(JsonWriter, CancellationToken, JsonConverter) |
Writes this token to a JsonWriter asynchronously.
(Overrides JTokenWriteToAsync(JsonWriter, CancellationToken, JsonConverter).) |
Name | Description | |
---|---|---|
![]() | AddingNew |
Occurs before an item is added to the collection.
(Inherited from JContainer.) |
![]() | CollectionChanged |
Occurs when the items list of the collection has changed, or the collection is reset.
(Inherited from JContainer.) |
![]() | ListChanged |
Occurs when the list changes or an item in the list changes.
(Inherited from JContainer.) |
Name | Description | |||
---|---|---|---|---|
![]() | AncestorsJToken |
Returns a collection of tokens that contains the ancestors of every token in the source collection.
(Defined by Extensions.) | ||
![]() | AncestorsAndSelfJToken |
Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection.
(Defined by Extensions.) | ||
![]() | AsJEnumerable | Overloaded.
Returns the input typed as IJEnumerableT.
(Defined by Extensions.) | ||
![]() | AsJEnumerableJToken | Overloaded.
Returns the input typed as IJEnumerableT.
(Defined by Extensions.) | ||
![]() | ChildrenJToken | Overloaded.
Returns a collection of child tokens of every array in the source collection.
(Defined by Extensions.) | ||
![]() | ChildrenJToken, U | Overloaded.
Returns a collection of converted child tokens of every array in the source collection.
(Defined by Extensions.) | ||
![]() | IsValid(JsonSchema) | Overloaded. Determines whether the JToken is valid.
| ||
![]() | IsValid(JsonSchema, IListString) | Overloaded. Determines whether the JToken is valid.
| ||
![]() | Validate(JsonSchema) | Overloaded. Validates the specified JToken.
| ||
![]() | Validate(JsonSchema, ValidationEventHandler) | Overloaded. Validates the specified JToken.
| ||
![]() | ValueU | Overloaded.
Converts the value.
(Defined by Extensions.) | ||
![]() | ValueJToken, U | Overloaded.
Converts the value.
(Defined by Extensions.) | ||
![]() | Values | Overloaded.
Returns a collection of child values of every object in the source collection.
(Defined by Extensions.) | ||
![]() | Values(Object) | Overloaded.
Returns a collection of child values of every object in the source collection with the given key.
(Defined by Extensions.) | ||
![]() | ValuesU | Overloaded.
Returns a collection of converted child values of every object in the source collection.
(Defined by Extensions.) | ||
![]() | ValuesU(Object) | Overloaded.
Returns a collection of converted child values of every object in the source collection with the given key.
(Defined by Extensions.) |
string json = @"[ 'Small', 'Medium', 'Large' ]"; JArray a = JArray.Parse(json);