DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Package Functions | Properties | Static Private Member Functions | Private Attributes | List of all members
Deveel.Data.Serialization.SerializeData Class Reference

Public Member Functions

void SetValue (string key, Type type, object value)
 
void SetValue (string key, object value)
 
void SetValue (string key, bool value)
 
void SetValue (string key, byte value)
 
void SetValue (string key, short value)
 
void SetValue (string key, int value)
 
void SetValue (string key, long value)
 
void SetValue (string key, float value)
 
void SetValue (string key, double value)
 
void SetValue (string key, string value)
 

Package Functions

 SerializeData (Type graphType)
 

Properties

Type GraphType [get, private set]
 
IEnumerable< KeyValuePair< string, KeyValuePair< Type, object > > > Values [get]
 

Static Private Member Functions

static bool IsSupported (Type type)
 

Private Attributes

readonly Dictionary< string, KeyValuePair< Type, object > > values
 

Detailed Description

Definition at line 21 of file SerializeData.cs.

Constructor & Destructor Documentation

Deveel.Data.Serialization.SerializeData.SerializeData ( Type  graphType)
inlinepackage

Definition at line 24 of file SerializeData.cs.

24  {
25  GraphType = graphType;
26  values = new Dictionary<string, KeyValuePair<Type, object>>();
27  }
readonly Dictionary< string, KeyValuePair< Type, object > > values

Member Function Documentation

static bool Deveel.Data.Serialization.SerializeData.IsSupported ( Type  type)
inlinestaticprivate

Definition at line 55 of file SerializeData.cs.

55  {
56  return type.IsPrimitive ||
57  type == typeof (string) ||
58  Attribute.IsDefined(type, typeof(SerializableAttribute));
59  }
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
Type  type,
object  value 
)
inline

Definition at line 35 of file SerializeData.cs.

35  {
36  if (String.IsNullOrEmpty(key))
37  throw new ArgumentNullException("key");
38  if (type == null)
39  throw new ArgumentNullException("type");
40 
41  if (type.IsArray) {
42  if (!IsSupported(type.GetElementType()))
43  throw new NotSupportedException(String.Format("The element type '{0}' of the array is not supported.",
44  type.GetElementType()));
45  } else if (!type.IsArray && !IsSupported(type))
46  throw new NotSupportedException(String.Format("The type '{0}' is not supported.", type));
47 
48  if (value != null && !type.IsInstanceOfType(value))
49  throw new ArgumentException(
50  String.Format("The specified object value is not assignable from the type '{0}' specified.", type));
51 
52  values[key] = new KeyValuePair<Type, object>(type, value);
53  }
A long string in the system.
readonly Dictionary< string, KeyValuePair< Type, object > > values
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
object  value 
)
inline

Definition at line 61 of file SerializeData.cs.

61  {
62  if (value == null)
63  return;
64 
65  var type = value.GetType();
66  SetValue(key, type, value);
67  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
bool  value 
)
inline

Definition at line 69 of file SerializeData.cs.

69  {
70  SetValue(key, typeof(bool), value);
71  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
byte  value 
)
inline

Definition at line 73 of file SerializeData.cs.

73  {
74  SetValue(key, typeof(byte), value);
75  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
short  value 
)
inline

Definition at line 77 of file SerializeData.cs.

77  {
78  SetValue(key, typeof(short), value);
79  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
int  value 
)
inline

Definition at line 81 of file SerializeData.cs.

81  {
82  SetValue(key, typeof(int), value);
83  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
long  value 
)
inline

Definition at line 85 of file SerializeData.cs.

85  {
86  SetValue(key, typeof(long), value);
87  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
float  value 
)
inline

Definition at line 89 of file SerializeData.cs.

89  {
90  SetValue(key, typeof(float), value);
91  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
double  value 
)
inline

Definition at line 93 of file SerializeData.cs.

93  {
94  SetValue(key, typeof(double), value);
95  }
void SetValue(string key, Type type, object value)
void Deveel.Data.Serialization.SerializeData.SetValue ( string  key,
string  value 
)
inline

Definition at line 97 of file SerializeData.cs.

97  {
98  SetValue(key, typeof(string), value);
99  }
void SetValue(string key, Type type, object value)

Member Data Documentation

readonly Dictionary<string, KeyValuePair<Type, object> > Deveel.Data.Serialization.SerializeData.values
private

Definition at line 22 of file SerializeData.cs.

Property Documentation

Type Deveel.Data.Serialization.SerializeData.GraphType
getprivate set

Definition at line 29 of file SerializeData.cs.

IEnumerable<KeyValuePair<string, KeyValuePair<Type, object> > > Deveel.Data.Serialization.SerializeData.Values
getpackage

Definition at line 31 of file SerializeData.cs.


The documentation for this class was generated from the following file: