DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Properties | Static Private Member Functions | List of all members
Deveel.Data.Xml.XmlNodeType Class Reference
Inheritance diagram for Deveel.Data.Xml.XmlNodeType:
Deveel.Data.Types.SqlType Deveel.Data.Serialization.ISerializable

Public Member Functions

 XmlNodeType ()
 
override object ConvertTo (ISqlObject obj, Type destType)
 
override ISqlObject DeserializeObject (Stream stream)
 
override void SerializeObject (Stream stream, ISqlObject obj)
 
override bool CanCastTo (SqlType destType)
 Verifies if this type can cast any value to the given SqlType. More...
 
override DataObject CastTo (DataObject value, SqlType destType)
 Converts the given object value to a SqlType specified. More...
 
- Public Member Functions inherited from Deveel.Data.Types.SqlType
virtual bool IsComparable (SqlType type)
 Verifies if a given SqlType is comparable to this data-type. More...
 
virtual ISqlObject Add (ISqlObject a, ISqlObject b)
 
virtual ISqlObject Subtract (ISqlObject a, ISqlObject b)
 
virtual ISqlObject Multiply (ISqlObject a, ISqlObject b)
 
virtual ISqlObject Divide (ISqlObject a, ISqlObject b)
 
virtual ISqlObject Modulus (ISqlObject a, ISqlObject b)
 
virtual ISqlObject Negate (ISqlObject value)
 
virtual SqlBoolean IsEqualTo (ISqlObject a, ISqlObject b)
 
virtual SqlBoolean IsNotEqualTo (ISqlObject a, ISqlObject b)
 
virtual SqlBoolean IsGreatherThan (ISqlObject a, ISqlObject b)
 
virtual SqlBoolean IsSmallerThan (ISqlObject a, ISqlObject b)
 
virtual SqlBoolean IsGreaterOrEqualThan (ISqlObject a, ISqlObject b)
 
virtual SqlBoolean IsSmallerOrEqualThan (ISqlObject a, ISqlObject b)
 
virtual ISqlObject And (ISqlObject a, ISqlObject b)
 
virtual ISqlObject Or (ISqlObject a, ISqlObject b)
 
virtual ISqlObject XOr (ISqlObject x, ISqlObject y)
 
virtual ISqlObject UnaryPlus (ISqlObject value)
 
virtual ISqlObject Reverse (ISqlObject value)
 
virtual SqlType Wider (SqlType otherType)
 Gets the one data-type between this and the other one given that handles the wider range of values. More...
 
virtual int Compare (ISqlObject x, ISqlObject y)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
virtual bool Equals (SqlType other)
 
override string ToString ()
 
virtual bool IsCacheable (ISqlObject value)
 
virtual Type GetRuntimeType ()
 
virtual Type GetObjectType ()
 
virtual ISqlObject CreateFromLargeObject (ILargeObject objRef)
 
virtual ISqlObject CreateFrom (object value)
 

Properties

static SqlType XmlType [get, private set]
 
- Properties inherited from Deveel.Data.Types.SqlType
string Name [get, private set]
 Gets the name of the data-type that is used to resolve it within the context. More...
 
SqlTypeCode TypeCode [get, private set]
 Gets the kind of SQL type this data-type handles. More...
 
virtual bool IsIndexable [get]
 Indicates if the values handled by the type can be part of an index. More...
 
bool IsPrimitive [get]
 Gets a value indicating if this data-type is primitive. More...
 
bool IsNull [get]
 
virtual bool IsStorable [get]
 

Static Private Member Functions

static XmlNodeType ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Deveel.Data.Types.SqlType
static SqlType Parse (string s)
 Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent. More...
 
static SqlType Parse (IContext context, string s)
 Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent. More...
 
static bool IsPrimitiveType (SqlTypeCode typeCode)
 
static SqlType Resolve (SqlTypeCode typeCode)
 
static SqlType Resolve (SqlTypeCode typeCode, DataTypeMeta[] meta)
 
static SqlType Resolve (SqlTypeCode typeCode, DataTypeMeta[] meta, ITypeResolver resolver)
 
static SqlType Resolve (SqlTypeCode typeCode, string name)
 
static SqlType Resolve (SqlTypeCode typeCode, string name, DataTypeMeta[] meta)
 
static SqlType Resolve (string name)
 
static SqlType Resolve (string name, DataTypeMeta[] meta)
 
static SqlType Resolve (string name, DataTypeMeta[] meta, ITypeResolver resolver)
 
static SqlType Resolve (SqlTypeCode typeCode, string name, DataTypeMeta[] meta, ITypeResolver resolver)
 
- Protected Member Functions inherited from Deveel.Data.Types.SqlType
 SqlType (SqlTypeCode sqlType)
 Constructs the SqlType for the given specific SQL TYPE. More...
 
 SqlType (string name, SqlTypeCode typeCode)
 Constructs the SqlType for the given specific SQL TYPE and a given name. More...
 
 SqlType (ObjectData data)
 
