PropertyOptions.java
5.25 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.internal.xmp.options;
import com.adobe.internal.xmp.XMPException;
import com.adobe.internal.xmp.options.Options;
public final class PropertyOptions
extends Options {
public static final int NO_OPTIONS = 0;
public static final int URI = 2;
public static final int HAS_QUALIFIERS = 16;
public static final int QUALIFIER = 32;
public static final int HAS_LANGUAGE = 64;
public static final int HAS_TYPE = 128;
public static final int STRUCT = 256;
public static final int ARRAY = 512;
public static final int ARRAY_ORDERED = 1024;
public static final int ARRAY_ALTERNATE = 2048;
public static final int ARRAY_ALT_TEXT = 4096;
public static final int SCHEMA_NODE = Integer.MIN_VALUE;
public static final int DELETE_EXISTING = 536870912;
public PropertyOptions() {
}
public PropertyOptions(int options) throws XMPException {
super(options);
}
public boolean isURI() {
return this.getOption(2);
}
public PropertyOptions setURI(boolean value) {
this.setOption(2, value);
return this;
}
public boolean getHasQualifiers() {
return this.getOption(16);
}
public PropertyOptions setHasQualifiers(boolean value) {
this.setOption(16, value);
return this;
}
public boolean isQualifier() {
return this.getOption(32);
}
public PropertyOptions setQualifier(boolean value) {
this.setOption(32, value);
return this;
}
public boolean getHasLanguage() {
return this.getOption(64);
}
public PropertyOptions setHasLanguage(boolean value) {
this.setOption(64, value);
return this;
}
public boolean getHasType() {
return this.getOption(128);
}
public PropertyOptions setHasType(boolean value) {
this.setOption(128, value);
return this;
}
public boolean isStruct() {
return this.getOption(256);
}
public PropertyOptions setStruct(boolean value) {
this.setOption(256, value);
return this;
}
public boolean isArray() {
return this.getOption(512);
}
public PropertyOptions setArray(boolean value) {
this.setOption(512, value);
return this;
}
public boolean isArrayOrdered() {
return this.getOption(1024);
}
public PropertyOptions setArrayOrdered(boolean value) {
this.setOption(1024, value);
return this;
}
public boolean isArrayAlternate() {
return this.getOption(2048);
}
public PropertyOptions setArrayAlternate(boolean value) {
this.setOption(2048, value);
return this;
}
public boolean isArrayAltText() {
return this.getOption(4096);
}
public PropertyOptions setArrayAltText(boolean value) {
this.setOption(4096, value);
return this;
}
public boolean isSchemaNode() {
return this.getOption(Integer.MIN_VALUE);
}
public PropertyOptions setSchemaNode(boolean value) {
this.setOption(Integer.MIN_VALUE, value);
return this;
}
public boolean isCompositeProperty() {
return (this.getOptions() & 768) > 0;
}
public boolean isSimple() {
return (this.getOptions() & 768) == 0;
}
public boolean equalArrayTypes(PropertyOptions options) {
return this.isArray() == options.isArray() && this.isArrayOrdered() == options.isArrayOrdered() && this.isArrayAlternate() == options.isArrayAlternate() && this.isArrayAltText() == options.isArrayAltText();
}
public void mergeWith(PropertyOptions options) throws XMPException {
if (options != null) {
this.setOptions(this.getOptions() | options.getOptions());
}
}
public boolean isOnlyArrayOptions() {
return (this.getOptions() & -7681) == 0;
}
protected int getValidOptions() {
return -2147475470;
}
protected String defineOptionName(int option) {
switch (option) {
case 2: {
return "URI";
}
case 16: {
return "HAS_QUALIFIER";
}
case 32: {
return "QUALIFIER";
}
case 64: {
return "HAS_LANGUAGE";
}
case 128: {
return "HAS_TYPE";
}
case 256: {
return "STRUCT";
}
case 512: {
return "ARRAY";
}
case 1024: {
return "ARRAY_ORDERED";
}
case 2048: {
return "ARRAY_ALTERNATE";
}
case 4096: {
return "ARRAY_ALT_TEXT";
}
case Integer.MIN_VALUE: {
return "SCHEMA_NODE";
}
}
return null;
}
public void assertConsistency(int options) throws XMPException {
if ((options & 256) > 0 && (options & 512) > 0) {
throw new XMPException("IsStruct and IsArray options are mutually exclusive", 103);
}
if ((options & 2) > 0 && (options & 768) > 0) {
throw new XMPException("Structs and arrays can't have \"value\" options", 103);
}
}
}