   ValueType: Value
   $attributes: attributes
 
-  ###
-  @JSON_ENCODING:
-    name: 'json'
-    encode: JSON.stringify
-    decode: JSON.parse
-  @DEFAULT_ENCODING: @JSON_ENCODING
-  getEncoding: (encoding)-> #depreacted
-    if !encoding or encoding is Type.DEFAULT_ENCODING.name
-      if @parent
-        return @parent.getEncoding()
-      else
-        return Type.DEFAULT_ENCODING
-    if isString encoding
-      if Codec
-        encoding = Codec encoding
-      else
-        throw new TypeError '
-          Should install buffer-codec package first
-          to enable encoding name supports.
-        '
-    if !isFunction(encoding.encode) or
-       !isFunction(encoding.decode) or !encoding.name
-      throw new TypeError '
-        encoding should have name property, encode and decode functions.
-      '
-    encoding
-  ###
   constructor: (aTypeName, aOptions)->
     # create a new instance object if aOptions is not the original options of the type.
     if not (this instanceof Type) and not (aTypeName instanceof Type)

    aOptions = {} unless isObject aOptions

    if isString aExclude
      aExclude = getObjectKeys(aOptions).concat aExclude
    else if isArray aExclude
      aExclude = aExclude.concat getObjectKeys(aOptions)
    else
      aExclude = getObjectKeys(aOptions)
    aExclude.push 'name'

    if @$attributes
      @$attributes.assignTo(@, aOptions, aExclude, aSerialized)
      #aOptions.encoding = @encoding unless aOptions.encoding
    else
      extend aOptions, @, (key, value)->
        result = not aOptions.hasOwnProperty(key) and not (key in aExclude)
        if aSerialized
          result = result and key[0] isnt '$' and value isnt undefined
        result
    #delete aOptions.name
    aOptions
  _validate: (aValue, aOptions)->true
  error: (aMessage, aOptions)->

        vType = @createType aOptions
    else
      vType = @
    createObject vType.ValueType, aValue, vType, aOptions
  create: @::createValue
  createType: (aOptions)->
