/**
 * This is a generated class and is not intended for modification.  
 */
package com.sharewithagent.services.valueObject
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]internal class _AgentContactEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("address", "address2", "agentId", "city", "distanceFromCoordinatesUsedToLocate", "emailAddress", "firstName", "languages", "lastName", "middleInitial", "officeId", "phoneNumber", "state", "zip", "zipPlus4");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("address", "address2", "agentId", "city", "distanceFromCoordinatesUsedToLocate", "emailAddress", "firstName", "languages", "lastName", "middleInitial", "officeId", "phoneNumber", "state", "zip", "zipPlus4");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("address", "address2", "agentId", "city", "distanceFromCoordinatesUsedToLocate", "emailAddress", "firstName", "languages", "lastName", "middleInitial", "officeId", "phoneNumber", "state", "zip", "zipPlus4");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("address", "address2", "agentId", "city", "distanceFromCoordinatesUsedToLocate", "emailAddress", "firstName", "languages", "lastName", "middleInitial", "officeId", "phoneNumber", "state", "zip", "zipPlus4");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array("languages");
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "AgentContact";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();

    
    model_internal var _addressIsValid:Boolean;
    model_internal var _addressValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _addressIsValidCacheInitialized:Boolean = false;
    model_internal var _addressValidationFailureMessages:Array;
    
    model_internal var _address2IsValid:Boolean;
    model_internal var _address2Validator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _address2IsValidCacheInitialized:Boolean = false;
    model_internal var _address2ValidationFailureMessages:Array;
    
    model_internal var _agentIdIsValid:Boolean;
    model_internal var _agentIdValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _agentIdIsValidCacheInitialized:Boolean = false;
    model_internal var _agentIdValidationFailureMessages:Array;
    
    model_internal var _cityIsValid:Boolean;
    model_internal var _cityValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _cityIsValidCacheInitialized:Boolean = false;
    model_internal var _cityValidationFailureMessages:Array;
    
    model_internal var _emailAddressIsValid:Boolean;
    model_internal var _emailAddressValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _emailAddressIsValidCacheInitialized:Boolean = false;
    model_internal var _emailAddressValidationFailureMessages:Array;
    
    model_internal var _firstNameIsValid:Boolean;
    model_internal var _firstNameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _firstNameIsValidCacheInitialized:Boolean = false;
    model_internal var _firstNameValidationFailureMessages:Array;
    
    model_internal var _languagesIsValid:Boolean;
    model_internal var _languagesValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _languagesIsValidCacheInitialized:Boolean = false;
    model_internal var _languagesValidationFailureMessages:Array;
    
    model_internal var _lastNameIsValid:Boolean;
    model_internal var _lastNameValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _lastNameIsValidCacheInitialized:Boolean = false;
    model_internal var _lastNameValidationFailureMessages:Array;
    
    model_internal var _middleInitialIsValid:Boolean;
    model_internal var _middleInitialValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _middleInitialIsValidCacheInitialized:Boolean = false;
    model_internal var _middleInitialValidationFailureMessages:Array;
    
    model_internal var _officeIdIsValid:Boolean;
    model_internal var _officeIdValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _officeIdIsValidCacheInitialized:Boolean = false;
    model_internal var _officeIdValidationFailureMessages:Array;
    
    model_internal var _phoneNumberIsValid:Boolean;
    model_internal var _phoneNumberValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _phoneNumberIsValidCacheInitialized:Boolean = false;
    model_internal var _phoneNumberValidationFailureMessages:Array;
    
    model_internal var _stateIsValid:Boolean;
    model_internal var _stateValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _stateIsValidCacheInitialized:Boolean = false;
    model_internal var _stateValidationFailureMessages:Array;
    
    model_internal var _zipIsValid:Boolean;
    model_internal var _zipValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _zipIsValidCacheInitialized:Boolean = false;
    model_internal var _zipValidationFailureMessages:Array;
    
    model_internal var _zipPlus4IsValid:Boolean;
    model_internal var _zipPlus4Validator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _zipPlus4IsValidCacheInitialized:Boolean = false;
    model_internal var _zipPlus4ValidationFailureMessages:Array;

    model_internal var _instance:_Super_AgentContact;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _AgentContactEntityMetadata(value : _Super_AgentContact)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // depenents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["address"] = new Array();
            model_internal::dependentsOnMap["address2"] = new Array();
            model_internal::dependentsOnMap["agentId"] = new Array();
            model_internal::dependentsOnMap["city"] = new Array();
            model_internal::dependentsOnMap["distanceFromCoordinatesUsedToLocate"] = new Array();
            model_internal::dependentsOnMap["emailAddress"] = new Array();
            model_internal::dependentsOnMap["firstName"] = new Array();
            model_internal::dependentsOnMap["languages"] = new Array();
            model_internal::dependentsOnMap["lastName"] = new Array();
            model_internal::dependentsOnMap["middleInitial"] = new Array();
            model_internal::dependentsOnMap["officeId"] = new Array();
            model_internal::dependentsOnMap["phoneNumber"] = new Array();
            model_internal::dependentsOnMap["state"] = new Array();
            model_internal::dependentsOnMap["zip"] = new Array();
            model_internal::dependentsOnMap["zipPlus4"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object()
            model_internal::collectionBaseMap["languages"] = "String";
        }

        model_internal::_instance = value;
        model_internal::_addressValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForAddress);
        model_internal::_addressValidator.required = true;
        model_internal::_addressValidator.requiredFieldError = "address is required";
        //model_internal::_addressValidator.source = model_internal::_instance;
        //model_internal::_addressValidator.property = "address";
        model_internal::_address2Validator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForAddress2);
        model_internal::_address2Validator.required = true;
        model_internal::_address2Validator.requiredFieldError = "address2 is required";
        //model_internal::_address2Validator.source = model_internal::_instance;
        //model_internal::_address2Validator.property = "address2";
        model_internal::_agentIdValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForAgentId);
        model_internal::_agentIdValidator.required = true;
        model_internal::_agentIdValidator.requiredFieldError = "agentId is required";
        //model_internal::_agentIdValidator.source = model_internal::_instance;
        //model_internal::_agentIdValidator.property = "agentId";
        model_internal::_cityValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForCity);
        model_internal::_cityValidator.required = true;
        model_internal::_cityValidator.requiredFieldError = "city is required";
        //model_internal::_cityValidator.source = model_internal::_instance;
        //model_internal::_cityValidator.property = "city";
        model_internal::_emailAddressValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForEmailAddress);
        model_internal::_emailAddressValidator.required = true;
        model_internal::_emailAddressValidator.requiredFieldError = "emailAddress is required";
        //model_internal::_emailAddressValidator.source = model_internal::_instance;
        //model_internal::_emailAddressValidator.property = "emailAddress";
        model_internal::_firstNameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForFirstName);
        model_internal::_firstNameValidator.required = true;
        model_internal::_firstNameValidator.requiredFieldError = "firstName is required";
        //model_internal::_firstNameValidator.source = model_internal::_instance;
        //model_internal::_firstNameValidator.property = "firstName";
        model_internal::_languagesValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForLanguages);
        model_internal::_languagesValidator.required = true;
        model_internal::_languagesValidator.requiredFieldError = "languages is required";
        //model_internal::_languagesValidator.source = model_internal::_instance;
        //model_internal::_languagesValidator.property = "languages";
        model_internal::_lastNameValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForLastName);
        model_internal::_lastNameValidator.required = true;
        model_internal::_lastNameValidator.requiredFieldError = "lastName is required";
        //model_internal::_lastNameValidator.source = model_internal::_instance;
        //model_internal::_lastNameValidator.property = "lastName";
        model_internal::_middleInitialValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForMiddleInitial);
        model_internal::_middleInitialValidator.required = true;
        model_internal::_middleInitialValidator.requiredFieldError = "middleInitial is required";
        //model_internal::_middleInitialValidator.source = model_internal::_instance;
        //model_internal::_middleInitialValidator.property = "middleInitial";
        model_internal::_officeIdValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForOfficeId);
        model_internal::_officeIdValidator.required = true;
        model_internal::_officeIdValidator.requiredFieldError = "officeId is required";
        //model_internal::_officeIdValidator.source = model_internal::_instance;
        //model_internal::_officeIdValidator.property = "officeId";
        model_internal::_phoneNumberValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPhoneNumber);
        model_internal::_phoneNumberValidator.required = true;
        model_internal::_phoneNumberValidator.requiredFieldError = "phoneNumber is required";
        //model_internal::_phoneNumberValidator.source = model_internal::_instance;
        //model_internal::_phoneNumberValidator.property = "phoneNumber";
        model_internal::_stateValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForState);
        model_internal::_stateValidator.required = true;
        model_internal::_stateValidator.requiredFieldError = "state is required";
        //model_internal::_stateValidator.source = model_internal::_instance;
        //model_internal::_stateValidator.property = "state";
        model_internal::_zipValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForZip);
        model_internal::_zipValidator.required = true;
        model_internal::_zipValidator.requiredFieldError = "zip is required";
        //model_internal::_zipValidator.source = model_internal::_instance;
        //model_internal::_zipValidator.property = "zip";
        model_internal::_zipPlus4Validator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForZipPlus4);
        model_internal::_zipPlus4Validator.required = true;
        model_internal::_zipPlus4Validator.requiredFieldError = "zipPlus4 is required";
        //model_internal::_zipPlus4Validator.source = model_internal::_instance;
        //model_internal::_zipPlus4Validator.property = "zipPlus4";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::dataProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity AgentContact");  
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity AgentContact");  

        return model_internal::collectionBaseMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity AgentContact");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::dataProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a data property of entity AgentContact");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity AgentContact");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable("propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable("propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable("propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable("propertyChange")]
    public function get isAddressAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isAddress2Available():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isAgentIdAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isCityAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isDistanceFromCoordinatesUsedToLocateAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isEmailAddressAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isFirstNameAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isLanguagesAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isLastNameAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isMiddleInitialAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isOfficeIdAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isPhoneNumberAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isStateAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isZipAvailable():Boolean
    {
        return true;
    }

    [Bindable("propertyChange")]
    public function get isZipPlus4Available():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnAddress():void
    {
        if (model_internal::_addressIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfAddress = null;
            model_internal::calculateAddressIsValid();
        }
    }
    public function invalidateDependentOnAddress2():void
    {
        if (model_internal::_address2IsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfAddress2 = null;
            model_internal::calculateAddress2IsValid();
        }
    }
    public function invalidateDependentOnAgentId():void
    {
        if (model_internal::_agentIdIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfAgentId = null;
            model_internal::calculateAgentIdIsValid();
        }
    }
    public function invalidateDependentOnCity():void
    {
        if (model_internal::_cityIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfCity = null;
            model_internal::calculateCityIsValid();
        }
    }
    public function invalidateDependentOnEmailAddress():void
    {
        if (model_internal::_emailAddressIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfEmailAddress = null;
            model_internal::calculateEmailAddressIsValid();
        }
    }
    public function invalidateDependentOnFirstName():void
    {
        if (model_internal::_firstNameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfFirstName = null;
            model_internal::calculateFirstNameIsValid();
        }
    }
    public function invalidateDependentOnLanguages():void
    {
        if (model_internal::_languagesIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfLanguages = null;
            model_internal::calculateLanguagesIsValid();
        }
    }
    public function invalidateDependentOnLastName():void
    {
        if (model_internal::_lastNameIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfLastName = null;
            model_internal::calculateLastNameIsValid();
        }
    }
    public function invalidateDependentOnMiddleInitial():void
    {
        if (model_internal::_middleInitialIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfMiddleInitial = null;
            model_internal::calculateMiddleInitialIsValid();
        }
    }
    public function invalidateDependentOnOfficeId():void
    {
        if (model_internal::_officeIdIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfOfficeId = null;
            model_internal::calculateOfficeIdIsValid();
        }
    }
    public function invalidateDependentOnPhoneNumber():void
    {
        if (model_internal::_phoneNumberIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfPhoneNumber = null;
            model_internal::calculatePhoneNumberIsValid();
        }
    }
    public function invalidateDependentOnState():void
    {
        if (model_internal::_stateIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfState = null;
            model_internal::calculateStateIsValid();
        }
    }
    public function invalidateDependentOnZip():void
    {
        if (model_internal::_zipIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfZip = null;
            model_internal::calculateZipIsValid();
        }
    }
    public function invalidateDependentOnZipPlus4():void
    {
        if (model_internal::_zipPlus4IsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfZipPlus4 = null;
            model_internal::calculateZipPlus4IsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable("propertyChange")]   
    public function get addressStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get addressValidator() : StyleValidator
    {
        return model_internal::_addressValidator;
    }

    model_internal function set _addressIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_addressIsValid;         
        if (oldValue !== value)
        {
            model_internal::_addressIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "addressIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get addressIsValid():Boolean
    {
        if (!model_internal::_addressIsValidCacheInitialized)
        {
            model_internal::calculateAddressIsValid();
        }

        return model_internal::_addressIsValid;
    }

    model_internal function calculateAddressIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_addressValidator.validate(model_internal::_instance.address)
        model_internal::_addressIsValid_der = (valRes.results == null);
        model_internal::_addressIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::addressValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::addressValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get addressValidationFailureMessages():Array
    {
        if (model_internal::_addressValidationFailureMessages == null)
            model_internal::calculateAddressIsValid();

        return _addressValidationFailureMessages;
    }

    model_internal function set addressValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_addressValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_addressValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "addressValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get address2Style():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get address2Validator() : StyleValidator
    {
        return model_internal::_address2Validator;
    }

    model_internal function set _address2IsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_address2IsValid;         
        if (oldValue !== value)
        {
            model_internal::_address2IsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "address2IsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get address2IsValid():Boolean
    {
        if (!model_internal::_address2IsValidCacheInitialized)
        {
            model_internal::calculateAddress2IsValid();
        }

        return model_internal::_address2IsValid;
    }

    model_internal function calculateAddress2IsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_address2Validator.validate(model_internal::_instance.address2)
        model_internal::_address2IsValid_der = (valRes.results == null);
        model_internal::_address2IsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::address2ValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::address2ValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get address2ValidationFailureMessages():Array
    {
        if (model_internal::_address2ValidationFailureMessages == null)
            model_internal::calculateAddress2IsValid();

        return _address2ValidationFailureMessages;
    }

    model_internal function set address2ValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_address2ValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_address2ValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "address2ValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get agentIdStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get agentIdValidator() : StyleValidator
    {
        return model_internal::_agentIdValidator;
    }

    model_internal function set _agentIdIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_agentIdIsValid;         
        if (oldValue !== value)
        {
            model_internal::_agentIdIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "agentIdIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get agentIdIsValid():Boolean
    {
        if (!model_internal::_agentIdIsValidCacheInitialized)
        {
            model_internal::calculateAgentIdIsValid();
        }

        return model_internal::_agentIdIsValid;
    }

    model_internal function calculateAgentIdIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_agentIdValidator.validate(model_internal::_instance.agentId)
        model_internal::_agentIdIsValid_der = (valRes.results == null);
        model_internal::_agentIdIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::agentIdValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::agentIdValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get agentIdValidationFailureMessages():Array
    {
        if (model_internal::_agentIdValidationFailureMessages == null)
            model_internal::calculateAgentIdIsValid();

        return _agentIdValidationFailureMessages;
    }

    model_internal function set agentIdValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_agentIdValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_agentIdValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "agentIdValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get cityStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get cityValidator() : StyleValidator
    {
        return model_internal::_cityValidator;
    }

    model_internal function set _cityIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_cityIsValid;         
        if (oldValue !== value)
        {
            model_internal::_cityIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cityIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get cityIsValid():Boolean
    {
        if (!model_internal::_cityIsValidCacheInitialized)
        {
            model_internal::calculateCityIsValid();
        }

        return model_internal::_cityIsValid;
    }

    model_internal function calculateCityIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_cityValidator.validate(model_internal::_instance.city)
        model_internal::_cityIsValid_der = (valRes.results == null);
        model_internal::_cityIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::cityValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::cityValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get cityValidationFailureMessages():Array
    {
        if (model_internal::_cityValidationFailureMessages == null)
            model_internal::calculateCityIsValid();

        return _cityValidationFailureMessages;
    }

    model_internal function set cityValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_cityValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_cityValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cityValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get distanceFromCoordinatesUsedToLocateStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable("propertyChange")]   
    public function get emailAddressStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get emailAddressValidator() : StyleValidator
    {
        return model_internal::_emailAddressValidator;
    }

    model_internal function set _emailAddressIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_emailAddressIsValid;         
        if (oldValue !== value)
        {
            model_internal::_emailAddressIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "emailAddressIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get emailAddressIsValid():Boolean
    {
        if (!model_internal::_emailAddressIsValidCacheInitialized)
        {
            model_internal::calculateEmailAddressIsValid();
        }

        return model_internal::_emailAddressIsValid;
    }

    model_internal function calculateEmailAddressIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_emailAddressValidator.validate(model_internal::_instance.emailAddress)
        model_internal::_emailAddressIsValid_der = (valRes.results == null);
        model_internal::_emailAddressIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::emailAddressValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::emailAddressValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get emailAddressValidationFailureMessages():Array
    {
        if (model_internal::_emailAddressValidationFailureMessages == null)
            model_internal::calculateEmailAddressIsValid();

        return _emailAddressValidationFailureMessages;
    }

    model_internal function set emailAddressValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_emailAddressValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_emailAddressValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "emailAddressValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get firstNameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get firstNameValidator() : StyleValidator
    {
        return model_internal::_firstNameValidator;
    }

    model_internal function set _firstNameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_firstNameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_firstNameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "firstNameIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get firstNameIsValid():Boolean
    {
        if (!model_internal::_firstNameIsValidCacheInitialized)
        {
            model_internal::calculateFirstNameIsValid();
        }

        return model_internal::_firstNameIsValid;
    }

    model_internal function calculateFirstNameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_firstNameValidator.validate(model_internal::_instance.firstName)
        model_internal::_firstNameIsValid_der = (valRes.results == null);
        model_internal::_firstNameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::firstNameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::firstNameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get firstNameValidationFailureMessages():Array
    {
        if (model_internal::_firstNameValidationFailureMessages == null)
            model_internal::calculateFirstNameIsValid();

        return _firstNameValidationFailureMessages;
    }

    model_internal function set firstNameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_firstNameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_firstNameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "firstNameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get languagesStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get languagesValidator() : StyleValidator
    {
        return model_internal::_languagesValidator;
    }

    model_internal function set _languagesIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_languagesIsValid;         
        if (oldValue !== value)
        {
            model_internal::_languagesIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "languagesIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get languagesIsValid():Boolean
    {
        if (!model_internal::_languagesIsValidCacheInitialized)
        {
            model_internal::calculateLanguagesIsValid();
        }

        return model_internal::_languagesIsValid;
    }

    model_internal function calculateLanguagesIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_languagesValidator.validate(model_internal::_instance.languages)
        model_internal::_languagesIsValid_der = (valRes.results == null);
        model_internal::_languagesIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::languagesValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::languagesValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get languagesValidationFailureMessages():Array
    {
        if (model_internal::_languagesValidationFailureMessages == null)
            model_internal::calculateLanguagesIsValid();

        return _languagesValidationFailureMessages;
    }

    model_internal function set languagesValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_languagesValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_languagesValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "languagesValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get lastNameStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get lastNameValidator() : StyleValidator
    {
        return model_internal::_lastNameValidator;
    }

    model_internal function set _lastNameIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_lastNameIsValid;         
        if (oldValue !== value)
        {
            model_internal::_lastNameIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "lastNameIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get lastNameIsValid():Boolean
    {
        if (!model_internal::_lastNameIsValidCacheInitialized)
        {
            model_internal::calculateLastNameIsValid();
        }

        return model_internal::_lastNameIsValid;
    }

    model_internal function calculateLastNameIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_lastNameValidator.validate(model_internal::_instance.lastName)
        model_internal::_lastNameIsValid_der = (valRes.results == null);
        model_internal::_lastNameIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::lastNameValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::lastNameValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get lastNameValidationFailureMessages():Array
    {
        if (model_internal::_lastNameValidationFailureMessages == null)
            model_internal::calculateLastNameIsValid();

        return _lastNameValidationFailureMessages;
    }

    model_internal function set lastNameValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_lastNameValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_lastNameValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "lastNameValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get middleInitialStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get middleInitialValidator() : StyleValidator
    {
        return model_internal::_middleInitialValidator;
    }

    model_internal function set _middleInitialIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_middleInitialIsValid;         
        if (oldValue !== value)
        {
            model_internal::_middleInitialIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "middleInitialIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get middleInitialIsValid():Boolean
    {
        if (!model_internal::_middleInitialIsValidCacheInitialized)
        {
            model_internal::calculateMiddleInitialIsValid();
        }

        return model_internal::_middleInitialIsValid;
    }

    model_internal function calculateMiddleInitialIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_middleInitialValidator.validate(model_internal::_instance.middleInitial)
        model_internal::_middleInitialIsValid_der = (valRes.results == null);
        model_internal::_middleInitialIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::middleInitialValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::middleInitialValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get middleInitialValidationFailureMessages():Array
    {
        if (model_internal::_middleInitialValidationFailureMessages == null)
            model_internal::calculateMiddleInitialIsValid();

        return _middleInitialValidationFailureMessages;
    }

    model_internal function set middleInitialValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_middleInitialValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_middleInitialValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "middleInitialValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get officeIdStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get officeIdValidator() : StyleValidator
    {
        return model_internal::_officeIdValidator;
    }

    model_internal function set _officeIdIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_officeIdIsValid;         
        if (oldValue !== value)
        {
            model_internal::_officeIdIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "officeIdIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get officeIdIsValid():Boolean
    {
        if (!model_internal::_officeIdIsValidCacheInitialized)
        {
            model_internal::calculateOfficeIdIsValid();
        }

        return model_internal::_officeIdIsValid;
    }

    model_internal function calculateOfficeIdIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_officeIdValidator.validate(model_internal::_instance.officeId)
        model_internal::_officeIdIsValid_der = (valRes.results == null);
        model_internal::_officeIdIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::officeIdValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::officeIdValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get officeIdValidationFailureMessages():Array
    {
        if (model_internal::_officeIdValidationFailureMessages == null)
            model_internal::calculateOfficeIdIsValid();

        return _officeIdValidationFailureMessages;
    }

    model_internal function set officeIdValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_officeIdValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_officeIdValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "officeIdValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get phoneNumberStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get phoneNumberValidator() : StyleValidator
    {
        return model_internal::_phoneNumberValidator;
    }

    model_internal function set _phoneNumberIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_phoneNumberIsValid;         
        if (oldValue !== value)
        {
            model_internal::_phoneNumberIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phoneNumberIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get phoneNumberIsValid():Boolean
    {
        if (!model_internal::_phoneNumberIsValidCacheInitialized)
        {
            model_internal::calculatePhoneNumberIsValid();
        }

        return model_internal::_phoneNumberIsValid;
    }

    model_internal function calculatePhoneNumberIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_phoneNumberValidator.validate(model_internal::_instance.phoneNumber)
        model_internal::_phoneNumberIsValid_der = (valRes.results == null);
        model_internal::_phoneNumberIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::phoneNumberValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::phoneNumberValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get phoneNumberValidationFailureMessages():Array
    {
        if (model_internal::_phoneNumberValidationFailureMessages == null)
            model_internal::calculatePhoneNumberIsValid();

        return _phoneNumberValidationFailureMessages;
    }

    model_internal function set phoneNumberValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_phoneNumberValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_phoneNumberValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "phoneNumberValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get stateStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get stateValidator() : StyleValidator
    {
        return model_internal::_stateValidator;
    }

    model_internal function set _stateIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_stateIsValid;         
        if (oldValue !== value)
        {
            model_internal::_stateIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "stateIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get stateIsValid():Boolean
    {
        if (!model_internal::_stateIsValidCacheInitialized)
        {
            model_internal::calculateStateIsValid();
        }

        return model_internal::_stateIsValid;
    }

    model_internal function calculateStateIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_stateValidator.validate(model_internal::_instance.state)
        model_internal::_stateIsValid_der = (valRes.results == null);
        model_internal::_stateIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::stateValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::stateValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get stateValidationFailureMessages():Array
    {
        if (model_internal::_stateValidationFailureMessages == null)
            model_internal::calculateStateIsValid();

        return _stateValidationFailureMessages;
    }

    model_internal function set stateValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_stateValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_stateValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "stateValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get zipStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get zipValidator() : StyleValidator
    {
        return model_internal::_zipValidator;
    }

    model_internal function set _zipIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_zipIsValid;         
        if (oldValue !== value)
        {
            model_internal::_zipIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "zipIsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get zipIsValid():Boolean
    {
        if (!model_internal::_zipIsValidCacheInitialized)
        {
            model_internal::calculateZipIsValid();
        }

        return model_internal::_zipIsValid;
    }

    model_internal function calculateZipIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_zipValidator.validate(model_internal::_instance.zip)
        model_internal::_zipIsValid_der = (valRes.results == null);
        model_internal::_zipIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::zipValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::zipValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get zipValidationFailureMessages():Array
    {
        if (model_internal::_zipValidationFailureMessages == null)
            model_internal::calculateZipIsValid();

        return _zipValidationFailureMessages;
    }

    model_internal function set zipValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_zipValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_zipValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "zipValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable("propertyChange")]   
    public function get zipPlus4Style():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get zipPlus4Validator() : StyleValidator
    {
        return model_internal::_zipPlus4Validator;
    }

    model_internal function set _zipPlus4IsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_zipPlus4IsValid;         
        if (oldValue !== value)
        {
            model_internal::_zipPlus4IsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "zipPlus4IsValid", oldValue, value));
        }                             
    }

    [Bindable("propertyChange")]
    public function get zipPlus4IsValid():Boolean
    {
        if (!model_internal::_zipPlus4IsValidCacheInitialized)
        {
            model_internal::calculateZipPlus4IsValid();
        }

        return model_internal::_zipPlus4IsValid;
    }

    model_internal function calculateZipPlus4IsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_zipPlus4Validator.validate(model_internal::_instance.zipPlus4)
        model_internal::_zipPlus4IsValid_der = (valRes.results == null);
        model_internal::_zipPlus4IsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::zipPlus4ValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::zipPlus4ValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable("propertyChange")]
    public function get zipPlus4ValidationFailureMessages():Array
    {
        if (model_internal::_zipPlus4ValidationFailureMessages == null)
            model_internal::calculateZipPlus4IsValid();

        return _zipPlus4ValidationFailureMessages;
    }

    model_internal function set zipPlus4ValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_zipPlus4ValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_zipPlus4ValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "zipPlus4ValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("address"):
            {
                return addressValidationFailureMessages;
            }
            case("address2"):
            {
                return address2ValidationFailureMessages;
            }
            case("agentId"):
            {
                return agentIdValidationFailureMessages;
            }
            case("city"):
            {
                return cityValidationFailureMessages;
            }
            case("emailAddress"):
            {
                return emailAddressValidationFailureMessages;
            }
            case("firstName"):
            {
                return firstNameValidationFailureMessages;
            }
            case("languages"):
            {
                return languagesValidationFailureMessages;
            }
            case("lastName"):
            {
                return lastNameValidationFailureMessages;
            }
            case("middleInitial"):
            {
                return middleInitialValidationFailureMessages;
            }
            case("officeId"):
            {
                return officeIdValidationFailureMessages;
            }
            case("phoneNumber"):
            {
                return phoneNumberValidationFailureMessages;
            }
            case("state"):
            {
                return stateValidationFailureMessages;
            }
            case("zip"):
            {
                return zipValidationFailureMessages;
            }
            case("zipPlus4"):
            {
                return zipPlus4ValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}