http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/html5/TextArea.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/TextArea.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/TextArea.js index 81f80dd..de728ce 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html5/TextArea.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/TextArea.js @@ -42,20 +42,13 @@ org_apache_flex_html5_TextArea.prototype.createElement = }; -/** - * @expose - * @return {string} The text getter. - */ -org_apache_flex_html5_TextArea.prototype.get_text = function() { - return this.element.value; -}; - - -/** - * @expose - * @param {string} value The text setter. - */ -org_apache_flex_html5_TextArea.prototype.set_text = - function(value) { - this.element.value = value; -}; +Object.defineProperties(org_apache_flex_html5_TextArea.prototype, { + 'text': { + get: function() { + return this.element.value; + }, + set: function(value) { + this.element.value = value; + } + } +});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/html5/TextInput.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html5/TextInput.js b/frameworks/js/FlexJS/src/org/apache/flex/html5/TextInput.js index 12ddecc..e5226c8 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html5/TextInput.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html5/TextInput.js @@ -43,20 +43,13 @@ org_apache_flex_html5_TextInput.prototype.createElement = }; -/** - * @expose - * @return {string} The text getter. - */ -org_apache_flex_html5_TextInput.prototype.get_text = function() { - return this.element.value; -}; - - -/** - * @expose - * @param {string} value The text setter. - */ -org_apache_flex_html5_TextInput.prototype.set_text = - function(value) { - this.element.value = value; -}; +Object.defineProperties(org_apache_flex_html5_TextInput.prototype, { + 'text': { + get: function() { + return this.element.value; + }, + set: function(value) { + this.element.value = value; + } + } +}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/jquery/CheckBox.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/jquery/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/jquery/CheckBox.js index f3052ef..cfd452c 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/jquery/CheckBox.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/jquery/CheckBox.js @@ -61,40 +61,21 @@ org_apache_flex_jquery_CheckBox.prototype.createElement = }; -/** - * @expose - * @return {string} The text getter. - */ -org_apache_flex_jquery_CheckBox.prototype.get_text = function() { - return this.element.childNodes.item(1).nodeValue; -}; - - -/** - * @expose - * @param {string} value The text setter. - */ -org_apache_flex_jquery_CheckBox.prototype.set_text = - function(value) { - this.element.childNodes.item(1).nodeValue = value; -}; - - -/** - * @expose - * @return {boolean} The selected getter. - */ -org_apache_flex_jquery_CheckBox.prototype.get_selected = - function() { - return this.element.childNodes.item(0).checked; -}; - - -/** - * @expose - * @param {boolean} value The selected setter. - */ -org_apache_flex_jquery_CheckBox.prototype.set_selected = - function(value) { - this.element.childNodes.item(0).checked = value; -}; +Object.defineProperties(org_apache_flex_jquery_CheckBox.prototype, { + 'text': { + get: function() { + return this.element.childNodes.item(1).nodeValue; + }, + set: function(value) { + this.element.childNodes.item(1).nodeValue = value; + } + }, + 'selected': { + get: function() { + return this.element.childNodes.item(0).checked; + }, + set: function(value) { + this.element.childNodes.item(0).checked = value; + } + } +}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/jquery/RadioButton.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/jquery/RadioButton.js b/frameworks/js/FlexJS/src/org/apache/flex/jquery/RadioButton.js index 3584ce9..648a895 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/jquery/RadioButton.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/jquery/RadioButton.js @@ -99,134 +99,74 @@ org_apache_flex_jquery_RadioButton.prototype.addedToParent = }; -/** - * @override - */ -org_apache_flex_jquery_RadioButton.prototype.set_id = function(value) { - org_apache_flex_jquery_RadioButton.base(this, 'set_id', value); - this.labelFor.id = value; - this.labelFor.htmlFor = value; -}; - - -/** - * @expose - * @return {?string} The groupName getter. - */ -org_apache_flex_jquery_RadioButton.prototype.get_groupName = - function() { - return this.radioGroupName; -}; - - -/** - * @expose - * @param {string} value The groupName setter. - */ -org_apache_flex_jquery_RadioButton.prototype.set_groupName = - function(value) { - - this.radioGroupName = value; - this.input.name = value; -}; - - -/** - * @expose - * @return {string} The text getter. - */ -org_apache_flex_jquery_RadioButton.prototype.get_text = - function() { - return this.labelFor.innerHTML; -}; - - -/** - * @expose - * @param {string} value The text setter. - */ -org_apache_flex_jquery_RadioButton.prototype.set_text = - function(value) { - this.labelFor.innerHTML = value; -}; - - -/** - * @expose - * @return {boolean} The selected getter. - */ -org_apache_flex_jquery_RadioButton.prototype.get_selected = - function() { - return this.input.checked; -}; - - -/** - * @expose - * @param {boolean} value The selected setter. - */ -org_apache_flex_jquery_RadioButton.prototype.set_selected = - function(value) { - this.input.checked = value; -}; - - -/** - * @expose - * @return {Object} The value getter. - */ -org_apache_flex_jquery_RadioButton.prototype.get_value = - function() { - return this.input.value; -}; - - -/** - * @expose - * @param {Object} value The value setter. - */ -org_apache_flex_jquery_RadioButton.prototype.set_value = - function(value) { - this.input.value = value; -}; - - -/** - * @expose - * @return {Object} The value of the selected RadioButton. - */ -org_apache_flex_jquery_RadioButton.prototype.get_selectedValue = - function() { - var buttons, groupName, i, n; - - groupName = this.input.name; - buttons = document.getElementsByName(groupName); - n = buttons.length; - - for (i = 0; i < n; i++) { - if (buttons[i].checked) { - return buttons[i].value; - } - } - return null; -}; - - -/** - * @expose - * @param {Object} value The value of the selected RadioButton. - */ -org_apache_flex_jquery_RadioButton.prototype.set_selectedValue = - function(value) { - var buttons, groupName, i, n; - - groupName = this.input.name; - buttons = document.getElementsByName(groupName); - n = buttons.length; - for (i = 0; i < n; i++) { - if (buttons[i].value === value) { - buttons[i].checked = true; - break; - } - } -}; +Object.defineProperties(org_apache_flex_jquery_RadioButton.prototype, { + 'id': { + set: function(value) { + org_apache_flex_jquery_RadioButton.base(this, 'set_id', value); + this.labelFor.id = value; + this.labelFor.htmlFor = value; + } + }, + 'groupName': { + get: function() { + return this.radioGroupName; + }, + set: function(value) { + this.radioGroupName = value; + this.input.name = value; + } + }, + 'text': { + get: function() { + return this.labelFor.innerHTML; + }, + set: function(value) { + this.labelFor.innerHTML = value; + } + }, + 'selected': { + get: function() { + return this.input.checked; + }, + set: function(value) { + this.input.checked = value; + } + }, + 'value': { + get: function() { + return this.input.value; + }, + set: function(value) { + this.input.value = value; + } + }, + 'selectedValue': { + get: function() { + var buttons, groupName, i, n; + + groupName = this.input.name; + buttons = document.getElementsByName(groupName); + n = buttons.length; + + for (i = 0; i < n; i++) { + if (buttons[i].checked) { + return buttons[i].value; + } + } + return null; + }, + set: function(value) { + var buttons, groupName, i, n; + + groupName = this.input.name; + buttons = document.getElementsByName(groupName); + n = buttons.length; + for (i = 0; i < n; i++) { + if (buttons[i].value === value) { + buttons[i].checked = true; + break; + } + } + } + } +}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/jquery/ToggleTextButton.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/jquery/ToggleTextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/jquery/ToggleTextButton.js index cb94fd3..a6cc30c 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/jquery/ToggleTextButton.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/jquery/ToggleTextButton.js @@ -92,66 +92,44 @@ org_apache_flex_jquery_ToggleTextButton.prototype.addedToParent = }; -/** - * @override - */ -org_apache_flex_jquery_ToggleTextButton.prototype.set_id = function(value) { - org_apache_flex_jquery_ToggleTextButton.base(this, 'set_id', value); - this.labelFor.id = value; - this.labelFor.htmlFor = value; -}; - - -/** - * @expose - * @return {string} The text getter. - */ -org_apache_flex_jquery_ToggleTextButton.prototype.get_text = function() { - return this.labelFor.innerHTML; -}; - - -/** - * @expose - * @param {string} value The text setter. - */ -org_apache_flex_jquery_ToggleTextButton.prototype.set_text = - function(value) { - this.labelFor.innerHTML = value; -}; - - -/** - * @expose - * @return {boolean} The selected getter. - */ -org_apache_flex_jquery_ToggleTextButton.prototype.get_selected = - function() { - return this.input.selected_; -}; - - -/** - * @expose - * @param {boolean} value The selected setter. - */ -org_apache_flex_jquery_ToggleTextButton.prototype.set_selected = - function(value) { - if (this.input.selected_ != value) { - this.inputselected_ = value; -/* - var className = this.className; - if (value) { - if (className.indexOf(this.SELECTED) == className.length - this.SELECTED.length) - this.className = className.substring(0, className.length - this.SELECTED.length); - } - else { - if (className.indexOf(this.SELECTED) == -1) - this.className = className + this.SELECTED; - } -*/ - } -}; +Object.defineProperties(org_apache_flex_jquery_ToggleTextButton.prototype, { + 'id': { + set: function(value) { + org_apache_flex_jquery_ToggleTextButton.base(this, 'set_id', value); + this.labelFor.id = value; + this.labelFor.htmlFor = value; + } + }, + 'text': { + get: function() { + return this.labelFor.innerHTML; + }, + set: function(value) { + this.labelFor.innerHTML = value; + } + }, + 'selected': { + get: function() { + return this.input.selected_; + }, + set: function(value) { + if (this.input.selected_ != value) { + this.inputselected_ = value; + /* + var className = this.className; + if (value) { + if (className.indexOf(this.SELECTED) == className.length - this.SELECTED.length) + this.className = className.substring(0, className.length - this.SELECTED.length); + } + else { + if (className.indexOf(this.SELECTED) == -1) + this.className = className + this.SELECTED; + } + */ + } + } + } +}); /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Map.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Map.js b/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Map.js index eb99fc6..78972b5 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Map.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/maps/google/Map.js @@ -79,23 +79,18 @@ org_apache_flex_maps_google_Map.prototype.createElement = }; -/** - * @expose - * @param {String} value Google API dev token. - */ -org_apache_flex_maps_google_Map.prototype.set_token = function(value) { - this.token = value; -}; - - -/** - * @expose - * @return {Object} The marker that was last selected. - */ -org_apache_flex_maps_google_Map.prototype.get_selectedMarker = -function() { - return this._selectedMarker; -}; +Object.defineProperties(org_apache_flex_maps_google_Map.prototype, { + 'token': { + set: function(value) { + this.token = value; + } + }, + 'selectedMarker': { + get: function() { + return this._selectedMarker; + } + } +}); /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js b/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js index 2df3b82..496b681 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/net/BinaryUploader.js @@ -129,167 +129,116 @@ org_apache_flex_net_BinaryUploader.HTTP_METHOD_PUT = 'PUT'; org_apache_flex_net_BinaryUploader.HTTP_METHOD_DELETE = 'DELETE'; -/** - * @expose - * @return {string} value The data. - */ -org_apache_flex_net_BinaryUploader.prototype.get_data = function() { - return this.element.responseText; -}; - - -/** - * @expose - * @return {org_apache_flex_utils_BinaryData} value The binary Data. - */ -org_apache_flex_net_BinaryUploader.prototype.get_binaryData = function() { - return this.binaryData_; -}; - - -/** - * @expose - * @param {org_apache_flex_utils_BinaryData} value The binary Data. - */ -org_apache_flex_net_BinaryUploader.prototype.set_binaryData = function(value) { - this.binaryData_ = value; -}; - - -/** - * @expose - * @return {string} value The contentType. - */ -org_apache_flex_net_BinaryUploader.prototype.get_contentType = function() { - return this.contentType_; -}; - - -/** - * @expose - * @param {string} value The contentType. - */ -org_apache_flex_net_BinaryUploader.prototype.set_contentType = function(value) { - this.contentType_ = value; -}; - - -/** - * @expose - * @return {Array} value The array of HTTPHeaders. - */ -org_apache_flex_net_BinaryUploader.prototype.get_headers = function() { - if (this.headers_ === 'undefined') { - this.headers_ = []; - } - - return this.headers_; -}; - - -/** - * @expose - * @param {Array} value The array of HTTPHeaders. - */ -org_apache_flex_net_BinaryUploader.prototype.set_headers = function(value) { - this.headers_ = value; -}; - - -/** - * @expose - * @return {string} value The method. - */ -org_apache_flex_net_BinaryUploader.prototype.get_method = function() { - return this.method_; -}; - - -/** - * @expose - * @param {string} value The method. - */ -org_apache_flex_net_BinaryUploader.prototype.set_method = function(value) { - this.method_ = value; -}; - - -/** - * @expose - * @return {Array} value The array of HTTPHeaders. - */ -org_apache_flex_net_BinaryUploader.prototype.get_responseHeaders = function() { - var allHeaders, c, hdr, i, n, part1, part2; - - if (typeof this.responseHeaders_ === 'undefined') { - allHeaders = this.element.getAllResponseHeaders(); - this.responseHeaders_ = allHeaders.split('\n'); - n = this.responseHeaders_.length; - for (i = 0; i < n; i++) { - hdr = this.responseHeaders_[i]; - c = hdr.indexOf(':'); - part1 = hdr.substring(0, c); - part2 = hdr.substring(c + 2); - this.responseHeaders_[i] = - new org_apache_flex_net_HTTPHeader(part1, part2); - } - } - return this.responseHeaders_; -}; - - -/** - * @expose - * @return {string} value The url. - */ -org_apache_flex_net_BinaryUploader.prototype.get_responseURL = function() { - return this.responseURL_; -}; - - -/** - * @expose - * @return {Number} value The status. - */ -org_apache_flex_net_BinaryUploader.prototype.get_status = function() { - return this.status_; -}; - - -/** - * @expose - * @return {Number} value The timeout. - */ -org_apache_flex_net_BinaryUploader.prototype.get_timeout = function() { - return this.timeout_; -}; - - -/** - * @expose - * @param {Number} value The timeout. - */ -org_apache_flex_net_BinaryUploader.prototype.set_timeout = function(value) { - this.timeout_ = value; -}; - - -/** - * @expose - * @return {string} value The url. - */ -org_apache_flex_net_BinaryUploader.prototype.get_url = function() { - return this.url_; -}; - - -/** - * @expose - * @param {string} value The url to fetch. - */ -org_apache_flex_net_BinaryUploader.prototype.set_url = function(value) { - this.url_ = value; -}; +Object.defineProperties(org_apache_flex_net_BinaryUploader.prototype, { + 'data': { + get: function() { + return this.element.responseText; + } + }, + 'binaryData': { + get: function() { + return this.binaryData_; + }, + set: function(value) { + this.binaryData_ = value; + } + }, + 'contentType': { + get: function() { + return this.contentType_; + }, + set: function(value) { + this.contentType_ = value; + } + }, + 'headers': { + get: function() { + if (this.headers_ === 'undefined') { + this.headers_ = []; + } + + return this.headers_; + }, + set: function(value) { + this.headers_ = value; + } + }, + 'method': { + get: function() { + return this.method_; + }, + set: function(value) { + this.method_ = value; + } + }, + 'responseHeaders': { + get: function() { + var allHeaders, c, hdr, i, n, part1, part2; + + if (typeof this.responseHeaders_ === 'undefined') { + allHeaders = this.element.getAllResponseHeaders(); + this.responseHeaders_ = allHeaders.split('\n'); + n = this.responseHeaders_.length; + for (i = 0; i < n; i++) { + hdr = this.responseHeaders_[i]; + c = hdr.indexOf(':'); + part1 = hdr.substring(0, c); + part2 = hdr.substring(c + 2); + this.responseHeaders_[i] = + new org_apache_flex_net_HTTPHeader(part1, part2); + } + } + return this.responseHeaders_; + } + }, + 'responseURL': { + get: function() { + return this.responseURL_; + } + }, + 'status': { + get: function() { + return this.status_; + } + }, + 'timeout': { + get: function() { + return this.timeout_; + }, + set: function(value) { + this.timeout_ = value; + } + }, + 'url': { + get: function() { + return this.url_; + }, + set: function(value) { + this.url_ = value; + } + }, + 'id': { + get: function() { + return this.id; + }, + set: function(value) { + if (this.id !== value) { + this.id = value; + this.dispatchEvent('idChanged'); + } + } + }, + 'MXMLDescriptor': { + get: function() { + return null; + } + }, + 'MXMLProperties': { + get: function() { + return null; + } + } +}); /** @@ -369,45 +318,6 @@ org_apache_flex_net_BinaryUploader.prototype.id = null; /** - * @expose - * @return {string} The id. - */ -org_apache_flex_net_BinaryUploader.prototype.get_id = function() { - return this.id; -}; - - -/** - * @expose - * @param {Object} value The new id. - */ -org_apache_flex_net_BinaryUploader.prototype.set_id = function(value) { - if (this.id !== value) { - this.id = value; - this.dispatchEvent('idChanged'); - } -}; - - -/** - * @expose - * @return {Array} The array of descriptors. - */ -org_apache_flex_net_BinaryUploader.prototype.get_MXMLDescriptor = function() { - return null; -}; - - -/** - * @expose - * @return {Array} The array of properties. - */ -org_apache_flex_net_BinaryUploader.prototype.get_MXMLProperties = function() { - return null; -}; - - -/** * @param {Object} document The MXML object. * @param {string} id The id for the instance. */ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/net/HTTPService.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/net/HTTPService.js b/frameworks/js/FlexJS/src/org/apache/flex/net/HTTPService.js index acefa66..017b8ce 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/net/HTTPService.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/net/HTTPService.js @@ -135,176 +135,132 @@ org_apache_flex_net_HTTPService.HTTP_METHOD_PUT = 'PUT'; org_apache_flex_net_HTTPService.HTTP_METHOD_DELETE = 'DELETE'; -/** - * @expose - * @param {Array.<Object>} value The array of beads. - */ -org_apache_flex_net_HTTPService.prototype.set_beads = function(value) { - this.beads_ = value; -}; - - -/** - * @expose - * @return {string} value The data. - */ -org_apache_flex_net_HTTPService.prototype.get_data = function() { - return this.element.responseText; -}; - - -/** - * @expose - * @return {?string} value The contentData. - */ -org_apache_flex_net_HTTPService.prototype.get_contentData = function() { - return this.contentData_; -}; - - -/** - * @expose - * @param {string} value The contentData. - */ -org_apache_flex_net_HTTPService.prototype.set_contentData = function(value) { - this.contentData_ = value; -}; - - -/** - * @expose - * @return {string} value The contentType. - */ -org_apache_flex_net_HTTPService.prototype.get_contentType = function() { - return this.contentType_; -}; - - -/** - * @expose - * @param {string} value The contentType. - */ -org_apache_flex_net_HTTPService.prototype.set_contentType = function(value) { - this.contentType_ = value; -}; - - -/** - * @expose - * @return {Array} value The array of HTTPHeaders. - */ -org_apache_flex_net_HTTPService.prototype.get_headers = function() { - if (this.headers_ === undefined) { - this.headers_ = []; - } - - return this.headers_; -}; - - -/** - * @expose - * @param {Array} value The array of HTTPHeaders. - */ -org_apache_flex_net_HTTPService.prototype.set_headers = function(value) { - this.headers_ = value; -}; - - -/** - * @expose - * @return {string} value The method. - */ -org_apache_flex_net_HTTPService.prototype.get_method = function() { - return this.method_; -}; - - -/** - * @expose - * @param {string} value The method. - */ -org_apache_flex_net_HTTPService.prototype.set_method = function(value) { - this.method_ = value; -}; - - -/** - * @expose - * @return {Array} value The array of HTTPHeaders. - */ -org_apache_flex_net_HTTPService.prototype.get_responseHeaders = function() { - var allHeaders, c, hdr, i, n, part1, part2; - - if (typeof this.responseHeaders_ === 'undefined') { - allHeaders = this.element.getAllResponseHeaders(); - this.responseHeaders_ = allHeaders.split('\n'); - n = this.responseHeaders_.length; - for (i = 0; i < n; i++) { - hdr = this.responseHeaders_[i]; - c = hdr.indexOf(':'); - part1 = hdr.substring(0, c); - part2 = hdr.substring(c + 2); - this.responseHeaders_[i] = - new org_apache_flex_net_HTTPHeader(part1, part2); - } - } - return this.responseHeaders_; -}; - - -/** - * @expose - * @return {?string} value The url. - */ -org_apache_flex_net_HTTPService.prototype.get_responseURL = function() { - return this.responseURL_; -}; - - -/** - * @expose - * @return {number} value The status. - */ -org_apache_flex_net_HTTPService.prototype.get_status = function() { - return this.status_; -}; - - -/** - * @expose - * @return {number} value The timeout. - */ -org_apache_flex_net_HTTPService.prototype.get_timeout = function() { - return this.timeout_; -}; - - -/** - * @expose - * @param {number} value The timeout. - */ -org_apache_flex_net_HTTPService.prototype.set_timeout = function(value) { - this.timeout_ = value; -}; - - -/** - * @expose - * @return {?string} value The url. - */ -org_apache_flex_net_HTTPService.prototype.get_url = function() { - return this.url_; -}; - - -/** - * @expose - * @param {string} value The url to fetch. - */ -org_apache_flex_net_HTTPService.prototype.set_url = function(value) { - this.url_ = value; -}; +Object.defineProperties(org_apache_flex_net_HTTPService.prototype, { + 'beads': { + set: function(value) { + this.beads_ = value; + } + }, + 'data': { + get: function() { + return this.element.responseText; + } + }, + 'contentData': { + get: function() { + return this.contentData_; + }, + set: function(value) { + this.contentData_ = value; + } + }, + 'contentType': { + get: function() { + return this.contentType_; + }, + set: function(value) { + this.contentType_ = value; + } + }, + 'headers': { + get: function() { + if (this.headers_ === undefined) { + this.headers_ = []; + } + + return this.headers_; + }, + set: function(value) { + this.headers_ = value; + } + }, + 'method': { + get: function() { + return this.method_; + }, + set: function(value) { + this.method_ = value; + } + }, + 'responseHeaders': { + get: function() { + var allHeaders, c, hdr, i, n, part1, part2; + + if (typeof this.responseHeaders_ === 'undefined') { + allHeaders = this.element.getAllResponseHeaders(); + this.responseHeaders_ = allHeaders.split('\n'); + n = this.responseHeaders_.length; + for (i = 0; i < n; i++) { + hdr = this.responseHeaders_[i]; + c = hdr.indexOf(':'); + part1 = hdr.substring(0, c); + part2 = hdr.substring(c + 2); + this.responseHeaders_[i] = + new org_apache_flex_net_HTTPHeader(part1, part2); + } + } + return this.responseHeaders_; + } + }, + 'responseURL': { + get: function() { + return this.responseURL_; + } + }, + 'status': { + get: function() { + return this.status_; + } + }, + 'timeout': { + get: function() { + return this.timeout_; + }, + set: function(value) { + this.timeout_ = value; + } + }, + 'url': { + get: function() { + return this.url_; + }, + set: function(value) { + this.url_ = value; + } + }, + 'id': { + get: function() { + return this.id; + }, + set: function(value) { + if (this.id !== value) { + this.id = value; + this.dispatchEvent('idChanged'); + } + } + }, + 'MXMLDescriptor': { + get: function() { + return null; + } + }, + 'MXMLProperties': { + get: function() { + return null; + } + }, + 'strand': { + set: function(value) { + if (this.strand_ !== value) { + this.strand_ = value; + } + var n = this.beads_ ? this.beads_.length : 0; + for (var i = 0; i < n; i++) { + this.addBead(this.beads_[i]); + } + } + } +}); /** @@ -391,63 +347,9 @@ org_apache_flex_net_HTTPService.prototype.id = null; /** - * @expose - * @return {?string} The id. - */ -org_apache_flex_net_HTTPService.prototype.get_id = function() { - return this.id; -}; - - -/** - * @expose - * @param {string} value The new id. - */ -org_apache_flex_net_HTTPService.prototype.set_id = function(value) { - if (this.id !== value) { - this.id = value; - this.dispatchEvent('idChanged'); - } -}; - - -/** - * @expose - * @return {Array} The array of descriptors. - */ -org_apache_flex_net_HTTPService.prototype.get_MXMLDescriptor = function() { - return null; -}; - - -/** - * @expose - * @return {Array} The array of properties. - */ -org_apache_flex_net_HTTPService.prototype.get_MXMLProperties = function() { - return null; -}; - - -/** * @param {Object} document The MXML object. * @param {string} id The id for the instance. */ org_apache_flex_net_HTTPService.prototype.setDocument = function(document, id) { this.document = document; }; - - -/** - * @expose - * @param {Object} value The strand. - */ -org_apache_flex_net_HTTPService.prototype.set_strand = function(value) { - if (this.strand_ !== value) { - this.strand_ = value; - } - var n = this.beads_ ? this.beads_.length : 0; - for (var i = 0; i < n; i++) { - this.addBead(this.beads_[i]); - } -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5344e8ba/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js index 0bf23b5..3f9acde 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/BinaryData.js @@ -46,13 +46,31 @@ org_apache_flex_utils_BinaryData.prototype.FLEXJS_CLASS_INFO = qName: 'org_apache_flex_utils_BinaryData'}] }; -/** - * @expose - * @return {Object} The platform-specific data. - */ -org_apache_flex_utils_BinaryData.prototype.get_data = function() { - return this.data_; -}; +Object.defineProperties(org_apache_flex_utils_BinaryData.prototype, { + 'data': { + get: function() { + return this.data_; + } + }, + 'position': { + get: function() { + return this.position_; + }, + set: function(value) { + this.position_ = value; + } + }, + 'length': { + get: function() { + return this.data_.byteLength; + } + }, + 'bytesAvailable': { + get: function() { + return this.data_.byteLength - this.position_; + } + } +}); /** @@ -171,42 +189,6 @@ org_apache_flex_utils_BinaryData.prototype.readUnsignedInteger = /** * @expose - * @return {number} The offset to write to or read from. - */ -org_apache_flex_utils_BinaryData.prototype.get_position = function() { - return this.position_; -}; - - -/** - * @expose - * @param {number} value The offset to write to or read from. - */ -org_apache_flex_utils_BinaryData.prototype.set_position = function(value) { - this.position_ = value; -}; - - -/** - * @expose - * @return {number} The offset to write to or read from. - */ -org_apache_flex_utils_BinaryData.prototype.get_length = function() { - return this.data_.byteLength; -}; - - -/** - * @expose - * @return {number} The number of bytes that can still be read. - */ -org_apache_flex_utils_BinaryData.prototype.get_bytesAvailable = function() { - return this.data_.byteLength - this.position_; -}; - - -/** - * @expose * @param {number} extra The number of bytes to add to the buffer. */ org_apache_flex_utils_BinaryData.prototype.growBuffer = function(extra) {
