ParameterAsserts.java
2.28 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.internal.xmp.impl;
import com.adobe.internal.xmp.XMPConst;
import com.adobe.internal.xmp.XMPException;
import com.adobe.internal.xmp.XMPMeta;
import com.adobe.internal.xmp.impl.XMPMetaImpl;
class ParameterAsserts
implements XMPConst {
private ParameterAsserts() {
}
public static void assertArrayName(String arrayName) throws XMPException {
if (arrayName == null || arrayName.length() == 0) {
throw new XMPException("Empty array name", 4);
}
}
public static void assertPropName(String propName) throws XMPException {
if (propName == null || propName.length() == 0) {
throw new XMPException("Empty property name", 4);
}
}
public static void assertSchemaNS(String schemaNS) throws XMPException {
if (schemaNS == null || schemaNS.length() == 0) {
throw new XMPException("Empty schema namespace URI", 4);
}
}
public static void assertPrefix(String prefix) throws XMPException {
if (prefix == null || prefix.length() == 0) {
throw new XMPException("Empty prefix", 4);
}
}
public static void assertSpecificLang(String specificLang) throws XMPException {
if (specificLang == null || specificLang.length() == 0) {
throw new XMPException("Empty specific language", 4);
}
}
public static void assertStructName(String structName) throws XMPException {
if (structName == null || structName.length() == 0) {
throw new XMPException("Empty array name", 4);
}
}
public static void assertNotNull(Object param) throws XMPException {
if (param == null) {
throw new XMPException("Parameter must not be null", 4);
}
if (param instanceof String && ((String)param).length() == 0) {
throw new XMPException("Parameter must not be null or empty", 4);
}
}
public static void assertImplementation(XMPMeta xmp) throws XMPException {
if (xmp == null) {
throw new XMPException("Parameter must not be null", 4);
}
if (!(xmp instanceof XMPMetaImpl)) {
throw new XMPException("The XMPMeta-object is not compatible with this implementation", 4);
}
}
}