blob: 832a91fae8ef76c76cebfc0621df08373799edfd [file] [log] [blame]
{ "type": "class",
"qname": "mx.validators.Validator",
"baseClassname": "org.apache.royale.events.EventDispatcher"
,
"description": "The Validator class is the base class for all Flex validators. This class implements the ability for a validator to make a field required, which means that the user must enter a value in the field or the validation fails. <p>The Validator class defines the following tag attributes, which all of its subclasses inherit:</p> <pre>\\n &lt;mx:Validator\\n enabled=&quot;true|false&quot;\\n listener=&quot;<i>Value of the source property</i>&quot;\\n property=&quot;<i>No default</i>&quot;\\n required=&quot;true|false&quot;\\n requiredFieldError=&quot;This field is required.&quot;\\n source=&quot;<i>No default</i>&quot;\\n trigger=&quot;<i>Value of the source property</i>&quot;\\n triggerEvent=&quot;valueCommit&quot;\\n /&gt;\\n </pre>",
"tags": [
{ "tagName": "includeExample",
"values": ["examples/SimpleValidatorExample.mxml"]},
{ "tagName": "see",
"values": ["mx.events.ValidationResultEvent", "mx.validators.ValidationResult", "mx.validators.RegExpValidationResult"]},
{ "tagName": "mxml",
"values": []},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"members": [
{ "type": "field",
"qname": "DECIMAL_DIGITS",
"return": "String",
"namespace": "protected",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "A String containing the decimal digits 0 through 9.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "validateAll",
"namespace": "public",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "Invokes all the validators in the <code>validators</code> Array. Returns an Array containing one ValidationResultEvent object for each validator that failed. Returns an empty Array if all validators succeed. contains one ValidationResultEvent object for each validator that failed. The Array is empty if all validators succeed.",
"tags": [
{ "tagName": "param",
"values": ["validators An Array containing the Validator objects to execute."]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "return",
"values": ["Array of ValidationResultEvent objects, where the Array"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Array",
"params": [{ "name": "validators", "type": "Array"}]}
,
{ "type": "method",
"qname": "mx.validators.Validator",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Constructor.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "",
"params": []}
,
{ "type": "accessor",
"access": "read-only",
"return": "org.apache.royale.events.IEventDispatcher",
"qname": "actualTrigger",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Contains the trigger object, if any, or the source object. Used to determine the listener object for the <code>triggerEvent</code>.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "Array",
"qname": "actualListeners",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Contains an Array of listener objects, if any, or the source object. Used to determine which object to notify about the validation result.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "enabled",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Setting this value to <code>false</code> will stop the validator from performing validation. When a validator is disabled, it dispatch no events, and the <code>validate()</code> method returns null.",
"tags": [
{ "tagName": "default",
"values": ["true"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Object",
"qname": "listener",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Specifies the validation listener. <p>If you do not specify a listener, Flex uses the value of the <code>source</code> property. After Flex determines the source component, it changes the border color of the component, displays an error message for a failure, or hides any existing error message for a successful validation.</p>",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "property",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "A String specifying the name of the property of the <code>source</code> object that contains the value to validate. The property is optional, but if you specify <code>source</code>, you should set a value for this property as well.",
"tags": [
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "required",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "If <code>true</code>, specifies that a missing or empty value causes a validation error.",
"tags": [
{ "tagName": "default",
"values": ["true"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Object",
"qname": "source",
"namespace": "public",
"bindable": ["sourceChanged"],
"details": [],
"deprecated": {},
"description": "Specifies the object containing the property to validate. Set this to an instance of a component or a data model. You use data binding syntax in MXML to specify the value. This property supports dot-delimited Strings for specifying nested properties. If you specify a value to the <code>source</code> property, then you should specify a value to the <code>property</code> property as well. The <code>source</code> property is optional.",
"tags": [
{ "tagName": "default",
"values": ["null"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "field",
"qname": "subFields",
"return": "Array",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "An Array of Strings containing the names for the properties contained in the <code>value</code> Object passed to the <code>validate()</code> method. For example, CreditCardValidator sets this property to <code>[ &quot;cardNumber&quot;, &quot;cardType&quot; ]</code>. This value means that the <code>value</code> Object passed to the <code>validate()</code> method should contain a <code>cardNumber</code> and a <code>cardType</code> property. <p>Subclasses of the Validator class that validate multiple data fields (like CreditCardValidator and DateValidator) should assign this property in their constructor. </p>",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "org.apache.royale.events.IEventDispatcher",
"qname": "trigger",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Specifies the component generating the event that triggers the validator. If omitted, by default Flex uses the value of the <code>source</code> property. When the <code>trigger</code> dispatches a <code>triggerEvent</code>, validation executes.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "triggerEvent",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Specifies the event that triggers the validation. If omitted, Flex uses the <code>valueCommit</code> event. Flex dispatches the <code>valueCommit</code> event when a user completes data entry into a control. Usually this is when the user removes focus from the component, or when a property value is changed programmatically. If you want a validator to ignore all events, set <code>triggerEvent</code> to the empty string (&quot;&quot;).",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "requiredFieldError",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Error message when a value is missing and the <code>required</code> property is <code>true</code>.",
"tags": [
{ "tagName": "default",
"values": [""This field is required.""]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "addListenerHandler",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Sets up all of the listeners for the <code>valid</code> and <code>invalid</code> events dispatched from the validator. Subclasses of the Validator class should first call the <code>removeListenerHandler()</code> method, and then the <code>addListenerHandler()</code> method if the value of one of their listeners or sources changes. The CreditCardValidator and DateValidator classes use this function internally.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "removeListenerHandler",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Disconnects all of the listeners for the <code>valid</code> and <code>invalid</code> events dispatched from the validator. Subclasses should first call the <code>removeListenerHandler()</code> method and then the <code>addListenerHandler</code> method if the value of one of their listeners or sources changes. The CreditCardValidator and DateValidator classes use this function internally.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "isRealValue",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Returns <code>true</code> if <code>value</code> is not null.",
"tags": [
{ "tagName": "param",
"values": ["value The value to test."]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "return",
"values": ["<code>true</code> if <code>value</code> is not null."]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Boolean",
"params": [{ "name": "value", "type": "Object"}]}
,
{ "type": "method",
"qname": "validate",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Performs validation and optionally notifies the listeners of the result. If null, then the validator uses the <code>source</code> and <code>property</code> properties to determine the value. If you specify this argument, you should also set the <code>listener</code> property to specify the target component for any validation error messages. the validator will notify the listener of the result. containing the results of the validation. For a successful validation, the <code>ValidationResultEvent.results</code> Array property is empty. For a validation failure, the <code>ValidationResultEvent.results</code> Array property contains one ValidationResult object for each field checked by the validator, both for fields that failed the validation and for fields that passed. Examine the <code>ValidationResult.isError</code> property to determine if the field passed or failed the validation.",
"tags": [
{ "tagName": "see",
"values": ["mx.events.ValidationResultEvent", "mx.validators.ValidationResult"]},
{ "tagName": "param",
"values": ["value Optional value to validate.", "suppressEvents If <code>false</code>, then after validation,"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "return",
"values": ["A ValidationResultEvent object"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "mx.events.ValidationResultEvent",
"params": [{ "name": "value", "type": "Object"},
{ "name": "suppressEvents", "type": "Boolean"}]}
,
{ "type": "method",
"qname": "getValueFromSource",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Returns the Object to validate. Subclasses, such as the CreditCardValidator and DateValidator classes, override this method because they need to access the values from multiple subfields.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "return",
"values": ["The Object to validate."]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Object",
"params": []}
,
{ "type": "method",
"qname": "doValidation",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Executes the validation logic of this validator, including validating that a missing or empty value causes a validation error as defined by the value of the <code>required</code> property. <p>If you create a subclass of a validator class, you must override this method. </p> with one ValidationResult object for each field examined by the validator that failed validation.",
"tags": [
{ "tagName": "see",
"values": ["mx.validators.ValidationResult"]},
{ "tagName": "param",
"values": ["value Value to validate."]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "return",
"values": ["For an invalid result, an Array of ValidationResult objects,"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Array",
"params": [{ "name": "value", "type": "Object"}]}
,
{ "type": "method",
"qname": "handleResults",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Returns a ValidationResultEvent from the Array of error results. Internally, this function takes the results from the <code>doValidation()</code> method and puts it into a ValidationResultEvent object. Subclasses, such as the RegExpValidator class, should override this function if they output a subclass of ValidationResultEvent objects, such as the RegExpValidationResult objects, and needs to populate the object with additional information. You never call this function directly, and you should rarely override it.",
"tags": [
{ "tagName": "param",
"values": ["errorResults Array of ValidationResult objects."]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "return",
"values": ["The ValidationResultEvent returned by the <code>validate()</code> method."]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "mx.events.ValidationResultEvent",
"params": [{ "name": "errorResults", "type": "Array"}]}
]
,
"events": [
{ "qname": "valid",
"type": "mx.events.ValidationResultEvent"
,
"description": "Dispatched when validation succeeds.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.ValidationResultEvent.VALID"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "invalid",
"type": "mx.events.ValidationResultEvent"
,
"description": "Dispatched when validation fails.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.ValidationResultEvent.INVALID"]},
{ "tagName": "productversion",
"values": ["Royale 0.9.3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]}]
}