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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 package org.melati.poem.prepro;
47
48 import java.io.StreamTokenizer;
49 import java.io.IOException;
50
51
52
53
54 public abstract class FieldQualifier {
55
56
57
58
59
60
61
62
63 public abstract void apply(FieldDef field) throws IllegalityException;
64
65
66
67
68
69
70
71
72
73
74
75 public static FieldQualifier from(StreamTokenizer tokens)
76 throws ParsingDSDException, IOException {
77 if (tokens.ttype != StreamTokenizer.TT_WORD)
78 throw new ParsingDSDException("<field qualifier>", tokens);
79 FieldQualifier it;
80 String kind = tokens.sval;
81 tokens.nextToken();
82 if (kind.equals("indexed"))
83 it = new IndexedFieldQualifier();
84 else if (kind.equals("unique"))
85 it = new UniqueFieldQualifier();
86 else if (kind.equals("primary"))
87 it = new TroidFieldQualifier();
88 else if (kind.equals("nullable"))
89 it = new NullableFieldQualifier();
90 else if (kind.equals("size"))
91 it = new SizeFieldQualifier(tokens);
92 else if (kind.equals("deleted"))
93 it = new DeletedFieldQualifier();
94 else if (kind.equals("displayorderpriority"))
95 it = new DisplayOrderPriorityFieldQualifier(tokens);
96 else if (kind.equals("sortdescending"))
97 it = new SortDescendingFieldQualifier();
98 else if (kind.equals("uneditable"))
99 it = new UneditableFieldQualifier();
100 else if (kind.equals("uncreateable"))
101 it = new UncreateableFieldQualifier();
102 else if (kind.equals("displayname"))
103 it = new DisplayNameFieldQualifier(tokens);
104 else if (kind.equals("displayorder"))
105 it = new DisplayOrderFieldQualifier(tokens);
106 else if (kind.equals("description"))
107 it = new DescriptionFieldQualifier(tokens);
108 else if (kind.equals("displaylevel"))
109 it = new DisplayLevelFieldQualifier(tokens);
110 else if (kind.equals("searchability"))
111 it = new SearchabilityFieldQualifier(tokens);
112 else if (kind.equals("compareonly"))
113 it = new CompareOnlyFieldQualifier();
114 else if (kind.equals("width"))
115 it = new WidthFieldQualifier(tokens);
116 else if (kind.equals("height"))
117 it = new HeightFieldQualifier(tokens);
118 else if (kind.equals("renderinfo"))
119 it = new RenderinfoFieldQualifier(tokens);
120 else if (kind.equals("integrityfix"))
121 it = new IntegrityfixFieldQualifier(tokens);
122 else if (kind.equals("precision"))
123 it = new PrecisionFieldQualifier(tokens);
124 else if (kind.equals("scale"))
125 it = new ScaleFieldQualifier(tokens);
126
127 else
128 throw new ParsingDSDException("<field qualifier>", tokens);
129 return it;
130 }
131 }