           aTypeName = Type.getNameFromClass(aTypeName) if aTypeName
         return unless aTypeName
       vTypeClass = Type.registeredClass aTypeName
-      if vTypeClass and aOptions and not vTypeClass::$attributes.isOriginal(aOptions)
+      if vTypeClass and aOptions and
+         not vTypeClass::$attributes.isOriginal(aOptions)
         return createObject vTypeClass, aOptions
     return super
   initialize: (aOptions)->

    result = JSON.stringify result
    result
  _toObject:(aOptions)->
    result = @mergeOptions aOptions, null, true
    result[NAME] = @name
    result.fullName = @path()
    ###
    vEncoding = result.encoding
    if vEncoding and vEncoding.name isnt Type.DEFAULT_ENCODING.name

    result = createObject @Class, aOptions
    result
  cloneType: (aOptions)->
    aOptions = @mergeTo(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)
