Packageurlkit.rules
Classpublic class UrlValueRule
InheritanceUrlValueRule Inheritance UrlBaseRule Inheritance flash.events.EventDispatcher
SubclassesUrlNavigatorRule

A type of rule element that exposes a value mapped to a specific portion of its URL as determined by its urlFormat and/or urlPattern. When that URL portion changes, the value properties of the associated UrlValueRule also change. Conversely, if a value property of a UrlValueRule is changed by the application, this causes the browser to recalculate the overall URL based on the new value.

Ultimately UrlValueRules (or their subclasses such as UrlNavigatorRules) are the places where parts of the URL are connected to specific pieces of state in the application.

This may be done by setting this rule's stringValue property and listening for "change" events indicating that the browser has changed this property, or more conveniently by specifying the sourceValue property as a dot-delimited binding expression for a scalar String, Number or Boolean property of the current MXML document to be bidirectionally bound to this rule.

The defaultValue property of a UrlValueRule permits the rule to both generate and match an empty URL when its value is equal to some value. This is useful when the rule is typically expected to have some default value and it's not desirable to take up space in the URL with that value. So if defaultValue is set to "foo" and the stringValue of the rule is also "foo", then no URL is generated. Conversely, setting an empty URL into such a rule is permitted, and is considered to be an assignment of the string value "foo".

To create a UrlValueRule which simply matches the empty string and isn't bound to any application state (often useful in situations involving UrlNavigatorRules or alternative choices), set the defaultValue to "".



Public Properties
 PropertyDefined by
  active : Boolean
[read-only]
UrlValueRule
  booleanValue : Boolean
Boolean property providing transparent URL encoding of values.
UrlValueRule
 InheritedcontainerUrl : String
Set the URL for this rule based on some or all of a URL passed in from the containing browser.
UrlBaseRule
  defaultValue : Object
A default value for this rule which is to be mapped to an absent or empty URL value.
UrlValueRule
  doesMatchUrl : Boolean
[read-only]
UrlValueRule
 Inheritedenabled : Boolean
Get the value of the enabled flag, gating whether this rule is ever capable of reflecting or contributing state in the application .
UrlBaseRule
 InheritedmatchUrlBeginning : Boolean
UrlBaseRule
  numberValue : Number
Numeric property providing transparent URL encoding of values
UrlValueRule
 Inheritedparent : IUrlRule
Set the parent rule of this rule.
UrlBaseRule
 Inheritedready : Boolean
Get a flag indicating whether this rule is sufficiently initialized to propagate its browser-determined state to the application.
UrlBaseRule
  sourceValue : String
[write-only] Provides this rule with a dot-delimited binding expression that references a Bindable property accessible from the containing MXML document.
UrlValueRule
  stringValue : String
An application state property that is bidirectionally coupled to the value-related portion of this rule's URL, as determined by its urlPattern and urlFormat properties.
UrlValueRule
 Inheritedtitle : String
Get the title component string associated with this rule, to be used in determining the overall application window title.
UrlBaseRule
 Inheritedurl : String
Get the URL component associated with this rule, representing its encoding of the current application state.
UrlBaseRule
 InheritedurlFormat : String
A string that determines the URL generated by this rule.
UrlBaseRule
 InheritedurlPattern : String
A regular expression that will restrict this rule to only be active for a URL that matches it.
UrlBaseRule
 InheritedurlPatternRegEx : RegExp
UrlBaseRule
Protected Properties
 PropertyDefined by
  defaultStringValue : String
[read-only]
UrlValueRule
 Inherited_document : UIComponent
Document as passed in via IMXMLObject.initialize()
UrlBaseRule
 Inherited_title : String
Storage property for title.
UrlBaseRule
 Inheritedvalid : Boolean
Get a flag indicating
UrlBaseRule
Public Methods
 MethodDefined by
  
UrlValueRule
 Inherited
defaultPatternFromFormat(f:String):String
[static]
UrlBaseRule
 Inherited
exec(url:String):Array
UrlBaseRule
  
initialized(document:Object, id:String):void
UrlValueRule
 Inherited
Invalidate the application state of this rule, which ultimately requests the browser to update its location bar from the top-level rule's URL.
UrlBaseRule
  
