Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

APJSON

, 28 Aug 2013
This is an alternative for "fastJSON"
Apolyton_FastJson_Binaries__v0.92_.zip
Output
Debug
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
Release x64
Apolyton.FastJson.dll
Release x86
Apolyton.FastJson.dll
consoletest.exe
consoletest.vshost.exe
consoletest.vshost.exe.manifest
fastJSON.dll
Release
Apolyton.FastJson.dll
Silverlight
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
Apolyton_FastJson_Binaries__v0.93_.zip
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.pdb
fastJSON.dll
Apolyton.FastJson.dll
consoletest.exe
consoletest.vshost.exe
fastJSON.dll
Apolyton.FastJson.dll
consoletest.exe
consoletest.vshost.exe
fastJSON.dll
Apolyton.FastJson.dll
consoletest.exe
fastJSON.dll
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
Apolyton_FastJson_Binaries__v0.9_.zip
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.vshost.exe
consoletest.vshost.exe.manifest
fastJSON.dll
fastJSON.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.vshost.exe
consoletest.vshost.exe.manifest
fastJSON.dll
fastJSON.pdb
Apolyton.FastJson.dll
consoletest.exe
consoletest.vshost.exe
fastJSON.dll
Apolyton_FastJson_Binaries__v1.0_.zip
Apolyton.FastJson.dll
consoletest.exe
consoletest.vshost.exe
consoletest.vshost.exe.manifest
fastJSON.dll
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.vshost.exe
fastJSON.dll
fastJSON.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.vshost.exe
fastJSON.dll
fastJSON.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
fastJSON.dll
fastJSON.pdb
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
apolyton_fastjson_sources__v0.92_.zip
Apolyton.FastJson
Apolyton.FastJson.csproj.user
Apolyton.FastJson.Silverlight.csproj.user
Apolyton.FastJson.v11.suo
Bin
Debug
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
Common
Data
Diagram.cd
obj
Debug
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release x64
Apolyton.FastJson.dll
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release x86
Apolyton.FastJson.dll
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release
Apolyton.FastJson.dll
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Properties
Registry
Serialization
Apolyton.FastJson.Tests
bin
Debug
Release
Apolyton.FastJson.dll
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
Data
Helpers
ComplexTypes
ParameterRelated
Polymorphism
RegistryHelpers
StandardTypes
obj
Debug
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
build.force
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release (x86, CUSTOM TYPES)
build.force
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Properties
Registry
Serialization
Console Test
bin
Debug
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.pdb
consoletest.vshost.exe
fastJSON.dll
fastJSON.pdb
x86
DataObjects
obj
Debug
build.force
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
consoletest.pdb
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release (x86, CUSTOM TYPES)
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release x64
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release x86
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
Release
build.force
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
x86
Debug
TempPE
Apolyton_FastJson_Sources__v0.93_.zip
Apolyton.FastJson.dll
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
Apolyton.FastJson.dll
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
DesignTimeResolveAssemblyReferencesInput.cache
build.force
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.pdb
consoletest.vshost.exe
fastJSON.dll
Release
Apolyton.FastJson.dll
consoletest.exe
fastJSON.dll
Release (x86, CUSTOM TYPES)
Apolyton.FastJson.dll
consoletest.exe
fastJSON.dll
Release x64
Apolyton.FastJson.dll
consoletest.exe
fastJSON.dll
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
consoletest.pdb
DesignTimeResolveAssemblyReferencesInput.cache
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
consoletest.pdb
DesignTimeResolveAssemblyReferencesInput.cache
Release x64
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
Release x86
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
Release
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.csproj.user
Apolyton.FastJson.Silverlight.csproj.user
Apolyton.FastJson.v11.suo
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
Release
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
Diagrams
Json.cd
JsonParameters.cd
TypeDescriptors.cd
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton_FastJson_Sources__v0.9_.zip
Apolyton.FastJson.csproj.user
Diagram.cd
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
DesignTimeResolveAssemblyReferencesInput.cache
build.force
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.vshost.exe
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
consoletest.pdb
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton_FastJson_Sources__v1.0_.zip
Apolyton.FastJson.csproj.user
Apolyton.FastJson.Silverlight.csproj.user
Apolyton.FastJson.v11.suo
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
Json.cd
JsonParameters.cd
TypeDescriptors.cd
Apolyton.FastJson.csprojResolveAssemblyReference.cache
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
DesignTimeResolveAssemblyReferences.cache
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
Apolyton.Json.Silverlight.dll
Apolyton.Json.Silverlight.pdb
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
DesignTimeResolveAssemblyReferencesInput.cache
build.force
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.Tests.csprojResolveAssemblyReference.cache
Apolyton.FastJSON.Tests.dll
Apolyton.FastJSON.Tests.pdb
DesignTimeResolveAssemblyReferencesInput.cache
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
consoletest.pdb
consoletest.vshost.exe
fastJSON.dll
fastJSON.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
fastJSON.dll
fastJSON.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
fastJSON.dll
fastJSON.pdb
Apolyton.FastJson.dll
Apolyton.FastJson.pdb
consoletest.exe
fastJSON.dll
fastJSON.pdb
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
consoletest.pdb
DesignTimeResolveAssemblyReferencesInput.cache
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
consoletest.pdb
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
consoletest.csprojResolveAssemblyReference.cache
consoletest.exe
DesignTimeResolveAssemblyReferencesInput.cache
using System;
using Apolyton.FastJson.Registry;

