 
   ###
   encode: (aOptions)->
-    aOptions = @mergeOptions(aOptions, null, true)
+    aOptions = @mergeTo(aOptions, null, true)
     aOptions.encoding.encode @toObject(aOptions)
   decode: (aEncoded, aOptions) ->
     aOptions = aOptions.encoding.decode aEncoded
-    aOptions = @mergeOptions(aOptions)
+    aOptions = @mergeTo(aOptions)
   ###
 
-  # Get(create) a global Type class or create new Value from the parametric type object.
-  # it will create a new type object if options is not the original(default) type options.
+  # Get(create) a global Type class or create new Value from the parametric
+  # type object.
+  # it will create a new type object if options is not the original(default)
+  # type options.
   @from: (aObject) ->
     result = Type aObject
     if aObject.value? and result

    result = createObject @Class, aOptions
    result
  cloneType: (aOptions)->
    aOptions = @mergeOptions(aOptions, null, true)
    aOptions.name = @name unless aOptions.name
    @createType aOptions
  clone: @::cloneType
  # Get(create) a global Type class or create new Value from the json string.
  # it will create a new type object if options is not the original type options.
  @fromJson: (aString)->
    #aString = JSON.parse aString
    Type.from JSON.parse(aString)

    if isObject raiseError
      aOptions    = raiseError
      raiseError  = aOptions.raiseError
    aOptions = @mergeTo(aOptions)
    aOptions.raiseError = true if raiseError
    result = @validateRequired aValue, aOptions
    result = @_validate(aValue, aOptions) if result and aValue?
