import { SchemaPropertyGroupModel, SchemaProperty } from "../aschema-property";
+import { PROPERTY_DATA, PROPERTY_TYPES } from 'app/utils';
+export enum DerivedPropertyType {
+ SIMPLE,
+ LIST,
+ MAP,
+ COMPLEX
+}
export class PropertyBEModel {
definition: boolean;
inputPath: string;
propertiesName: string;
+ ownerId: string;
input: PropertyBEModel;
constructor(property?: PropertyBEModel, childProperty?:PropertyBEModel) {
this.uniqueId = property.uniqueId;
this.value = property.value ? property.value : property.defaultValue;
this.definition = property.definition;
+ this.ownerId = property.ownerId;
if (property.inputPath) {
this.inputPath = property.inputPath;
}
if (childProperty) {
this.input = childProperty;
this.propertiesName = childProperty.propertiesName;
+ } else {
+ this.propertiesName = this.name;
}
if (!this.schema || !this.schema.property) {
}
}
-
+
public toJSON = (): any => {
let temp = angular.copy(this);
return temp;
};
+ public getDerivedPropertyType = () => {
+ if (PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.type) > -1) {
+ return DerivedPropertyType.SIMPLE;
+ } else if (this.type == PROPERTY_TYPES.LIST) {
+ return DerivedPropertyType.LIST;
+ } else if (this.type == PROPERTY_TYPES.MAP) {
+ return DerivedPropertyType.MAP;
+ } else {
+ return DerivedPropertyType.COMPLEX;
+ }
+ }
+
}