namespace Apolyton.FastJson.Registry
{
    /// <summary>
    /// Represents the internal property info.
    /// </summary>
    internal struct JsonPropertyInfo
    {
        /// <summary>
        /// The empty instance.
        /// </summary>
        internal static JsonPropertyInfo Empty = new JsonPropertyInfo();

        /// <summary>
        /// Specifies the type of the member.
        /// </summary>
        public Type PropertyOrFieldType;
        
        /// <summary>
        /// Represents the non-nullable value behind the primary type. Normally, a cast of a value to the primary type should be possible.
        /// </summary>
        /// <example>
        /// typeof(Double?) for instance is Nullable{double} with NullableType = typeof(double).
        /// </example>
        public Type NullableType;
        
        /// <summary>
        /// Represents the first item type for generic enumerations and collections (relevant for performance).
        /// </summary>
        public Type GenericItemType;

        /// <summary>
        /// Represents all generic types of the Primary Type.
        /// </summary>
        public Type[] GenericTypes;

        /// <summary>
        /// Specifies the property of field name.
        /// </summary>
        public string PropertyOrFieldName;

        /// <summary>
        /// Specifies the json field name for the given property.
        /// </summary>
        public string JsonFieldName;

        /// <summary>
        /// True, if member type is a dictionary.
        /// </summary>
        public bool IsDictionary;

        /// <summary>
        /// Determines, if member type is value type.
        /// </summary>
        public bool IsValueType;

        /// <summary>
        /// Determines, if the type is a generic type.
        /// </summary>
        public bool IsGenericType;

        /// <summary>
        /// Determines, if the member type is an array.
        /// </summary>
        public bool IsArray;

        /// <summary>
        /// Determines, if the member type is a byte array.
        /// </summary>
        public bool IsByteArray;

        /// <summary>
        /// Detemines, if the member type is a guid.
        /// </summary>
        public bool IsGuid;

        /// <summary>
        /// Determines, if the member type is a data set.
        /// </summary>
        public bool IsDataSet;

        /// <summary>
        /// Determines, if the member type is a data table.
        /// </summary>
        public bool IsDataTable;

        /// <summary>
        /// Determines, if the member type is a hash table.
        /// </summary>
        public bool IsHashtable;

        /// <summary>
        /// Determines, if the member type is an Enum.
        /// </summary>
        public bool IsEnum;

        /// <summary>
        /// Determines, if the member type is a date time.
        /// </summary>
        public bool IsDateTime;

        /// <summary>
        /// Determines the date time format a particular field is supposed to be implemented.
        /// </summary>
        public String DateTimeFormat;

        /// <summary>
        /// Determines, if the date kind of the member. Relevant for deserialization to now, if time zone adjustment is desired or not.
        /// Defined through the JsonDateTimeOptions attribute.
        /// </summary>
        public DateTimeKind DateTimeKind;

        /// <summary>
        /// Determines, if the member type is an int.
        /// </summary>
        public bool IsInt;

        /// <summary>
        /// Determines, if the member type is a long.
        /// </summary>
        public bool IsLong;

        /// <summary>
        /// Determines, if the member type is a string.
        /// </summary>
        public bool IsString;

        /// <summary>
        /// Determines, if the member type is a bool.
        /// </summary>
        public bool IsBool;

        /// <summary>
        /// Determines, if the member type is a class.
        /// </summary>
        public bool IsClass;

        /// <summary>
        /// Determines, if the member type is a string dictionary.
        /// </summary>
        public bool IsStringDictionary;

        /// <summary>
        /// Represents a fast set function for the property or field.
        /// </summary>
        public GenericSetterHandler Setter;

        /// <summary>
        /// Represents a fast get function for the property or field.
        /// </summary>
        public GenericGetterHandler Getter;
        
        /// <summary>
        /// Determines, if the member type is a custom type.
        /// </summary>
        public bool IsCustomType;

        /// <summary>
        /// Determines, if the member type can be written to.
        /// </summary>
        public bool CanWrite;

        /// <summary>
        /// Specifies the default value of the property. For nullable types it is 'null', for other types determined throught the activator.
        /// </summary>
        public object DefaultValue;

        /// <summary>
        /// Returns true, if the references are equal.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool operator ==(JsonPropertyInfo a, JsonPropertyInfo b)
        {
            return Object.ReferenceEquals(a, b);
        }

        /// <summary>
        /// Returns true, if the references are not equal.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool operator !=(JsonPropertyInfo a, JsonPropertyInfo b)
        {
            return !(a == b);
        }

        /// <summary>
        /// Returns the hash code.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        /// <summary>
        /// Returns true, if the objects are equal.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        /// <summary>
        /// Returns a lightweight object, which describes the serialization criteria.
        /// </summary>
        /// <returns></returns>
        internal JsonSerializationInfo ToSerializationInfo()
        {
            JsonSerializationInfo info = new JsonSerializationInfo();
            info.JsonFieldName = JsonFieldName;
            info.MemberName = PropertyOrFieldName;
            info.MemberType = PropertyOrFieldType;

            if (GenericTypes == null)
            {
                info.MemberDisplayType = PropertyOrFieldType.Name;
            }
            else
            {
                info.MemberDisplayType = String.Format("{0}<{1}>", PropertyOrFieldType.Name, GenericTypes[0].Name);
            }

            return info;
        }

        /// <summary>
        /// Returns a more meaningful string representing the info object.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return String.Format("{0}: {1}", PropertyOrFieldName, PropertyOrFieldType);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Aron Kovacs

Germany Germany
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 28 Aug 2013
Article Copyright 2012 by Aron Kovacs
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid