1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xacml.ctx.impl;
18
19 import java.util.ArrayList;
20 import java.util.Collections;
21 import java.util.List;
22
23 import javax.xml.namespace.QName;
24
25 import org.opensaml.xacml.ctx.ResourceContentType;
26 import org.opensaml.xml.XMLObject;
27 import org.opensaml.xml.util.AttributeMap;
28 import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
29 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
30
31
32 public class ResourceContentTypeImpl extends AbstractValidatingXMLObject implements ResourceContentType {
33
34
35 private IndexedXMLObjectChildrenList<XMLObject> unknownElements;
36
37
38 private AttributeMap unknownAttributes;
39
40
41 private String value;
42
43
44
45
46
47
48
49
50 protected ResourceContentTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
51 super(namespaceURI, elementLocalName, namespacePrefix);
52 unknownAttributes = new AttributeMap(this);
53 unknownElements = new IndexedXMLObjectChildrenList<XMLObject>(this);
54 }
55
56
57 public List<XMLObject> getOrderedChildren() {
58 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
59
60 children.addAll(unknownElements);
61
62 return Collections.unmodifiableList(children);
63 }
64
65
66 public List<XMLObject> getUnknownXMLObjects() {
67 return unknownElements;
68 }
69
70
71 public List<XMLObject> getUnknownXMLObjects(QName typeOrName) {
72 return (List<XMLObject>) unknownElements.subList(typeOrName);
73 }
74
75
76 public AttributeMap getUnknownAttributes() {
77 return unknownAttributes;
78 }
79
80
81 public String getValue() {
82 return value;
83 }
84
85
86 public void setValue(String newValue) {
87 value = prepareForAssignment(value, newValue);
88 }
89 }