PropertyInfo.java
7.56 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.xmp.schema.model.ArrayType
* com.adobe.xmp.schema.model.ArrayType$ArrayForm
*/
package com.adobe.xmp.schema.rng.model;
import com.adobe.xmp.schema.model.ArrayType;
import com.adobe.xmp.schema.rng.model.DatatypeInfo;
import com.adobe.xmp.schema.rng.model.ParamInfo;
import com.adobe.xmp.schema.rng.model.ParamInfoGroup;
import com.adobe.xmp.schema.rng.model.PropertyAnnotationInfo;
import com.adobe.xmp.schema.rng.model.SchemaInfo;
import com.adobe.xmp.schema.rng.parser.annotation.RNGDecorationAnnotation;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
import javax.xml.namespace.QName;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class PropertyInfo
implements PropertyAnnotationInfo {
private String mNS;
private String mName;
private ParamInfoGroup mParamInfos;
private DatatypeInfo mRawDataType;
private DatatypeInfo mDataType;
private Stack<PropertyInfo> mFields;
private Stack<PropertyInfo> mQualifiers;
private ArrayType.ArrayForm mArrayForm;
private String mLabel;
private String mDescription;
private RNGDecorationAnnotation.ACCESS mAccess;
private RNGDecorationAnnotation.CHOICE choice;
private boolean mDeprecated;
private boolean mMandatory;
private boolean mIsQualifier;
private boolean mIsArrayItemQualifier;
private SchemaInfo mSchemaInfo;
private HashMap<QName, Map<String, String>> mDecoratorStore;
public PropertyInfo(String ns, String name, SchemaInfo schemaInfo) {
this.mNS = ns;
this.mName = name;
this.mParamInfos = new ParamInfoGroup(ParamInfoGroup.Operator.kAND);
this.mRawDataType = new DatatypeInfo("Text", true);
this.mFields = new Stack();
this.mQualifiers = new Stack();
this.mArrayForm = null;
this.mLabel = "";
this.mDescription = "";
this.mAccess = null;
this.mDeprecated = false;
this.mMandatory = true;
this.mIsQualifier = false;
this.mIsArrayItemQualifier = false;
this.mSchemaInfo = schemaInfo;
}
public void addChild(PropertyInfo child) {
if (child.isQualifier() || child.isArrayItemQualifier()) {
this.mQualifiers.add(child);
} else {
this.mFields.add(child);
}
}
public Stack<PropertyInfo> getQualifiers() {
return this.mQualifiers;
}
public Stack<PropertyInfo> getFields() {
return this.mFields;
}
public void setNS(String mNS) {
this.mNS = mNS;
}
public String getNS() {
return this.mNS;
}
public void setName(String mName) {
this.mName = mName;
}
public String getName() {
return this.mName;
}
public void setParamInfos(ParamInfoGroup mParamInfos) {
if (this.mParamInfos == null || this.mParamInfos.size() == 0) {
this.mParamInfos = mParamInfos;
} else {
this.mParamInfos.push(mParamInfos);
}
}
public ParamInfoGroup getParamInfos() {
return this.mParamInfos;
}
public void setRawDataType(DatatypeInfo mRawDataType) {
this.mRawDataType = mRawDataType;
}
public DatatypeInfo getRawDataType() {
return this.mRawDataType;
}
public void setDataType(DatatypeInfo mDataType) {
this.mDataType = mDataType;
}
public DatatypeInfo getDataType() {
return this.mDataType;
}
public void setArrayForm(ArrayType.ArrayForm form) {
this.mArrayForm = form;
}
public ArrayType.ArrayForm getArrayForm() {
return this.mArrayForm;
}
@Override
public void setLabel(String mLabel) {
this.mLabel = mLabel;
}
@Override
public String getLabel() {
return this.mLabel;
}
@Override
public void setDescription(String mDescription) {
this.mDescription = mDescription;
}
@Override
public String getDescription() {
return this.mDescription;
}
@Override
public void setAccess(RNGDecorationAnnotation.ACCESS mAccess) {
this.mAccess = mAccess;
}
@Override
public RNGDecorationAnnotation.ACCESS getAccess() {
return this.mAccess;
}
public void setDeprecated(boolean mDeprecated) {
this.mDeprecated = mDeprecated;
}
public boolean isDeprecated() {
return this.mDeprecated;
}
public void setMandatory(boolean mMandatory) {
this.mMandatory = mMandatory;
}
public boolean isMandatory() {
return this.mMandatory;
}
public void setIsArrayItemQualifier(boolean isArrayItemQualifier) {
this.mIsArrayItemQualifier = isArrayItemQualifier;
}
public boolean isArrayItemQualifier() {
return this.mIsArrayItemQualifier;
}
public void setIsQualifier(boolean isQualifier) {
this.mIsQualifier = isQualifier;
}
public boolean isQualifier() {
return this.mIsQualifier;
}
public void setSchemaInfo(SchemaInfo mSchemaInfo) {
this.mSchemaInfo = mSchemaInfo;
}
public SchemaInfo getSchemaInfo() {
return this.mSchemaInfo;
}
public void setChoice(RNGDecorationAnnotation.CHOICE choice) {
this.choice = choice;
}
public RNGDecorationAnnotation.CHOICE getChoice() {
return this.choice;
}
public boolean hasDecorators() {
return this.mDecoratorStore != null && this.mDecoratorStore.size() > 0;
}
public HashMap<QName, Map<String, String>> getDecoratorStore() {
if (this.mDecoratorStore == null) {
this.mDecoratorStore = new HashMap();
}
return this.mDecoratorStore;
}
public Map<String, String> getDecorator(QName qname) {
Map<String, String> map = this.getDecoratorStore().get(qname);
if (map == null) {
map = new HashMap<String, String>();
this.mDecoratorStore.put(qname, map);
}
return map;
}
public String toString() {
StringBuilder str = new StringBuilder();
str.append("\nName = ").append(this.mName);
str.append(" - Ns = ").append(this.mNS);
str.append(" - label = ").append(this.mLabel);
str.append("\nDeprecated = ").append(this.mDeprecated);
str.append("\nMandatory = ").append(this.mMandatory);
if (this.mFields != null && this.mFields.size() > 0) {
str.append("\n========= Fields ===============");
for (PropertyInfo p : this.mFields) {
str.append(p.toString());
}
str.append("\n=================================");
}
if (this.mQualifiers != null && this.mQualifiers.size() > 0) {
str.append("\n========= Qualifiers ===============");
for (PropertyInfo p : this.mQualifiers) {
str.append(p.toString());
}
str.append("\n=================================");
}
if (this.mArrayForm != null) {
str.append("\n Array Type " + (Object)this.mArrayForm);
}
if (this.mParamInfos != null) {
str.append("\n========= Param Info ===============");
str.append("\n" + this.mParamInfos);
str.append("\n=================================");
}
if (this.mDataType != null) {
str.append("\n DataType" + this.mDataType);
}
if (this.mRawDataType != null) {
str.append("\n Raw DataType" + this.mRawDataType);
}
return str.toString();
}
}