#region Apache Notice
/*****************************************************************************
* $Header: $
* $Revision: $
* $Date: $
*
* iBATIS.NET Data Mapper
* Copyright (C) 2004 - Gilles Bayon
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************/
#endregion
#region Using
using System;
using System.Xml.Serialization;
using IBatisNet.Common.Utilities;
#endregion
namespace IBatisNet.DataMapper.Configuration.Alias
{
///
/// Summary description for TypeHandler.
///
[Serializable]
[XmlRoot("typeHandler", Namespace="http://ibatis.apache.org/dataMapper")]
public class TypeHandler
{
#region Fields
[NonSerialized]
private string _className = string.Empty;
[NonSerialized]
private Type _class = null;
[NonSerialized]
private string _dbType = string.Empty;
[NonSerialized]
private string _callBackName = string.Empty;
#endregion
#region Properties
///
/// CLR type
///
[XmlAttribute("type")]
public string ClassName
{
get { return _className; }
set {_className = value; }
}
///
/// The type class for the TypeName
///
[XmlIgnore]
public Type Class
{
get { return _class; }
}
///
/// dbType name
///
[XmlAttribute("dbType")]
public string DbType
{
get { return _dbType; }
set {_dbType = value; }
}
///
/// callback alias name
///
[XmlAttribute("callback")]
public string CallBackName
{
get { return _callBackName; }
set {_callBackName = value; }
}
#endregion
#region Constructors
///
/// Do not use direclty, only for serialization.
///
public TypeHandler()
{}
#endregion
#region Methods
///
/// Initialize the object,
/// try to idenfify the .Net type class from the corresponding name.
///
public void Initialize()
{
_class = Resources.TypeForName(_className);
}
#endregion
}
}