1
2
3
4
5
6
7
8
9
10
11
12 package org.hyphenType.datastructure.parser;
13
14 import java.lang.reflect.Method;
15 import java.util.Collections;
16 import java.util.List;
17
18 import org.hyphenType.datastructure.annotations.InputChannel;
19
20
21
22
23 public abstract class StructureArgument extends StructureElement implements Comparable<StructureArgument> {
24
25 private final String name;
26 private final boolean mandatory;
27 private final int index;
28 private final String regex;
29 private final List<InputChannel> channels;
30 private final String description;
31
32 public StructureArgument(String name, Method method, boolean mandatory, int index, String regex, List<InputChannel> channels, String description) {
33 super(method);
34 this.name = name;
35 this.mandatory = mandatory;
36 this.index = index;
37 this.regex = regex;
38 this.channels = Collections.unmodifiableList(channels);
39 this.description = description;
40 }
41
42 public String getName() {
43 return name;
44 }
45
46 public boolean isMandatory() {
47 return mandatory;
48 }
49
50 public int getIndex() {
51 return index;
52 }
53
54 public String getRegex() {
55 return regex;
56 }
57
58 public List<InputChannel> getChannels() {
59 return channels;
60 }
61
62 public String getDescription() {
63 return description;
64 }
65
66 @Override
67 public int compareTo(StructureArgument other) {
68 return this.index - other.index;
69 }
70 }