2 * Created by osonsino on 16/05/2016.
5 import { PROPERTY_DATA } from "app/utils";
7 export class SchemaPropertyGroupModel {
8 property:SchemaProperty;
10 constructor(schemaProperty?:SchemaProperty) {
11 this.property = schemaProperty;
15 export class SchemaProperty {
24 isSimpleType: boolean;
26 private _derivedFromSimpleTypeName:string;
27 get derivedFromSimpleTypeName():string {
28 return this._derivedFromSimpleTypeName;
30 set derivedFromSimpleTypeName(derivedFromSimpleTypeName:string) {
31 this._derivedFromSimpleTypeName = derivedFromSimpleTypeName;
34 constructor(schemaProperty?:SchemaProperty) {
36 this.type = schemaProperty.type;
37 this.required = schemaProperty.required;
38 this.definition = schemaProperty.definition;
39 this.description = schemaProperty.description;
40 this.password = schemaProperty.password;
41 this.simpleType = schemaProperty.simpleType;
42 this.isSimpleType = (-1 < PROPERTY_DATA.SIMPLE_TYPES.indexOf(this.type));
43 this.isDataType = PROPERTY_DATA.TYPES.indexOf(this.type) == -1;
47 public toJSON = ():any => {
48 this.simpleType = undefined;
49 this.isSimpleType = undefined;
50 this.isDataType = undefined;
51 this._derivedFromSimpleTypeName = undefined;