1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xml.encryption.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.xml.XMLObject;
26 import org.opensaml.xml.util.AttributeMap;
27 import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
28 import org.opensaml.xml.util.XMLObjectChildrenList;
29 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
30
31
32
33
34 public class EncryptionPropertyImpl extends AbstractValidatingXMLObject implements
35 org.opensaml.xml.encryption.EncryptionProperty {
36
37
38 private String target;
39
40
41 private String id;
42
43
44 private final IndexedXMLObjectChildrenList unknownChildren;
45
46
47 private final AttributeMap unknownAttributes;
48
49
50
51
52
53
54
55
56 protected EncryptionPropertyImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
57 super(namespaceURI, elementLocalName, namespacePrefix);
58 unknownChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
59 unknownAttributes = new AttributeMap(this);
60 }
61
62
63 public String getTarget() {
64 return this.target;
65 }
66
67
68 public void setTarget(String newTarget) {
69 this.target = prepareForAssignment(this.target, newTarget);
70 }
71
72
73 public String getID() {
74 return this.id;
75 }
76
77
78 public void setID(String newID) {
79 String oldID = this.id;
80 this.id = prepareForAssignment(this.id, newID);
81 registerOwnID(oldID, this.id);
82 }
83
84
85 public AttributeMap getUnknownAttributes() {
86 return unknownAttributes;
87 }
88
89
90 public List<XMLObject> getUnknownXMLObjects() {
91 return (List<XMLObject>) unknownChildren;
92 }
93
94 public List<XMLObject> getUnknownXMLObjects(QName typeOrName) {
95 return (List<XMLObject>) unknownChildren.subList(typeOrName);
96 }
97
98
99 public List<XMLObject> getOrderedChildren() {
100 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
101
102 children.addAll((List<XMLObject>) unknownChildren);
103
104 if (children.size() == 0) {
105 return null;
106 }
107
108 return Collections.unmodifiableList(children);
109 }
110
111 }