YAML.jrag 1.02 KB
Newer Older
René Schöne's avatar
René Schöne committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
aspect Navigation {
  eq Document.getChild().program() = null;
  eq Document.getChild().ragconnect() = null;
  eq Document.getChild().containedFile() = null;
  eq Document.getChild().containedFileName() = getFileName();

  syn boolean Element.isComplex() = false;
  eq ComplexElement.isComplex() = true;

  syn boolean Element.isEmpty() = false;
  eq MappingElement.isEmpty() = getNumKeyValuePair() == 0;
  eq ListElement.isEmpty() = getNumElement() == 0;
}

aspect Helper {
  public static ValueElement ValueElement.of(int value) {
    return new ValueElement(String.valueOf(value));
  }
  public static ValueElement ValueElement.of(boolean value) {
    return new ValueElement(String.valueOf(value));
  }
  public static ValueElement ValueElement.of(String value) {
    return new ValueElement(value);
  }
  public static StringElement StringElement.of(String value) {
    return new StringElement(value);
  }
  public void MappingElement.addKeyValuePair(String key, Element value) {
    addKeyValuePair(new KeyValuePair(key, value));
  }
}