/** * This is a generated class and is not intended for modification. */ package it.ht.rcs.console.agent.model { 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 _FileSystemItemEntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata { private static var emptyArray:Array = new Array(); model_internal static var allProperties:Array = new Array("_id", "path", "created_at", "sent_at", "depth"); model_internal static var allAssociationProperties:Array = new Array(); model_internal static var allRequiredProperties:Array = new Array("_id", "path", "created_at", "sent_at", "depth"); model_internal static var allAlwaysAvailableProperties:Array = new Array("_id", "path", "created_at", "sent_at", "depth"); model_internal static var guardedProperties:Array = new Array(); model_internal static var dataProperties:Array = new Array("_id", "path", "created_at", "sent_at", "depth"); model_internal static var sourceProperties:Array = emptyArray model_internal static var nonDerivedProperties:Array = new Array("_id", "path", "created_at", "sent_at", "depth"); model_internal static var derivedProperties:Array = new Array(); model_internal static var collectionProperties:Array = new Array(); model_internal static var collectionBaseMap:Object; model_internal static var entityName:String = "FileSystemItem"; model_internal static var dependentsOnMap:Object; model_internal static var dependedOnServices:Array = new Array(); model_internal static var propertyTypeMap:Object; model_internal var __idIsValid:Boolean; model_internal var __idValidator:com.adobe.fiber.styles.StyleValidator; model_internal var __idIsValidCacheInitialized:Boolean = false; model_internal var __idValidationFailureMessages:Array; model_internal var _pathIsValid:Boolean; model_internal var _pathValidator:com.adobe.fiber.styles.StyleValidator; model_internal var _pathIsValidCacheInitialized:Boolean = false; model_internal var _pathValidationFailureMessages:Array; model_internal var _instance:_Super_FileSystemItem; model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style(); public function _FileSystemItemEntityMetadata(value : _Super_FileSystemItem) { // initialize property maps if (model_internal::dependentsOnMap == null) { // dependents map model_internal::dependentsOnMap = new Object(); model_internal::dependentsOnMap["_id"] = new Array(); model_internal::dependentsOnMap["path"] = new Array(); model_internal::dependentsOnMap["created_at"] = new Array(); model_internal::dependentsOnMap["sent_at"] = new Array(); model_internal::dependentsOnMap["depth"] = new Array(); // collection base map model_internal::collectionBaseMap = new Object(); } // Property type Map model_internal::propertyTypeMap = new Object(); model_internal::propertyTypeMap["_id"] = "String"; model_internal::propertyTypeMap["path"] = "String"; model_internal::propertyTypeMap["created_at"] = "int"; model_internal::propertyTypeMap["sent_at"] = "int"; model_internal::propertyTypeMap["depth"] = "int"; model_internal::_instance = value; model_internal::__idValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationFor_id); model_internal::__idValidator.required = true; model_internal::__idValidator.requiredFieldError = "_id is required"; //model_internal::__idValidator.source = model_internal::_instance; //model_internal::__idValidator.property = "_id"; model_internal::_pathValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForPath); model_internal::_pathValidator.required = true; model_internal::_pathValidator.requiredFieldError = "path is required"; //model_internal::_pathValidator.source = model_internal::_instance; //model_internal::_pathValidator.property = "path"; } 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; } public function getSourceProperties():Array { return model_internal::sourceProperties; } public function getNonDerivedProperties():Array { return model_internal::nonDerivedProperties; } 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::nonDerivedProperties.indexOf(propertyName) == -1) throw new Error(propertyName + " is not a data property of entity FileSystemItem"); 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 FileSystemItem"); return model_internal::collectionBaseMap[propertyName]; } override public function getPropertyType(propertyName:String):String { if (model_internal::allProperties.indexOf(propertyName) == -1) throw new Error(propertyName + " is not a property of FileSystemItem"); return model_internal::propertyTypeMap[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 FileSystemItem"); } return model_internal::_instance[propertyName]; } override public function setValue(propertyName:String, value:*):void { if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1) { throw new Error(propertyName + " is not a modifiable property of entity FileSystemItem"); } 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 FileSystemItem"); } 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(event="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(event="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(event="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(event="propertyChange")] public function get is_idAvailable():Boolean { return true; } [Bindable(event="propertyChange")] public function get isPathAvailable():Boolean { return true; } [Bindable(event="propertyChange")] public function get isCreated_atAvailable():Boolean { return true; } [Bindable(event="propertyChange")] public function get isSent_atAvailable():Boolean { return true; } [Bindable(event="propertyChange")] public function get isDepthAvailable():Boolean { return true; } /** * derived property recalculation */ public function invalidateDependentOn_id():void { if (model_internal::__idIsValidCacheInitialized ) { model_internal::_instance.model_internal::_doValidationCacheOf_id = null; model_internal::calculate_idIsValid(); } } public function invalidateDependentOnPath():void { if (model_internal::_pathIsValidCacheInitialized ) { model_internal::_instance.model_internal::_doValidationCacheOfPath = null; model_internal::calculatePathIsValid(); } } model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void { this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue)); } [Bindable(event="propertyChange")] public function get _idStyle():com.adobe.fiber.styles.Style { return model_internal::_nullStyle; } public function get _idValidator() : StyleValidator { return model_internal::__idValidator; } model_internal function set __idIsValid_der(value:Boolean):void { var oldValue:Boolean = model_internal::__idIsValid; if (oldValue !== value) { model_internal::__idIsValid = value; this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_idIsValid", oldValue, value)); } } [Bindable(event="propertyChange")] public function get _idIsValid():Boolean { if (!model_internal::__idIsValidCacheInitialized) { model_internal::calculate_idIsValid(); } return model_internal::__idIsValid; } model_internal function calculate_idIsValid():void { var valRes:ValidationResultEvent = model_internal::__idValidator.validate(model_internal::_instance._id) model_internal::__idIsValid_der = (valRes.results == null); model_internal::__idIsValidCacheInitialized = true; if (valRes.results == null) model_internal::_idValidationFailureMessages_der = emptyArray; else { var _valFailures:Array = new Array(); for (var a:int = 0 ; a 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::__idValidationFailureMessages = value; this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_idValidationFailureMessages", 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(event="propertyChange")] public function get pathStyle():com.adobe.fiber.styles.Style { return model_internal::_nullStyle; } public function get pathValidator() : StyleValidator { return model_internal::_pathValidator; } model_internal function set _pathIsValid_der(value:Boolean):void { var oldValue:Boolean = model_internal::_pathIsValid; if (oldValue !== value) { model_internal::_pathIsValid = value; this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pathIsValid", oldValue, value)); } } [Bindable(event="propertyChange")] public function get pathIsValid():Boolean { if (!model_internal::_pathIsValidCacheInitialized) { model_internal::calculatePathIsValid(); } return model_internal::_pathIsValid; } model_internal function calculatePathIsValid():void { var valRes:ValidationResultEvent = model_internal::_pathValidator.validate(model_internal::_instance.path) model_internal::_pathIsValid_der = (valRes.results == null); model_internal::_pathIsValidCacheInitialized = true; if (valRes.results == null) model_internal::pathValidationFailureMessages_der = emptyArray; else { var _valFailures:Array = new Array(); for (var a:int = 0 ; a 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::_pathValidationFailureMessages = value; this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pathValidationFailureMessages", 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(event="propertyChange")] public function get created_atStyle():com.adobe.fiber.styles.Style { return model_internal::_nullStyle; } [Bindable(event="propertyChange")] public function get sent_atStyle():com.adobe.fiber.styles.Style { return model_internal::_nullStyle; } [Bindable(event="propertyChange")] public function get depthStyle():com.adobe.fiber.styles.Style { return model_internal::_nullStyle; } /** * * @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("_id"): { return _idValidationFailureMessages; } case("path"): { return pathValidationFailureMessages; } default: { return emptyArray; } } } } } .