matchUrlPrefix(url:String):String
UrlValueRule
Protected Methods
 MethodDefined by
 Inherited
applyUrlFormat(stringValue:String):String
UrlBaseRule
 Inherited
checkReadiness(e:Event):void
Check this rule to determine whether it's ready, setting the ready property to reflect this.
UrlBaseRule
  
Commit a browser change to this rule by altering its string value, subject to parsing determined by the rule's urlFormat and urlPattern properties.
UrlValueRule
  
Compute the application state by encoding this rule's string value as this rule's URL subject to formatting determined by the rule's urlFormat property.
UrlValueRule
  
setObjectValue(o:Object):void
UrlValueRule
  
setRhsSite(o:Object):void
UrlValueRule
  
setupWatcher():void
UrlValueRule
 Inherited
Validate this rule such that its URL and title correspond to the application state, as determined by whatever URL/state mapping this rule defines.
UrlBaseRule
Events
 EventSummaryDefined by
   This event is dispatched when the URL component for this value changes.UrlValueRule
 Inherited This event is dispatched when the URL component for this value changes.UrlBaseRule
Public Constants
 ConstantDefined by
 InheritedSTATE_CHANGE : String = "stateChange"
[static]
UrlBaseRule
Property detail
activeproperty
active:Boolean  [read-only]Implementation
    public function get active():Boolean
booleanValueproperty 
booleanValue:Boolean  [read-write]

Boolean property providing transparent URL encoding of values. Note that for brevity in the URL, the characters 't' and 'f' are used to represent the constants true and false.

This property can be used as the source for data binding.

Implementation
    public function get booleanValue():Boolean
    public function set booleanValue(value:Boolean):void
defaultStringValueproperty 
defaultStringValue:String  [read-only]Implementation
    protected function get defaultStringValue():String
defaultValueproperty 
defaultValue:Object  [read-write]

A default value for this rule which is to be mapped to an absent or empty URL value.

Implementation
    public function get defaultValue():Object
    public function set defaultValue(value:Object):void
doesMatchUrlproperty 
doesMatchUrl:Boolean  [read-only]Implementation
    public function get doesMatchUrl():Boolean
numberValueproperty 
numberValue:Number  [read-write]

Numeric property providing transparent URL encoding of values

This property can be used as the source for data binding.

Implementation
    public function get numberValue():Number
    public function set numberValue(value:Number):void
sourceValueproperty 
sourceValue:String  [write-only]

Provides this rule with a dot-delimited binding expression that references a Bindable property accessible from the containing MXML document. If provided, this rule will automatically listen for change events on that property and trigger the appropriate browser URL changes; it will also apply browser-initiated URL changes by setting this property when necessary.

Implementation
    public function set sourceValue(value:String):void
stringValueproperty 
stringValue:String  [read-write]

An application state property that is bidirectionally coupled to the value-related portion of this rule's URL, as determined by its urlPattern and urlFormat properties.

This property can be used as the source for data binding.

Implementation
    public function get stringValue():String
    public function set stringValue(value:String):void
Constructor detail
UrlValueRule()constructor
public function UrlValueRule()
Method detail
commitBrowserChange()method
protected override function commitBrowserChange():void

Commit a browser change to this rule by altering its string value, subject to parsing determined by the rule's urlFormat and urlPattern properties. If no value was explicitly supplied in the URL then the default value for this rule is used.

computeApplicationState()method 
protected override function computeApplicationState():void

Compute the application state by encoding this rule's string value as this rule's URL subject to formatting determined by the rule's urlFormat property. If the string value equals the defaultStringValue for this rule, then that URL is always computed as the empty string (so that defaulted values do not take up space in the URL).

initialized()method 
public override function initialized(document:Object, id:String):voidParameters
document:Object
 
id:String
matchUrlPrefix()method 
public override function matchUrlPrefix(url:String):StringParameters
url:String

Returns
String
setObjectValue()method 
protected function setObjectValue(o:Object):voidParameters
o:Object
setRhsSite()method 
protected function setRhsSite(o:Object):voidParameters
o:Object
setupWatcher()method 
protected function setupWatcher():void
Event detail
changeevent 
Event object type: flash.events.Event

This event is dispatched when the URL component for this value changes.