virtual void GetData (SerializeData data)
 
- Package Functions inherited from Deveel.Data.Types.SqlType
virtual int GetCacheUsage (ISqlObject value)
 
virtual int ColumnSizeOf (ISqlObject obj)
 

Detailed Description

Definition at line 9 of file XmlNodeType.cs.

Constructor & Destructor Documentation

Deveel.Data.Xml.XmlNodeType.XmlNodeType ( )
inline

Definition at line 10 of file XmlNodeType.cs.

11  : base("XMLNODE", SqlTypeCode.Type) {
12  }
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
static Deveel.Data.Xml.XmlNodeType.XmlNodeType ( )
inlinestaticprivate

Definition at line 14 of file XmlNodeType.cs.

14  {
15  XmlType = new XmlNodeType();
16  }

Member Function Documentation

override bool Deveel.Data.Xml.XmlNodeType.CanCastTo ( SqlType  destType)
inlinevirtual

Verifies if this type can cast any value to the given SqlType.

Parameters
destTypeThe other type, destination of the cast, to verify.

By default, this method returns false, because cast process must be specified per type: when overriding the method CastTo, pay attention to also override this method accordingly.

Returns

CastTo

Reimplemented from Deveel.Data.Types.SqlType.

Definition at line 43 of file XmlNodeType.cs.

43  {
44  return destType is StringType ||
45  destType is BinaryType;
46  }
override DataObject Deveel.Data.Xml.XmlNodeType.CastTo ( DataObject  value,
SqlType  destType 
)
inlinevirtual

Converts the given object value to a SqlType specified.

Parameters
valueThe value to convert.
destTypeThe destination type of the conversion.

If the given destType destination type is equivalent to this type, it will return the value provided, otherwise it will throw an exception by default.

Casting values to specific types is specific to each data-type: override this method to support type-specific conversions.

When overriding this method, CanCastTo should be overridden accordingly to indicate the type supports casting.

Returns
Returns an instance of DataObject that is the result of the conversion from this data-type to the other type given.

Reimplemented from Deveel.Data.Types.SqlType.

Definition at line 48 of file XmlNodeType.cs.

48  {
49  var xmlNode = value.Value as SqlXmlNode;
50  if (xmlNode == null)
51  return DataObject.Null(this);
52 
53  var destTypeCode = destType.TypeCode;
54  switch (destTypeCode) {
55  case SqlTypeCode.String:
56  case SqlTypeCode.VarChar:
57  case SqlTypeCode.LongVarChar:
58  // TODO: more advanced casting...
59  return DataObject.String(xmlNode.ToSqlString());
60  case SqlTypeCode.Binary:
61  case SqlTypeCode.LongVarBinary:
62  case SqlTypeCode.VarBinary:
63  // TODO: more advanced casting...
64  return DataObject.Binary(xmlNode.ToSqlBinary());
65  default:
66  throw new InvalidCastException(String.Format("Cannot cast XML node to type '{0}'.", destType));
67  }
68  }
A long string in the system.
static readonly SqlXmlNode Null
Definition: SqlXmlNode.cs:12
SqlTypeCode TypeCode
Gets the kind of SQL type this data-type handles.
Definition: SqlType.cs:91
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
override object Deveel.Data.Xml.XmlNodeType.ConvertTo ( ISqlObject  obj,
Type  destType 
)
inlinevirtual

Reimplemented from Deveel.Data.Types.SqlType.

Definition at line 20 of file XmlNodeType.cs.

20  {
21  var xmlNode = obj as SqlXmlNode;
22  if (xmlNode == null || xmlNode.IsNull)
23  return null;
24 
25  if (destType == typeof (string))
26  return xmlNode.ToString();
27  if (destType == typeof (XmlNode))
28  return xmlNode.ToXmlNode();
29  if (destType == typeof (byte[]))
30  return xmlNode.ToBytes();
31 
32  return base.ConvertTo(obj, destType);
33  }
override ISqlObject Deveel.Data.Xml.XmlNodeType.DeserializeObject ( Stream  stream)
inlinevirtual

Reimplemented from Deveel.Data.Types.SqlType.

Definition at line 35 of file XmlNodeType.cs.

35  {
36  return base.DeserializeObject(stream);
37  }
override void Deveel.Data.Xml.XmlNodeType.SerializeObject ( Stream  stream,
ISqlObject  obj 
)
inlinevirtual

Reimplemented from Deveel.Data.Types.SqlType.

Definition at line 39 of file XmlNodeType.cs.

39  {
40  base.SerializeObject(stream, obj);
41  }

Property Documentation

SqlType Deveel.Data.Xml.XmlNodeType.XmlType
staticgetprivate set

Definition at line 18 of file XmlNodeType.cs.


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