blob: 0ec1ee1f3b462e77d27dcee2de01f7893e4de4c1 [file] [log] [blame]
////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
/**
* This is a generated class and is not intended for modification. To customize behavior
* of this value object you may modify the generated sub-class of this class - Employee.as.
*/
package valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;
import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
use namespace model_internal;
[ExcludeClass]
public class _Super_Employee extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
model_internal static function initRemoteClassAliasSingle(cz:Class) : void
{
}
model_internal static function initRemoteClassAliasAllRelated() : void
{
}
model_internal var _dminternal_model : _EmployeeEntityMetadata;
model_internal var _changedObjects:mx.collections.ArrayCollection = new ArrayCollection();
public function getChangedObjects() : Array
{
_changedObjects.addItemAt(this,0);
return _changedObjects.source;
}
public function clearChangedObjects() : void
{
_changedObjects.removeAll();
}
/**
* properties
*/
private var _internal_id : int;
private var _internal_title : String;
private var _internal_lastname : String;
private var _internal_firstname : String;
private var _internal_photofile : String;
private static var emptyArray:Array = new Array();
/**
* derived property cache initialization
*/
model_internal var _cacheInitialized_isValid:Boolean = false;
model_internal var _changeWatcherArray:Array = new Array();
public function _Super_Employee()
{
_model = new _EmployeeEntityMetadata(this);
// Bind to own data or source properties for cache invalidation triggering
model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "title", model_internal::setterListenerTitle));
model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "lastname", model_internal::setterListenerLastname));
model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "firstname", model_internal::setterListenerFirstname));
model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "photofile", model_internal::setterListenerPhotofile));
}
/**
* data/source property getters
*/
[Bindable(event="propertyChange")]
public function get id() : int
{
return _internal_id;
}
[Bindable(event="propertyChange")]
public function get title() : String
{
return _internal_title;
}
[Bindable(event="propertyChange")]
public function get lastname() : String
{
return _internal_lastname;
}
[Bindable(event="propertyChange")]
public function get firstname() : String
{
return _internal_firstname;
}
[Bindable(event="propertyChange")]
public function get photofile() : String
{
return _internal_photofile;
}
public function clearAssociations() : void
{
}
/**
* data/source property setters
*/
public function set id(value:int) : void
{
var oldValue:int = _internal_id;
if (oldValue !== value)
{
_internal_id = value;
this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "id", oldValue, _internal_id));
}
}
public function set title(value:String) : void
{
var oldValue:String = _internal_title;
if (oldValue !== value)
{
_internal_title = value;
this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "title", oldValue, _internal_title));
}
}
public function set lastname(value:String) : void
{
var oldValue:String = _internal_lastname;
if (oldValue !== value)
{
_internal_lastname = value;
this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "lastname", oldValue, _internal_lastname));
}
}
public function set firstname(value:String) : void
{
var oldValue:String = _internal_firstname;
if (oldValue !== value)
{
_internal_firstname = value;
this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "firstname", oldValue, _internal_firstname));
}
}
public function set photofile(value:String) : void
{
var oldValue:String = _internal_photofile;
if (oldValue !== value)
{
_internal_photofile = value;
this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "photofile", oldValue, _internal_photofile));
}
}
/**
* Data/source property setter listeners
*
* Each data property whose value affects other properties or the validity of the entity
* needs to invalidate all previously calculated artifacts. These include:
* - any derived properties or constraints that reference the given data property.
* - any availability guards (variant expressions) that reference the given data property.
* - any style validations, message tokens or guards that reference the given data property.
* - the validity of the property (and the containing entity) if the given data property has a length restriction.
* - the validity of the property (and the containing entity) if the given data property is required.
*/
model_internal function setterListenerTitle(value:flash.events.Event):void
{
_model.invalidateDependentOnTitle();
}
model_internal function setterListenerLastname(value:flash.events.Event):void
{
_model.invalidateDependentOnLastname();
}
model_internal function setterListenerFirstname(value:flash.events.Event):void
{
_model.invalidateDependentOnFirstname();
}
model_internal function setterListenerPhotofile(value:flash.events.Event):void
{
_model.invalidateDependentOnPhotofile();
}
/**
* valid related derived properties
*/
model_internal var _isValid : Boolean;
model_internal var _invalidConstraints:Array = new Array();
model_internal var _validationFailureMessages:Array = new Array();
/**
* derived property calculators
*/
/**
* isValid calculator
*/
model_internal function calculateIsValid():Boolean
{
var violatedConsts:Array = new Array();
var validationFailureMessages:Array = new Array();
var propertyValidity:Boolean = true;
if (!_model.titleIsValid)
{
propertyValidity = false;
com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_titleValidationFailureMessages);
}
if (!_model.lastnameIsValid)
{
propertyValidity = false;
com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_lastnameValidationFailureMessages);
}
if (!_model.firstnameIsValid)
{
propertyValidity = false;
com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_firstnameValidationFailureMessages);
}
if (!_model.photofileIsValid)
{
propertyValidity = false;
com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_photofileValidationFailureMessages);
}
model_internal::_cacheInitialized_isValid = true;
model_internal::invalidConstraints_der = violatedConsts;
model_internal::validationFailureMessages_der = validationFailureMessages;
return violatedConsts.length == 0 && propertyValidity;
}
/**
* derived property setters
*/
model_internal function set isValid_der(value:Boolean) : void
{
var oldValue:Boolean = model_internal::_isValid;
if (oldValue !== value)
{
model_internal::_isValid = value;
_model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
}
}
/**
* derived property getters
*/
[Transient]
[Bindable(event="propertyChange")]
public function get _model() : _EmployeeEntityMetadata
{
return model_internal::_dminternal_model;
}
public function set _model(value : _EmployeeEntityMetadata) : void
{
var oldValue : _EmployeeEntityMetadata = model_internal::_dminternal_model;
if (oldValue !== value)
{
model_internal::_dminternal_model = value;
this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
}
}
/**
* methods
*/
/**
* services
*/
private var _managingService:com.adobe.fiber.services.IFiberManagingService;
public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
{
_managingService = managingService;
}
model_internal function set invalidConstraints_der(value:Array) : void
{
var oldValue:Array = model_internal::_invalidConstraints;
// avoid firing the event when old and new value are different empty arrays
if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
{
model_internal::_invalidConstraints = value;
_model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
}
}
model_internal function set validationFailureMessages_der(value:Array) : void
{
var oldValue:Array = model_internal::_validationFailureMessages;
// avoid firing the event when old and new value are different empty arrays
if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
{
model_internal::_validationFailureMessages = value;
_model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
}
}
model_internal var _doValidationCacheOfTitle : Array = null;
model_internal var _doValidationLastValOfTitle : String;
model_internal function _doValidationForTitle(valueIn:Object):Array
{
var value : String = valueIn as String;
if (model_internal::_doValidationCacheOfTitle != null && model_internal::_doValidationLastValOfTitle == value)
return model_internal::_doValidationCacheOfTitle ;
_model.model_internal::_titleIsValidCacheInitialized = true;
var validationFailures:Array = new Array();
var errorMessage:String;
var failure:Boolean;
var valRes:ValidationResult;
if (_model.isTitleAvailable && _internal_title == null)
{
validationFailures.push(new ValidationResult(true, "", "", "title is required"));
}
model_internal::_doValidationCacheOfTitle = validationFailures;
model_internal::_doValidationLastValOfTitle = value;
return validationFailures;
}
model_internal var _doValidationCacheOfLastname : Array = null;
model_internal var _doValidationLastValOfLastname : String;
model_internal function _doValidationForLastname(valueIn:Object):Array
{
var value : String = valueIn as String;
if (model_internal::_doValidationCacheOfLastname != null && model_internal::_doValidationLastValOfLastname == value)
return model_internal::_doValidationCacheOfLastname ;
_model.model_internal::_lastnameIsValidCacheInitialized = true;
var validationFailures:Array = new Array();
var errorMessage:String;
var failure:Boolean;
var valRes:ValidationResult;
if (_model.isLastnameAvailable && _internal_lastname == null)
{
validationFailures.push(new ValidationResult(true, "", "", "lastname is required"));
}
model_internal::_doValidationCacheOfLastname = validationFailures;
model_internal::_doValidationLastValOfLastname = value;
return validationFailures;
}
model_internal var _doValidationCacheOfFirstname : Array = null;
model_internal var _doValidationLastValOfFirstname : String;
model_internal function _doValidationForFirstname(valueIn:Object):Array
{
var value : String = valueIn as String;
if (model_internal::_doValidationCacheOfFirstname != null && model_internal::_doValidationLastValOfFirstname == value)
return model_internal::_doValidationCacheOfFirstname ;
_model.model_internal::_firstnameIsValidCacheInitialized = true;
var validationFailures:Array = new Array();
var errorMessage:String;
var failure:Boolean;
var valRes:ValidationResult;
if (_model.isFirstnameAvailable && _internal_firstname == null)
{
validationFailures.push(new ValidationResult(true, "", "", "firstname is required"));
}
model_internal::_doValidationCacheOfFirstname = validationFailures;
model_internal::_doValidationLastValOfFirstname = value;
return validationFailures;
}
model_internal var _doValidationCacheOfPhotofile : Array = null;
model_internal var _doValidationLastValOfPhotofile : String;
model_internal function _doValidationForPhotofile(valueIn:Object):Array
{
var value : String = valueIn as String;
if (model_internal::_doValidationCacheOfPhotofile != null && model_internal::_doValidationLastValOfPhotofile == value)
return model_internal::_doValidationCacheOfPhotofile ;
_model.model_internal::_photofileIsValidCacheInitialized = true;
var validationFailures:Array = new Array();
var errorMessage:String;
var failure:Boolean;
var valRes:ValidationResult;
if (_model.isPhotofileAvailable && _internal_photofile == null)
{
validationFailures.push(new ValidationResult(true, "", "", "photofile is required"));
}
model_internal::_doValidationCacheOfPhotofile = validationFailures;
model_internal::_doValidationLastValOfPhotofile = value;
return validationFailures;
}
}
}