/**
 * Generated by Apache Royale Compiler from org\apache\royale\jewel\beads\controls\textinput\Restrict.as
 * org.apache.royale.jewel.beads.controls.textinput.Restrict
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.jewel.beads.controls.textinput.Restrict');

goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.jewel.supportClasses.textinput.TextInputBase');
goog.require('org.apache.royale.core.IBead');
goog.require('org.apache.royale.utils.Language');



/**
 *  constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @constructor
 * @implements {org.apache.royale.core.IBead}
 */
org.apache.royale.jewel.beads.controls.textinput.Restrict = function() {
};


/**
 * Prevent renaming of class. Needed for reflection.
 */
goog.exportSymbol('org.apache.royale.jewel.beads.controls.textinput.Restrict', org.apache.royale.jewel.beads.controls.textinput.Restrict);


/**
 * @private
 * @type {string}
 */
org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.org_apache_royale_jewel_beads_controls_textinput_Restrict__pattern;


/**
 * @private
 * @type {org.apache.royale.jewel.supportClasses.textinput.TextInputBase}
 */
org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.org_apache_royale_jewel_beads_controls_textinput_Restrict_host;


/**
 * @asprivate
 * @protected
 * @param {KeyboardEvent} event
 */
org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.keyEventHandler = function(event) {
  var /** @type {RegExp} */ re = new RegExp(this.pattern, 'g');
  this.org_apache_royale_jewel_beads_controls_textinput_Restrict_host.input.value = this.org_apache_royale_jewel_beads_controls_textinput_Restrict_host.input.value.replace(re, '');
};


org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.get__pattern = function() {
  return this.org_apache_royale_jewel_beads_controls_textinput_Restrict__pattern;
};


org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.set__pattern = function(value) {
  this.org_apache_royale_jewel_beads_controls_textinput_Restrict__pattern = value;
};


org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.set__strand = function(value) {
  this.org_apache_royale_jewel_beads_controls_textinput_Restrict_host = org.apache.royale.utils.Language.as(value, org.apache.royale.jewel.supportClasses.textinput.TextInputBase);
  this.org_apache_royale_jewel_beads_controls_textinput_Restrict_host.input.addEventListener('input', org.apache.royale.utils.Language.closure(this.keyEventHandler, this, 'keyEventHandler'));
};


Object.defineProperties(org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype, /** @lends {org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype} */ {
/**
  * @export
  * @type {string} */
pattern: {
get: org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.get__pattern,
set: org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.set__pattern},
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.set__strand}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.beads.controls.textinput.Restrict.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'pattern': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.beads.controls.textinput.Restrict'},
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.jewel.beads.controls.textinput.Restrict'}
      };
    },
    methods: function () {
      return {
        'Restrict': { type: '', declaredBy: 'org.apache.royale.jewel.beads.controls.textinput.Restrict'}
      };
    }
  };
};