Click or drag to resize
Json.NETJValue Class
 
Represents a value in JSON (string, integer, date, etc).
Inheritance Hierarchy

Namespace: Newtonsoft.Json.Linq
Assembly: Newtonsoft.Json (in Newtonsoft.Json.dll) Version: 7.0.0.0 (7.0.1.18215)
Syntax
C#
public class JValue : JToken, IEquatable<JValue>, 
	IFormattable, IComparable, IComparable<JValue>, IConvertible

The JValue type exposes the following members.

Constructors
  NameDescription
Public methodJValue(Boolean)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Char)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(DateTime)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(DateTimeOffset)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Decimal)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Double)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Guid)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Int64)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Object)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Single)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(String)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(TimeSpan)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(UInt64)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(Uri)
Initializes a new instance of the JValue class with the given value.
Public methodJValue(JValue)
Initializes a new instance of the JValue class from another JValue object.
Top
Methods
  NameDescription
Public methodAddAfterSelf
Adds the specified content immediately after this token.
(Inherited from JToken.)
Public methodAddAnnotation
Adds an object to the annotation list of this JToken.
(Inherited from JToken.)
Public methodAddBeforeSelf
Adds the specified content immediately before this token.
(Inherited from JToken.)
Public methodAfterSelf
Returns a collection of the sibling tokens after this token, in document order.
(Inherited from JToken.)
Public methodAncestors
Returns a collection of the ancestor tokens of this token.
(Inherited from JToken.)
Public methodAncestorsAndSelf
Returns a collection of tokens that contain this token, and the ancestors of this token.
(Inherited from JToken.)
Public methodAnnotation(Type)
Gets the first annotation object of the specified type from this JToken.
(Inherited from JToken.)
Public methodAnnotationT
Get the first annotation object of the specified type from this JToken.
(Inherited from JToken.)
Public methodAnnotations(Type)
Gets a collection of annotations of the specified type for this JToken.
(Inherited from JToken.)
Public methodAnnotationsT
Gets a collection of annotations of the specified type for this JToken.
(Inherited from JToken.)
Public methodBeforeSelf
Returns a collection of the sibling tokens before this token, in document order.
(Inherited from JToken.)
Public methodChildren
Returns a collection of the child tokens of this token, in document order.
(Inherited from JToken.)
Public methodCompareTo
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Public methodStatic memberCreateComment
Creates a JValue comment with the given value.
Public methodStatic memberCreateNull
Creates a JValue null value.
Public methodCreateReader
Creates an JsonReader for this token.
(Inherited from JToken.)
Public methodStatic memberCreateString
Creates a JValue string with the given value.
Public methodStatic memberCreateUndefined
Creates a JValue null value.
Public methodDeepClone
Creates a new instance of the JToken. All child tokens are recursively cloned.
(Inherited from JToken.)
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Overrides ObjectEquals(Object).)
Public methodEquals(JValue)
Indicates whether the current object is equal to another object of the same type.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Overrides ObjectGetHashCode.)
Protected methodGetMetaObject
Returns the DynamicMetaObject responsible for binding operations performed on this object.
(Overrides JTokenGetMetaObject(Expression).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove
Removes this token from its parent.
(Inherited from JToken.)
Public methodRemoveAnnotations(Type)
Removes the annotations of the specified type from this JToken.
(Inherited from JToken.)
Public methodRemoveAnnotationsT
Removes the annotations of the specified type from this JToken.
(Inherited from JToken.)
Public methodReplace
Replaces this token with the specified token.
(Inherited from JToken.)
Public methodSelectToken(String)
Selects a JToken using a JPath expression. Selects the token that matches the object path.
(Inherited from JToken.)
Public methodSelectToken(String, Boolean)
Selects a JToken using a JPath expression. Selects the token that matches the object path.
(Inherited from JToken.)
Public methodSelectTokens(String)
Selects a collection of elements using a JPath expression.
(Inherited from JToken.)
Public methodSelectTokens(String, Boolean)
Selects a collection of elements using a JPath expression.
(Inherited from JToken.)
Public methodToObject(Type)
Creates the specified .NET type from the JToken.
(Inherited from JToken.)
Public methodToObject(Type, JsonSerializer)
Creates the specified .NET type from the JToken using the specified JsonSerializer.
(Inherited from JToken.)
Public methodToObjectT
Creates the specified .NET type from the JToken.
(Inherited from JToken.)
Public methodToObjectT(JsonSerializer)
Creates the specified .NET type from the JToken using the specified JsonSerializer.
(Inherited from JToken.)
Public methodToString
Returns a String that represents this instance.
(Overrides JTokenToString.)
Public methodToString(IFormatProvider)
Returns a String that represents this instance.
Public methodToString(String)
Returns a String that represents this instance.
Public methodToString(String, IFormatProvider)
Returns a String that represents this instance.
Public methodToString(Formatting, JsonConverter)
Returns the JSON for this token using the given formatting and converters.
(Inherited from JToken.)
Public methodValueT
Gets the JToken with the specified key converted to the specified type.
(Inherited from JToken.)
Public methodValuesT
Returns a collection of the child values of this token, in document order.
(Inherited from JToken.)
Public methodWriteTo
Writes this token to a JsonWriter.
(Overrides JTokenWriteTo(JsonWriter, JsonConverter).)
Top
Extension Methods
  NameDescription
Public Extension MethodIsValid(JsonSchema)Overloaded.

Determines whether the JToken is valid.

Caution note Caution
JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details.
(Defined by Extensions.)
Public Extension MethodIsValid(JsonSchema, IListString)Overloaded.

Determines whether the JToken is valid.

Caution note Caution
JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details.
(Defined by Extensions.)
Public Extension MethodValidate(JsonSchema)Overloaded.

Validates the specified JToken.

Caution note Caution
JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details.
(Defined by Extensions.)
Public Extension MethodValidate(JsonSchema, ValidationEventHandler)Overloaded.

Validates the specified JToken.

Caution note Caution
JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details.
(Defined by Extensions.)
Top
Properties
  NameDescription
Public propertyFirst
Get the first child token of this token.
(Inherited from JToken.)
Public propertyHasValues
Gets a value indicating whether this token has child tokens.
(Overrides JTokenHasValues.)
Public propertyItem
Gets the JToken with the specified key.
(Inherited from JToken.)
Public propertyLast
Get the last child token of this token.
(Inherited from JToken.)
Public propertyNext
Gets the next sibling token of this node.
(Inherited from JToken.)
Public propertyParent
Gets or sets the parent.
(Inherited from JToken.)
Public propertyPath
Gets the path of the JSON token.
(Inherited from JToken.)
Public propertyPrevious
Gets the previous sibling token of this node.
(Inherited from JToken.)
Public propertyRoot
Gets the root JToken of this JToken.
(Inherited from JToken.)
Public propertyType
Gets the node type for this JToken.
(Overrides JTokenType.)
Public propertyValue
Gets or sets the underlying token value.
Top
See Also