SchemaDescriptionImpl.java
2.37 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xmp.schema.model.impl;
import com.adobe.xmp.schema.model.PropertyDescription;
import com.adobe.xmp.schema.model.SchemaDescription;
import com.adobe.xmp.schema.model.SchemaVisitor;
import com.adobe.xmp.schema.model.XMPSchemaException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class SchemaDescriptionImpl
implements SchemaDescription {
private String namespaceURI;
private ArrayList<PropertyDescription> properties = new ArrayList();
private String label;
private String description;
SchemaDescriptionImpl(String namespaceURI) {
if (namespaceURI == null || namespaceURI.length() == 0) {
throw new IllegalArgumentException("The namespaceURI must not be empty.");
}
this.namespaceURI = namespaceURI;
}
@Override
public String getNamespaceURI() {
return this.namespaceURI;
}
@Override
public String getLabel() {
return this.label;
}
@Override
public void setLabel(String label) {
this.label = label;
}
@Override
public String getDescription() {
return this.description;
}
@Override
public void setDescription(String description) {
this.description = description;
}
@Override
public void addProperty(PropertyDescription property) {
property.setNamespaceURI(this.namespaceURI);
this.properties.add(property);
}
@Override
public PropertyDescription getProperty(String localName) {
for (PropertyDescription property : this.properties) {
if (!property.getName().equals(localName)) continue;
return property;
}
return null;
}
@Override
public void removeProperty(String localName) {
Iterator<PropertyDescription> it = this.properties.iterator();
while (it.hasNext()) {
PropertyDescription property = it.next();
if (!property.getName().equals(localName)) continue;
it.remove();
}
}
public ArrayList<PropertyDescription> getProperties() {
return this.properties;
}
@Override
public void accept(SchemaVisitor visitor) throws XMPSchemaException {
visitor.visit(this);
}
}