#1 Own library generator

open
nobody
None
7
2007-09-14
2007-09-14
No

JSON for .NET library will generate small libraries for own data format.

Example:
We have this data:
{
"Name": "Jason",
"SurName": "White"
}

Generated library will contain one class named Person (this name sets by user which generates this library). Class Person will contain two Fields: string Name and string SurName.

Also class will contain some predefined methods for parsing and generating json text in user data format, like static Person Parse(TextReader r) and void Person.WriteTo(TextWriter w).

sample generated class definition
class Person
{
protected string _name;
public string Name
{
get{return _name;}
set{_name = value;}
}

protected string _surName;
public string SurName
{
get{return _surName;}
set{_surName= value;}
}

public override string ToString()
{
...
}

public void WriteTo(TextWriter w)
{
...
}

public static Person Parse(TextReader r)
{
...
}

}

Discussion


Log in to post a comment.