1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.opensaml.xacml.ctx.impl;
20
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24
25 import org.opensaml.xacml.ctx.AttributeType;
26 import org.opensaml.xacml.ctx.ResourceContentType;
27 import org.opensaml.xacml.ctx.ResourceType;
28 import org.opensaml.xml.XMLObject;
29 import org.opensaml.xml.util.XMLObjectChildrenList;
30 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
31
32
33 public class ResourceTypeImpl extends AbstractValidatingXMLObject implements ResourceType {
34
35
36 private XMLObjectChildrenList<AttributeType> attributes;
37
38
39 private ResourceContentType resourceContent;
40
41
42
43
44
45
46
47
48 protected ResourceTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
49 super(namespaceURI, elementLocalName, namespacePrefix);
50 attributes = new XMLObjectChildrenList<AttributeType>(this);
51 }
52
53
54 public List<AttributeType> getAttributes() {
55 return attributes;
56 }
57
58
59 public List<XMLObject> getOrderedChildren() {
60 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
61 if (resourceContent != null) {
62 children.add(resourceContent);
63 }
64 children.addAll(attributes);
65 return Collections.unmodifiableList(children);
66 }
67
68
69 public ResourceContentType getResourceContent() {
70 return resourceContent;
71 }
72
73
74 public void setResourceContent(ResourceContentType content) {
75 resourceContent = prepareForAssignment(resourceContent, content);
76 }
77 }