/**
 * Generated by Apache Royale Compiler from org\apache\royale\html\beads\ApplicationParametersBead.as
 * org.apache.royale.html.beads.ApplicationParametersBead
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.html.beads.ApplicationParametersBead');

goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IBead');



/**
 * @constructor
 * @implements {org.apache.royale.core.IBead}
 */
org.apache.royale.html.beads.ApplicationParametersBead = function() {
};


/**
 * Prevent renaming of class. Needed for reflection.
 */
goog.exportSymbol('org.apache.royale.html.beads.ApplicationParametersBead', org.apache.royale.html.beads.ApplicationParametersBead);


/**
 * @protected
 * @type {org.apache.royale.core.IStrand}
 */
org.apache.royale.html.beads.ApplicationParametersBead.prototype._strand;


/**
 * @private
 * @type {Object}
 */
org.apache.royale.html.beads.ApplicationParametersBead.prototype.org_apache_royale_html_beads_ApplicationParametersBead__urlVars;


/**
 *  Returns the value of the specified URL parameter.
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.2
 * @export
 * @param {string} parameter
 * @return {string}
 */
org.apache.royale.html.beads.ApplicationParametersBead.prototype.getValue = function(parameter) {
  return this.org_apache_royale_html_beads_ApplicationParametersBead__urlVars[parameter];
};


org.apache.royale.html.beads.ApplicationParametersBead.prototype.set__strand = function(value) {
  this._strand = value;
  this.org_apache_royale_html_beads_ApplicationParametersBead__urlVars = {};
  var /** @type {string} */ query = location.search.substring(1);
  if (query) {
    var /** @type {Array} */ vars = query.split("&");
    for (var /** @type {number} */ i = 0; i < vars.length; i++) {
      var /** @type {Array} */ pair = vars[i].split("=");
      this.org_apache_royale_html_beads_ApplicationParametersBead__urlVars[pair[0]] = decodeURIComponent(pair[1]);
    }
  }
  
};


Object.defineProperties(org.apache.royale.html.beads.ApplicationParametersBead.prototype, /** @lends {org.apache.royale.html.beads.ApplicationParametersBead.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.ApplicationParametersBead.prototype.set__strand}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.royale.html.beads.ApplicationParametersBead.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'ApplicationParametersBead', qName: 'org.apache.royale.html.beads.ApplicationParametersBead', kind: 'class' }], interfaces: [org.apache.royale.core.IBead] };



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.ApplicationParametersBead.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.beads.ApplicationParametersBead'}
      };
    },
    methods: function () {
      return {
        'ApplicationParametersBead': { type: '', declaredBy: 'org.apache.royale.html.beads.ApplicationParametersBead'},
        'getValue': { type: 'String', declaredBy: 'org.apache.royale.html.beads.ApplicationParametersBead', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }}
      };
    }
  };
};