Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Domainmodel:
- elements+=Element*;
- Element:
- Aggregate | ValueObject;
- Aggregate:
- 'aggregate' name=ValidID ('extends' superType=JvmTypeReference)? '{'
- properties+=Property*
- '}';
- ValueObject:
- 'valueObject' name=ValidID ('extends' superType=JvmTypeReference)? '{'
- properties+=Property*
- '}';
- Property:
- name=ValidID ':' type=JvmTypeReference;
- valueObject Address{
- }
- aggregate Person{
- p : Address
- }
- @Check
- def checkAggregateReference(Aggregate aggregate) {
- var properties = aggregate.properties
- for(Property f : properties){
- if(f is aggregate)
- error('An aggregate is not allowed to reference another aggregate'
- ,MdDslPackage.Literals.AGGREGATE
- ,f.eContainingFeature)
- }}
- }
Add Comment
Please, Sign In to add comment