| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| |
| @GenModel(fileExtensions="entitymock") |
| @GenModel(modelName="EntityMockDSL") |
| @GenModel(prefix="EntityMockDSL") |
| @GenModel(updateClasspath="false") |
| // force bigModel == false |
| @GenModel(loadInitialization="false") |
| @GenModel(literalsInterface="true") |
| @GenModel(copyrightText="Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| All rights reserved. This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License v1.0 |
| which accompanies this distribution, and is available at |
| http://www.eclipse.org/legal/epl-v10.html |
| |
| Based on ideas from Xtext, Xtend, Xcore |
| |
| Contributors: |
| Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| ") |
| @Ecore(nsURI="http://osbp.eclipse.org/xtext/entitymock/EntityMockDSL") |
| @Ecore(nsPrefix="entitymockdsl") |
| @Ecore(rootPackage="entitymockdsl") |
| package org.eclipse.osbp.xtext.entitymock |
| |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchange |
| import org.eclipse.emf.ecore.EObject |
| import org.eclipse.emf.ecore.InternalEObject |
| import org.eclipse.xtext.common.types.JvmTypeReference |
| import org.eclipse.xtext.xbase.XExpression |
| import org.eclipse.osbp.dsl.semantic.common.types.LEnum |
| import org.eclipse.osbp.dsl.semantic.common.types.LPackage |
| import org.eclipse.osbp.dsl.semantic.entity.LEntity |
| import org.eclipse.osbp.dsl.semantic.entity.LEntityAttribute |
| import org.eclipse.osbp.dsl.semantic.entity.LEntityReference |
| import org.eclipse.osbp.xtext.oxtype.resource.EcoreUtil3 |
| import org.eclipse.osbp.dsl.semantic.common.types.LEnumLiteral |
| import org.eclipse.xtext.xtype.XImportSection |
| |
| class EntityMockModel { |
| contains XImportSection importSection |
| contains EntityMockPackage[] packages |
| } |
| |
| type InternalEObject wraps InternalEObject |
| |
| class EntityMockLazyResolver { |
| op EObject eResolveProxy(InternalEObject proxy) { |
| return EcoreUtil3.resolve(proxy, this.eResource().resourceSet); |
| } |
| } |
| |
| class EntityMockPackage extends LPackage { |
| contains EntityMock[] mocks |
| } |
| |
| class EntityMock { |
| String name |
| boolean description |
| String descriptionValue |
| int runPriority |
| contains RunningDataInterchanges datainterchanges |
| contains EntityMockResources resources |
| contains EntityMockObjects objects |
| contains EntityMockEntities entities |
| } |
| class RunningDataInterchanges { |
| contains RunningDataInterchange[] datainterchanges |
| } |
| |
| class RunningDataInterchange { |
| refers DataInterchange datainterchangeRef |
| String fileURL |
| } |
| class EntityMockResources { |
| contains EntityMockResource[] resources |
| } |
| |
| class EntityMockResource extends LEnum { |
| contains EntityMockResourceAttribute[] attributes |
| contains EntityMockResourceDataRow[] datarows |
| } |
| |
| class EntityMockResourceAttribute extends LEnum { |
| } |
| |
| class EntityMockResourceDataRow extends LEnumLiteral { |
| String[] values |
| } |
| |
| class EntityMockObjects { |
| contains EntityMockObject[] objects |
| } |
| |
| class EntityMockObject { |
| String name |
| contains EntityMockObjectEnum[] enumerations |
| contains IEntityMockObjectAttribute[] attributes |
| contains EntityMockObjectFunction[] calculations |
| } |
| |
| class EntityMockObjectEnum extends IEntityMockObjectUsable { |
| String name |
| refers LEnum usingResource |
| } |
| |
| class IEntityMockObjectAttribute extends EntityMockLazyResolver { |
| String name |
| } |
| |
| class EntityMockObjectPlainValue extends IEntityMockObjectAttribute, IEntityMockObjectUsable { |
| String[] values |
| } |
| |
| class EntityMockObjectResourceValue extends IEntityMockObjectAttribute, IEntityMockObjectUsable { |
| refers EntityMockObjectEnum resourceEnum |
| refers EntityMockResourceAttribute resourceAttribute |
| } |
| |
| class EntityMockObjectArrayValue extends IEntityMockObjectAttribute, IEntityMockObjectUsable { |
| refers EntityMockObjectEnum enumeration |
| contains EntityMockObjectItemValue[] items |
| } |
| |
| class EntityMockObjectItemValue { |
| refers LEnumLiteral datarow |
| String[] values |
| } |
| |
| class EntityMockObjectEmbed extends IEntityMockObjectAttribute, IEntityMockObjectUsable, EntityMockLazyResolver { |
| refers EntityMockObject object |
| } |
| |
| class EntityMockObjectFunction extends IEntityMockObjectAttribute, IEntityMockObjectUsable { |
| contains JvmTypeReference oftype |
| contains EntityMockObjectFunctionParameter[] params |
| contains XExpression body |
| } |
| |
| class EntityMockObjectFunctionParameter { |
| contains JvmTypeReference parameterType |
| refers IEntityMockObjectUsable name |
| } |
| |
| class EntityMockObjectFill extends IEntityMockObjectAttribute, IEntityMockObjectUsable { |
| contains PropertyFillerType fillerType |
| } |
| |
| class PropertyFillerType extends EntityMockLazyResolver {} |
| |
| class PropertyFillerDateType extends PropertyFillerType {} |
| class PropertyFillerBoolean extends PropertyFillerType {} |
| class PropertyFillerDoubleType extends PropertyFillerType {} |
| class PropertyFillerIntegerType extends PropertyFillerType {} |
| class PropertyFillerTextType extends PropertyFillerType {} |
| |
| class PropertyFillerDateFuture extends PropertyFillerDateType { |
| int dateFutureYears |
| } |
| |
| class PropertyFillerDatePast extends PropertyFillerDateType { |
| int datePastYears |
| } |
| |
| class PropertyFillerDateRange extends PropertyFillerDateType { |
| int dateBeginYears |
| int dateEndYears |
| } |
| |
| class PropertyFillerSignedDoubleRange extends PropertyFillerDoubleType { |
| int decimals |
| double beginRange |
| double endRange |
| refers LEntityAttribute beginRangeRef |
| refers LEntityAttribute endRangeRef |
| double rounded |
| } |
| |
| class PropertyFillerSignedDoubleRandom extends PropertyFillerDoubleType { |
| double[] items |
| } |
| |
| class PropertyFillerSignedIntegerRange extends PropertyFillerIntegerType { |
| int beginRange |
| int endRange |
| refers LEntityAttribute beginRangeRef |
| refers LEntityAttribute endRangeRef |
| int rounded |
| } |
| |
| class PropertyFillerSignedIntegerRandom extends PropertyFillerIntegerType { |
| int[] items |
| } |
| |
| class PropertyFillerTextRandom extends PropertyFillerTextType { |
| String[] items |
| } |
| |
| class PropertyFillerTextParagraphs extends PropertyFillerTextType { |
| int count |
| } |
| |
| class PropertyFillerTextSentences extends PropertyFillerTextType { |
| int count |
| } |
| |
| class PropertyFillerTextWords extends PropertyFillerTextType { |
| int count |
| } |
| |
| class PropertyFillerUnsignedDoubleRange extends PropertyFillerDoubleType { |
| int decimals |
| double beginRange |
| double endRange |
| refers LEntityAttribute beginRangeRef |
| refers LEntityAttribute endRangeRef |
| double rounded |
| } |
| |
| class PropertyFillerUnsignedDoubleRandom extends PropertyFillerDoubleType { |
| double[] items |
| } |
| |
| class PropertyFillerUnsignedIntegerRange extends PropertyFillerIntegerType { |
| int beginRange |
| int endRange |
| refers LEntityAttribute beginRangeRef |
| refers LEntityAttribute endRangeRef |
| int rounded |
| } |
| |
| class PropertyFillerUnsignedIntegerRandom extends PropertyFillerIntegerType { |
| int[] items |
| } |
| |
| |
| class EntityMockEntities { |
| contains EntityMockEntity[] entities |
| } |
| |
| class EntityMockEntity extends EntityMockLazyResolver { |
| String name |
| refers LEntity entityRef |
| int minRows |
| int maxRows |
| contains IIterate iterate |
| refers LEntityAttribute iterator |
| contains EntityMockTemplate[] templates |
| contains IEntityMockAttribute[] attributes |
| contains EntityMockEntityFunction[] calculations |
| refers EntityMockResource byResource |
| contains EntityMockByResourceAttribute[] byResourceAttributes |
| boolean createBlobMapping |
| } |
| |
| class IIterate {} |
| |
| class IntegerIterate extends IIterate { |
| int from |
| int until |
| int step |
| } |
| |
| class DateIterate extends IIterate { |
| contains Date from |
| contains Date until |
| int stepCount |
| EDateStepType stepType |
| } |
| |
| class Date { |
| boolean yesterday |
| boolean today |
| boolean tomorrow |
| int offsetCount |
| EDateStepType offsetType |
| int year |
| int month |
| int day |
| } |
| |
| enum EDateStepType { |
| DAYS as 'days' |
| WEEKS as 'weeks' |
| MONTHS as 'months' |
| YEARS as 'years' |
| } |
| |
| class EntityMockByResourceAttribute { |
| refers LEntityAttribute attributeRef |
| refers EntityMockResourceAttribute resourceAttribute |
| } |
| |
| class EntityMockTemplate extends EntityMockLazyResolver { |
| String name |
| refers EntityMockObject object |
| } |
| |
| class IEntityMockObjectUsable extends EntityMockLazyResolver {} |
| |
| class IEntityMockEntityUsable extends EntityMockLazyResolver {} |
| |
| class IEntityMockAttribute extends IEntityMockEntityUsable {} |
| |
| class EntityMockReferencedObjectAttribute extends EntityMockLazyResolver { |
| refers EntityMockTemplate template |
| refers EntityMockObjectEmbed[] embedded |
| refers IEntityMockObjectUsable attribute |
| } |
| |
| class EntityMockAttributeByObject extends IEntityMockAttribute { |
| refers LEntityAttribute attributeRef |
| contains EntityMockReferencedObjectAttribute reference |
| refers EntityMockObjectEnum resourceEnum |
| refers EntityMockResourceAttribute resourceAttribute |
| } |
| |
| class EntityMockAttributeFiller extends IEntityMockAttribute { |
| refers LEntityAttribute attributeRef |
| contains PropertyFillerType fillerType |
| } |
| |
| class EntityMockAttributeByReference extends IEntityMockAttribute { |
| refers LEntityReference attributeRef |
| refers EntityMockEntity mockedEntity |
| int optionalFor |
| } |
| |
| class EntityMockEntityFunction extends IEntityMockEntityUsable { |
| refers LEntityAttribute attributeRef |
| contains EntityMockEntityFunctionParameter[] params |
| contains XExpression body |
| } |
| |
| class EntityMockEntityNestedAttribute{ |
| refers LEntityReference reference |
| refers LEntityAttribute attribute |
| } |
| |
| class EntityMockEntityFunctionParameter { |
| refers LEntityAttribute attributeRef |
| contains EntityMockEntityNestedAttribute nestedAttribute |
| } |