Ext.data.JsonP.Ext_data_amf_Encoder({"alternateClassNames":[],"aliases":{"data":["amf.Encoder"]},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.Base","uses":[],"html":"

Hierarchy

Ext.Base
Ext.data.amf.Encoder

Files

This class serializes data in the Action Message Format (AMF) format.\nIt can write simple and complex objects, to be used in conjunction with an\nAMF-compliant server.\nTo encode a byte array, first construct an Encoder, optionally setting the format:

\n\n
var encoder = Ext.create('Ext.data.amf.Encoder', {\n  format: 3\n});\n
\n\n

Then use the writer methods to out data to the :

\n\n
encoder.writeObject(1);\n
\n\n

And access the data through the bytes property:

\n\n
encoder.bytes;\n
\n\n

You can also reset the class to start a new byte array:

\n\n
encoder.clear();\n
\n\n

Current limitations:\nAMF3 format (format:3)\n- writeObject will write out XML object, not legacy XMLDocument objects. A\n writeXmlDocument method is provided for explicitly writing XMLDocument\n objects.\n- Each object is written out explicitly, not using the reference tables\n supported by the AMF format. This means the function does NOT support\n circular reference objects.\n- Array objects: only the numbered indices and data will be written out.\n Associative values will be ignored.\n- Objects that aren't Arrays, Dates, Strings, Document (XML) or primitive\n values will be written out as anonymous objects with dynamic data.\n- There's no JavaScript equivalent to the ByteArray type in ActionScript,\n hence data will never be searialized as ByteArrays by the writeObject\n function. A writeByteArray method is provided for writing out ByteArray objects.

\n\n

AMF0 format (format:0)\n- Each object is written out explicitly, not using the reference tables\n supported by the AMF format. This means the function does NOT support\n circular reference objects.\n- Array objects: the function always writes an associative array (following\n the behavior of flex).\n- Objects that aren't Arrays, Dates, Strings, Document (XML) or primitive\n values will be written out as anonymous objects.

\n\n

For more information on working with AMF data please refer to the\nAMF Guide.

\n
Defined By

Config options

Ext.data.amf.Encoder
view source
: Numberprivate
...
\n

Defaults to: 3

Properties

Defined By

Instance Properties

...
\n

Defaults to: 'Ext.Base'

Ext.data.amf.Encoder
view source
: Arrayreadonly
The constructed byte array. ...

The constructed byte array.

\n

Defaults to: []

...
\n

Defaults to: {}

...
\n

Defaults to: []

...
\n

Defaults to: {}

...
\n

Defaults to: true

Get the reference to the current class from which this object was instantiated. ...

Get the reference to the current class from which this object was instantiated. Unlike statics,\nthis.self is scope-dependent and it's meant to be used for dynamic inheritance. See statics\nfor a detailed comparison

\n\n
Ext.define('My.Cat', {\n    statics: {\n        speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n    },\n\n    constructor: function() {\n        alert(this.self.speciesName); // dependent on 'this'\n    },\n\n    clone: function() {\n        return new this.self();\n    }\n});\n\n\nExt.define('My.SnowLeopard', {\n    extend: 'My.Cat',\n    statics: {\n        speciesName: 'Snow Leopard'         // My.SnowLeopard.speciesName = 'Snow Leopard'\n    }\n});\n\nvar cat = new My.Cat();                     // alerts 'Cat'\nvar snowLeopard = new My.SnowLeopard();     // alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone));             // alerts 'My.SnowLeopard'\n
\n
Defined By

Static Properties

...
\n

Defaults to: []

Methods

Defined By

Instance Methods

Ext.data.amf.Encoder
view source
new( config ) : Ext.data.amf.Encoder
Creates new Encoder. ...

Creates new Encoder.

\n

Parameters

  • config : Object

    Configuration options

    \n

Returns

Ext.data.amf.Encoder
view source
( protocol_version )
Sets the functions that will correctly serialize for the relevant\nprotocol version. ...

Sets the functions that will correctly serialize for the relevant\nprotocol version.

\n

Parameters

  • protocol_version : Number

    the protocol version to support

    \n
( args ) : Objectdeprecatedprotected
Call the original method that was previously overridden with override\n\nExt.define('My.Cat', {\n constructor: functi...

Call the original method that was previously overridden with override

\n\n
Ext.define('My.Cat', {\n    constructor: function() {\n        alert(\"I'm a cat!\");\n    }\n});\n\nMy.Cat.override({\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callOverridden();\n\n        alert(\"Meeeeoooowwww\");\n    }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n                          // alerts \"I'm a cat!\"\n                          // alerts \"Meeeeoooowwww\"\n
\n
\n

This method has been deprecated

\n

as of 4.1. Use callParent instead.

\n\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callOverridden(arguments)

    \n

Returns

  • Object

    Returns the result of calling the overridden method

    \n
Call the \"parent\" method of the current method. ...

Call the \"parent\" method of the current method. That is the method previously\noverridden by derivation or by an override (see Ext.define).

\n\n
 Ext.define('My.Base', {\n     constructor: function (x) {\n         this.x = x;\n     },\n\n     statics: {\n         method: function (x) {\n             return x;\n         }\n     }\n });\n\n Ext.define('My.Derived', {\n     extend: 'My.Base',\n\n     constructor: function () {\n         this.callParent([21]);\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // alerts 21\n
\n\n

This can be used with an override as follows:

\n\n
 Ext.define('My.DerivedOverride', {\n     override: 'My.Derived',\n\n     constructor: function (x) {\n         this.callParent([x*2]); // calls original My.Derived constructor\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // now alerts 42\n
\n\n

This also works with static methods.

\n\n
 Ext.define('My.Derived2', {\n     extend: 'My.Base',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Base.method\n         }\n     }\n });\n\n alert(My.Base.method(10);     // alerts 10\n alert(My.Derived2.method(10); // alerts 20\n
\n\n

Lastly, it also works with overridden static methods.

\n\n
 Ext.define('My.Derived2Override', {\n     override: 'My.Derived2',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Derived2.method\n         }\n     }\n });\n\n alert(My.Derived2.method(10); // now alerts 40\n
\n\n

To override a method and replace it and also call the superclass method, use\ncallSuper. This is often done to patch a method to fix a bug.

\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callParent(arguments)

    \n

Returns

  • Object

    Returns the result of calling the parent method

    \n
This method is used by an override to call the superclass method but bypass any\noverridden method. ...

This method is used by an override to call the superclass method but bypass any\noverridden method. This is often done to \"patch\" a method that contains a bug\nbut for whatever reason cannot be fixed directly.

\n\n

Consider:

\n\n
 Ext.define('Ext.some.Class', {\n     method: function () {\n         console.log('Good');\n     }\n });\n\n Ext.define('Ext.some.DerivedClass', {\n     method: function () {\n         console.log('Bad');\n\n         // ... logic but with a bug ...\n\n         this.callParent();\n     }\n });\n
\n\n

To patch the bug in DerivedClass.method, the typical solution is to create an\noverride:

\n\n
 Ext.define('App.paches.DerivedClass', {\n     override: 'Ext.some.DerivedClass',\n\n     method: function () {\n         console.log('Fixed');\n\n         // ... logic but with bug fixed ...\n\n         this.callSuper();\n     }\n });\n
\n\n

The patch method cannot use callParent to call the superclass method since\nthat would call the overridden method containing the bug. In other words, the\nabove patch would only produce \"Fixed\" then \"Good\" in the console log, whereas,\nusing callParent would produce \"Fixed\" then \"Bad\" then \"Good\".

\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callSuper(arguments)

    \n

Returns

  • Object

    Returns the result of calling the superclass method

    \n
Ext.data.amf.Encoder
view source
( )
Reset all class states and starts a new empty array for encoding data. ...

Reset all class states and starts a new empty array for encoding data.\nThe method generates a new array for encoding, so it's safe to keep a\nreference to the old one.

\n
Ext.data.amf.Encoder
view source
( xml ) : Stringprivate
Converts an XML Document object to a string. ...

Converts an XML Document object to a string.

\n

Parameters

  • xml : Object

    XML document (type Document typically) to convert

    \n

Returns

  • String

    A string representing the document

    \n
Ext.data.amf.Encoder
view source
( item )private
Encodes a U29 int, returning a byte array with the encoded number. ...

Encodes a U29 int, returning a byte array with the encoded number.

\n

Parameters

  • item : Object
      \n
    • unsigned int value
    • \n
    \n\n
Ext.data.amf.Encoder
view source
( utf8Data ) : Arrayprivate
Encode the length of a UTF-8 string in AMF3 format. ...

Encode the length of a UTF-8 string in AMF3 format.

\n

Parameters

  • utf8Data : Array

    byte array with the encoded data

    \n

Returns

  • Array

    byte array encoding of length

    \n
Ext.data.amf.Encoder
view source
( num ) : Arrayprivate
Encodes an IEEE-754 double-precision number. ...

Encodes an IEEE-754 double-precision number.

\n

Parameters

  • num : Number

    the number to encode

    \n

Returns

  • Array

    byte array containing the encoded number

    \n
Ext.data.amf.Encoder
view source
( c ) : Array
Convert a UTF 16 char to a UTF 8 char ...

Convert a UTF 16 char to a UTF 8 char

\n

Parameters

  • c : Number

    char 16-bit code to convert

    \n

Returns

  • Array

    byte array with the UTF 8 values

    \n
Ext.data.amf.Encoder
view source
( str ) : Arrayprivate
Accepts a string and returns a byte array encoded in UTF-8 ...

Accepts a string and returns a byte array encoded in UTF-8

\n

Parameters

  • str : String

    String to encode

    \n

Returns

  • Array

    byte array with string encoded in UTF-8 format

    \n
Ext.data.amf.Encoder
view source
( value, byte_count ) : Array
Encode 16- or 32-bit integers into big-endian (network order) bytes ...

Encode 16- or 32-bit integers into big-endian (network order) bytes

\n

Parameters

  • value : Number

    the number to encode.

    \n
  • byte_count : Number

    2 or 4 byte encoding

    \n

Returns

  • Array

    byte array with encoded number

    \n
...
\n

Parameters

Ext.data.amf.Encoder
view source
( ) : Number
Returns the value of format. ...

Returns the value of format.

\n

Returns

Returns the initial configuration passed to constructor when instantiating\nthis class. ...

Returns the initial configuration passed to constructor when instantiating\nthis class.

\n

Parameters

  • name : String (optional)

    Name of the config option to return.

    \n

Returns

  • Object/Mixed

    The full config object or a single config value\nwhen name parameter specified.

    \n
...
\n

Parameters

( config ) : Ext.Basechainableprotected
Initialize configuration for this class. ...

Initialize configuration for this class. a typical example:

\n\n
Ext.define('My.awesome.Class', {\n    // The default config\n    config: {\n        name: 'Awesome',\n        isAwesome: true\n    },\n\n    constructor: function(config) {\n        this.initConfig(config);\n    }\n});\n\nvar awesome = new My.awesome.Class({\n    name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\n

Parameters

Returns

Ext.data.amf.Encoder
view source
( item ) : Boolean
Tries to determine if an object is an XML document ...

Tries to determine if an object is an XML document

\n

Parameters

Returns

  • Boolean

    true if it's an XML document, false otherwise

    \n
( names, callback, scope )private
...
\n

Parameters

( config, applyIfNotSet ) : Ext.Basechainableprivate
...
\n

Parameters

Returns

Ext.data.amf.Encoder
view source
( format )
Sets the value of format. ...

Sets the value of format.

\n

Parameters

Get the reference to the class from which this object was instantiated. ...

Get the reference to the class from which this object was instantiated. Note that unlike self,\nthis.statics() is scope-independent and it always returns the class from which it was called, regardless of what\nthis points to during run-time

\n\n
Ext.define('My.Cat', {\n    statics: {\n        totalCreated: 0,\n        speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n    },\n\n    constructor: function() {\n        var statics = this.statics();\n\n        alert(statics.speciesName);     // always equals to 'Cat' no matter what 'this' refers to\n                                        // equivalent to: My.Cat.speciesName\n\n        alert(this.self.speciesName);   // dependent on 'this'\n\n        statics.totalCreated++;\n    },\n\n    clone: function() {\n        var cloned = new this.self;                      // dependent on 'this'\n\n        cloned.groupName = this.statics().speciesName;   // equivalent to: My.Cat.speciesName\n\n        return cloned;\n    }\n});\n\n\nExt.define('My.SnowLeopard', {\n    extend: 'My.Cat',\n\n    statics: {\n        speciesName: 'Snow Leopard'     // My.SnowLeopard.speciesName = 'Snow Leopard'\n    },\n\n    constructor: function() {\n        this.callParent();\n    }\n});\n\nvar cat = new My.Cat();                 // alerts 'Cat', then alerts 'Cat'\n\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone));         // alerts 'My.SnowLeopard'\nalert(clone.groupName);                 // alerts 'Cat'\n\nalert(My.Cat.totalCreated);             // alerts 3\n
\n

Returns

Ext.data.amf.Encoder
view source
( arr )private
Writes an associative array in AMF0 format. ...

Writes an associative array in AMF0 format.

\n

Parameters

  • arr : Array

    the array to serialize.

    \n
Ext.data.amf.Encoder
view source
( item )private
Writes the appropriate AMF0 boolean value to the byte array. ...

Writes the appropriate AMF0 boolean value to the byte array.

\n

Parameters

Ext.data.amf.Encoder
view source
( date )private
Writes a date in AMF0 format. ...

Writes a date in AMF0 format.

\n

Parameters

  • date : Date

    the date object

    \n
Ext.data.amf.Encoder
view source
( obj )private
Write an object to the byte array in AMF0 format. ...

Write an object to the byte array in AMF0 format.\nSince we don't have the class information form Flex, the object\nis written as an anonymous object.

\n

Parameters

  • obj : Array

    the object to serialize.

    \n
Ext.data.amf.Encoder
view source
( )private
Writes the AMF0 null value to the byte array. ...

Writes the AMF0 null value to the byte array.

\n
Ext.data.amf.Encoder
view source
( item )private
Writes a numberic value to the byte array in AMF0 format ...

Writes a numberic value to the byte array in AMF0 format

\n

Parameters

  • item : Object

    A native numeric value, Number instance or one of Infinity, -Infinity or NaN

    \n
Ext.data.amf.Encoder
view source
( key, value )
Writes a key-value pair in AMF0 format. ...

Writes a key-value pair in AMF0 format.

\n

Parameters

  • key : String

    the name of the property

    \n
  • value : Object

    to write in AMF0 format

    \n
Ext.data.amf.Encoder
view source
( str )
Writes a short UTF8 string preceded with a 16-bit length. ...

Writes a short UTF8 string preceded with a 16-bit length.

\n

Parameters

  • str : String

    the string to write

    \n
Ext.data.amf.Encoder
view source
( arr )
Writes a strict-array in AMF0 format. ...

Writes a strict-array in AMF0 format. Unordered parts are ignored (e.g.\na[\"hello\"] will not be encoded). This function is included for\ncompleteness and will never be called by writeObject.

\n

Parameters

  • arr : Array

    the array to serialize.

    \n
Ext.data.amf.Encoder
view source
( item )private
Write an AMF0 UTF-8 string to the byte array ...

Write an AMF0 UTF-8 string to the byte array

\n

Parameters

  • item : String

    The string to write

    \n
Ext.data.amf.Encoder
view source
( )private
Writes the AMF0 undefined value to the byte array. ...

Writes the AMF0 undefined value to the byte array.

\n
Ext.data.amf.Encoder
view source
( xml )private
Writes an XMLDocument in AMF0 format. ...

Writes an XMLDocument in AMF0 format.

\n

Parameters

  • xml : Object

    XML document (type Document typically) to write

    \n
Ext.data.amf.Encoder
view source
( arr )private
Writes an array in AMF3 format. ...

Writes an array in AMF3 format. Only the ordered part of the array use handled.\nUnordered parts are ignored (e.g. a[\"hello\"] will not be encoded).

\n

Parameters

  • arr : Array

    the array to serialize.

    \n
Ext.data.amf.Encoder
view source
( item )private
Writes the appropriate AMF3 boolean value to the byte array. ...

Writes the appropriate AMF3 boolean value to the byte array.

\n

Parameters

Ext.data.amf.Encoder
view source
( arr )
Write a byte array in AMF3 format. ...

Write a byte array in AMF3 format. This function is never called directly\nby writeObject since there's no way to distinguish a regular array from a\nbyte array.

\n

Parameters

  • arr : Array

    the object to serialize.

    \n
Ext.data.amf.Encoder
view source
( date )private
Writes a date in AMF3 format. ...

Writes a date in AMF3 format.

\n

Parameters

  • date : Date

    the date object

    \n
Ext.data.amf.Encoder
view source
( obj )private
Write an object to the byte array in AMF3 format. ...

Write an object to the byte array in AMF3 format.\nSince we don't have the class information form Flex, the object\nis written as an anonymous object.

\n

Parameters

  • obj : Array

    the object to serialize.

    \n
Ext.data.amf.Encoder
view source
( )private
Writes the AMF3 null value to the byte array. ...

Writes the AMF3 null value to the byte array.

\n
Ext.data.amf.Encoder
view source
( item )private
Writes a numberic value to the byte array in AMF3 format ...

Writes a numberic value to the byte array in AMF3 format

\n

Parameters

  • item : Object

    A native numeric value, Number instance or one of Infinity, -Infinity or NaN

    \n
Ext.data.amf.Encoder
view source
( item )private
Write an AMF3 UTF-8 string to the byte array ...

Write an AMF3 UTF-8 string to the byte array

\n

Parameters

  • item : String

    The string to write

    \n
Ext.data.amf.Encoder
view source
( )private
Writes the AMF3 undefined value to the byte array. ...

Writes the AMF3 undefined value to the byte array.

\n
Ext.data.amf.Encoder
view source
( xml )private
Writes an XML object (ActionScript 3 new XML object) in AMF3 format. ...

Writes an XML object (ActionScript 3 new XML object) in AMF3 format.

\n

Parameters

  • xml : Object

    XML document (type Document typically) to write

    \n
Ext.data.amf.Encoder
view source
( xml )
Writes an Legacy XMLDocument (ActionScript Legacy XML object) in AMF3\nformat. ...

Writes an Legacy XMLDocument (ActionScript Legacy XML object) in AMF3\nformat. Must be called explicitly.\nThe writeObject method will call writeXml and not writeXmlDocument.

\n

Parameters

  • xml : Object

    XML document (type Document typically) to write

    \n
Ext.data.amf.Encoder
view source
( xml, amfType )private
Writes an XML document in AMF3 format. ...

Writes an XML document in AMF3 format.

\n

Parameters

  • xml : Object

    XML document (type Document typically)

    \n
  • amfType : number

    Either 0x07 or 0x0B - the AMF3 object type to use

    \n
Ext.data.amf.Encoder
view source
( headerName, mustUnderstand, value )private
Write an AMF header to the byte array. ...

Write an AMF header to the byte array. AMF headers are always encoded in AMF0.

\n

Parameters

  • headerName : String

    the header name

    \n
  • mustUnderstand : Boolean

    true if the receiver must understand this header or else reject it, false otherwise

    \n
  • value : Object

    the value to serialize. Must be an object that can be serialized by AMF

    \n
Ext.data.amf.Encoder
view source
( targetUri, responseUri, body )private
Writes an AMF message to the byte array. ...

Writes an AMF message to the byte array. AMF messages are always encoded in AMF0.

\n

Parameters

  • targetUri : String

    the class / method to call

    \n
  • responseUri : String

    the response should call here

    \n
  • body : Array

    the parameters to pass to the called method, wrapped in an array

    \n
Ext.data.amf.Encoder
view source
( headers )
Writes an AMF packet to the byte array ...

Writes an AMF packet to the byte array

\n

Parameters

  • headers : Array

    the headers to serialize. Each item in the array

    \n\n
               should be an object with three fields:\n           name, mustUnderstand, value\n
    \n\n

    @param {Array} messages the messages to serialize. Each item in the array

    \n\n
               should be an object with three fields:\n           targetUri, responseUri, body\n
    \n
Ext.data.amf.Encoder
view source
( b )private
Writes a byte to the byte array ...

Writes a byte to the byte array

\n

Parameters

  • b : number

    Byte to write to the array

    \n
Ext.data.amf.Encoder
view source
( b )private
Writes a byte array to the byte array ...

Writes a byte array to the byte array

\n

Parameters

  • b : number

    Byte array to append to the array

    \n
Ext.data.amf.Encoder
view source
( item )
Write the appropriate data items to the byte array. ...

Write the appropriate data items to the byte array. Supported types:\n- undefined\n- null\n- boolean\n- integer (if AMF3 - limited by 29-bit int, otherwise passed as double)\n- double\n- UTF-8 string\n- XML Document (identified by being instaneof Document. Can be generated with: new DOMParser()).parseFromString(xml, \"text/xml\");

\n

Parameters

  • item : Object

    A primitive or object to write to the stream

    \n
Defined By

Static Methods

( config )privatestatic
...
\n

Parameters

( members )chainableprivatestatic
...
\n

Parameters

( name, member )chainableprivatestatic
...
\n

Parameters

( members )chainablestatic
Add methods / properties to the prototype of this class. ...

Add methods / properties to the prototype of this class.

\n\n
Ext.define('My.awesome.Cat', {\n    constructor: function() {\n        ...\n    }\n});\n\n My.awesome.Cat.addMembers({\n     meow: function() {\n        alert('Meowww...');\n     }\n });\n\n var kitty = new My.awesome.Cat;\n kitty.meow();\n
\n

Parameters

( members ) : Ext.Basechainablestatic
Add / override static properties of this class. ...

Add / override static properties of this class.

\n\n
Ext.define('My.cool.Class', {\n    ...\n});\n\nMy.cool.Class.addStatics({\n    someProperty: 'someValue',      // My.cool.Class.someProperty = 'someValue'\n    method1: function() { ... },    // My.cool.Class.method1 = function() { ... };\n    method2: function() { ... }     // My.cool.Class.method2 = function() { ... };\n});\n
\n

Parameters

Returns

( xtype )chainableprivatestatic
...
\n

Parameters

( fromClass, members ) : Ext.Basechainableprivatestatic
Borrow another class' members to the prototype of this class. ...

Borrow another class' members to the prototype of this class.

\n\n
Ext.define('Bank', {\n    money: '$$$',\n    printMoney: function() {\n        alert('$$$$$$$');\n    }\n});\n\nExt.define('Thief', {\n    ...\n});\n\nThief.borrow(Bank, ['money', 'printMoney']);\n\nvar steve = new Thief();\n\nalert(steve.money); // alerts '$$$'\nsteve.printMoney(); // alerts '$$$$$$$'\n
\n

Parameters

  • fromClass : Ext.Base

    The class to borrow members from

    \n
  • members : Array/String

    The names of the members to borrow

    \n

Returns

Create a new instance of this Class. ...

Create a new instance of this Class.

\n\n
Ext.define('My.cool.Class', {\n    ...\n});\n\nMy.cool.Class.create({\n    someConfig: true\n});\n
\n\n

All parameters are passed to the constructor of the class.

\n

Returns

( alias, origin )static
Create aliases for existing prototype methods. ...

Create aliases for existing prototype methods. Example:

\n\n
Ext.define('My.cool.Class', {\n    method1: function() { ... },\n    method2: function() { ... }\n});\n\nvar test = new My.cool.Class();\n\nMy.cool.Class.createAlias({\n    method3: 'method1',\n    method4: 'method2'\n});\n\ntest.method3(); // test.method1()\n\nMy.cool.Class.createAlias('method5', 'method3');\n\ntest.method5(); // test.method3() -> test.method1()\n
\n

Parameters

( config )privatestatic
...
\n

Parameters

Get the current class' name in string format. ...

Get the current class' name in string format.

\n\n
Ext.define('My.cool.Class', {\n    constructor: function() {\n        alert(this.self.getName()); // alerts 'My.cool.Class'\n    }\n});\n\nMy.cool.Class.getName(); // 'My.cool.Class'\n
\n

Returns

( )deprecatedstatic
Adds members to class. ...

Adds members to class.

\n
\n

This method has been deprecated since 4.1

\n

Use addMembers instead.

\n\n
\n
( name, mixinClass )privatestatic
Used internally by the mixins pre-processor ...

Used internally by the mixins pre-processor

\n

Parameters

( fn, scope )chainableprivatestatic
...
\n

Parameters

( members ) : Ext.Basechainabledeprecatedstatic
Override members of this class. ...

Override members of this class. Overridden methods can be invoked via\ncallParent.

\n\n
Ext.define('My.Cat', {\n    constructor: function() {\n        alert(\"I'm a cat!\");\n    }\n});\n\nMy.Cat.override({\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callParent(arguments);\n\n        alert(\"Meeeeoooowwww\");\n    }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n                          // alerts \"I'm a cat!\"\n                          // alerts \"Meeeeoooowwww\"\n
\n\n

As of 4.1, direct use of this method is deprecated. Use Ext.define\ninstead:

\n\n
Ext.define('My.CatOverride', {\n    override: 'My.Cat',\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callParent(arguments);\n\n        alert(\"Meeeeoooowwww\");\n    }\n});\n
\n\n

The above accomplishes the same result but can be managed by the Ext.Loader\nwhich can properly order the override and its target class and the build process\ncan determine whether the override is needed based on the required state of the\ntarget class (My.Cat).

\n
\n

This method has been deprecated since 4.1.0

\n

Use Ext.define instead

\n\n
\n

Parameters

  • members : Object

    The properties to add to this class. This should be\nspecified as an object literal containing one or more properties.

    \n

Returns

","superclasses":["Ext.Base"],"meta":{},"code_type":"ext_define","requires":[],"html_meta":{},"statics":{"property":[{"tagname":"property","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"$onExtended","id":"static-property-S-onExtended"}],"cfg":[],"css_var":[],"method":[{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"addConfig","id":"static-method-addConfig"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"addInheritableStatics","id":"static-method-addInheritableStatics"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"addMember","id":"static-method-addMember"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true},"name":"addMembers","id":"static-method-addMembers"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true},"name":"addStatics","id":"static-method-addStatics"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"addXtype","id":"static-method-addXtype"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"borrow","id":"static-method-borrow"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true},"name":"create","id":"static-method-create"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true},"name":"createAlias","id":"static-method-createAlias"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"extend","id":"static-method-extend"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true},"name":"getName","id":"static-method-getName"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"deprecated":{"text":"Use {@link #addMembers} instead.","version":"4.1"}},"name":"implement","id":"static-method-implement"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"mixin","id":"static-method-mixin"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"private":true},"name":"onExtended","id":"static-method-onExtended"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"chainable":true,"markdown":true,"deprecated":{"text":"Use {@link Ext#define Ext.define} instead","version":"4.1.0"}},"name":"override","id":"static-method-override"},{"tagname":"method","owner":"Ext.Base","meta":{"static":true,"private":true},"name":"triggerExtended","id":"static-method-triggerExtended"}],"event":[],"css_mixin":[]},"files":[{"href":"Encoder.html#Ext-data-amf-Encoder","filename":"Encoder.js"}],"linenr":2,"members":{"property":[{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"$className","id":"property-S-className"},{"tagname":"property","owner":"Ext.data.amf.Encoder","meta":{"readonly":true},"name":"bytes","id":"property-bytes"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"configMap","id":"property-configMap"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"initConfigList","id":"property-initConfigList"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"initConfigMap","id":"property-initConfigMap"},{"tagname":"property","owner":"Ext.Base","meta":{"private":true},"name":"isInstance","id":"property-isInstance"},{"tagname":"property","owner":"Ext.Base","meta":{"protected":true},"name":"self","id":"property-self"}],"cfg":[{"tagname":"cfg","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"format","id":"cfg-format"}],"css_var":[],"method":[{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"constructor","id":"method-constructor"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"applyFormat","id":"method-applyFormat"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true,"deprecated":{"text":"as of 4.1. Use {@link #callParent} instead."}},"name":"callOverridden","id":"method-callOverridden"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true},"name":"callParent","id":"method-callParent"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true},"name":"callSuper","id":"method-callSuper"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"clear","id":"method-clear"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"configClass","id":"method-configClass"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"convertXmlToString","id":"method-convertXmlToString"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"destroy","id":"method-destroy"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"encode29Int","id":"method-encode29Int"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"encode3Utf8StringLen","id":"method-encode3Utf8StringLen"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"encodeDouble","id":"method-encodeDouble"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"encodeUtf8Char","id":"method-encodeUtf8Char"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"encodeUtf8String","id":"method-encodeUtf8String"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"encodeXInt","id":"method-encodeXInt"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"getConfig","id":"method-getConfig"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"getFormat","id":"method-getFormat"},{"tagname":"method","owner":"Ext.Base","meta":{},"name":"getInitialConfig","id":"method-getInitialConfig"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"hasConfig","id":"method-hasConfig"},{"tagname":"method","owner":"Ext.Base","meta":{"chainable":true,"protected":true},"name":"initConfig","id":"method-initConfig"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"isXmlDocument","id":"method-isXmlDocument"},{"tagname":"method","owner":"Ext.Base","meta":{"private":true},"name":"onConfigUpdate","id":"method-onConfigUpdate"},{"tagname":"method","owner":"Ext.Base","meta":{"chainable":true,"private":true},"name":"setConfig","id":"method-setConfig"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"setFormat","id":"method-setFormat"},{"tagname":"method","owner":"Ext.Base","meta":{"protected":true},"name":"statics","id":"method-statics"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0Array","id":"method-write0Array"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0Boolean","id":"method-write0Boolean"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0Date","id":"method-write0Date"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0GenericObject","id":"method-write0GenericObject"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0Null","id":"method-write0Null"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0Number","id":"method-write0Number"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"write0ObjectProperty","id":"method-write0ObjectProperty"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"write0ShortUtf8String","id":"method-write0ShortUtf8String"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"write0StrictArray","id":"method-write0StrictArray"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0String","id":"method-write0String"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0Undefined","id":"method-write0Undefined"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write0Xml","id":"method-write0Xml"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3Array","id":"method-write3Array"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3Boolean","id":"method-write3Boolean"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"write3ByteArray","id":"method-write3ByteArray"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3Date","id":"method-write3Date"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3GenericObject","id":"method-write3GenericObject"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3Null","id":"method-write3Null"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3Number","id":"method-write3Number"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3String","id":"method-write3String"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3Undefined","id":"method-write3Undefined"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3Xml","id":"method-write3Xml"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"write3XmlDocument","id":"method-write3XmlDocument"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"write3XmlWithType","id":"method-write3XmlWithType"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"writeAmfHeader","id":"method-writeAmfHeader"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"writeAmfMessage","id":"method-writeAmfMessage"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"writeAmfPacket","id":"method-writeAmfPacket"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"writeByte","id":"method-writeByte"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{"private":true},"name":"writeBytes","id":"method-writeBytes"},{"tagname":"method","owner":"Ext.data.amf.Encoder","meta":{},"name":"writeObject","id":"method-writeObject"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.data.amf.Encoder","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.data.amf.Encoder","mixins":[],"mixedInto":[]});