1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.opensaml.xacml.policy.impl;
19
20 import java.util.ArrayList;
21 import java.util.Collections;
22 import java.util.List;
23
24 import org.opensaml.xacml.policy.ConditionType;
25 import org.opensaml.xacml.policy.DescriptionType;
26 import org.opensaml.xacml.policy.EffectType;
27 import org.opensaml.xacml.policy.RuleType;
28 import org.opensaml.xacml.policy.TargetType;
29 import org.opensaml.xml.XMLObject;
30 import org.opensaml.xml.validation.AbstractValidatingXMLObject;
31
32
33
34
35 public class RuleTypeImpl extends AbstractValidatingXMLObject implements RuleType {
36
37
38 private ConditionType condition;
39
40
41 private TargetType target;
42
43
44 private DescriptionType description;
45
46
47 private EffectType effectType;
48
49
50 private String ruleId;
51
52
53
54
55
56
57
58 protected RuleTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix){
59 super(namespaceURI,elementLocalName,namespacePrefix);
60 }
61
62
63 public ConditionType getCondition() {
64 return condition;
65 }
66
67
68 public DescriptionType getDescription() {
69 return description;
70 }
71
72
73 public EffectType getEffect() {
74 return effectType;
75 }
76
77
78 public String getRuleId() {
79 return ruleId;
80 }
81
82
83 public TargetType getTarget() {
84 return target;
85 }
86
87
88 public void setCondition(ConditionType newCondition) {
89 this.condition = prepareForAssignment(this.condition,newCondition);
90 }
91
92
93 public void setDescription(DescriptionType newDescription) {
94 this.description = prepareForAssignment(this.description,newDescription);
95 }
96
97
98 public void setEffect(EffectType type) {
99 this.effectType = prepareForAssignment(this.effectType,type);
100 }
101
102
103 public void setRuleId(String id) {
104 this.ruleId = prepareForAssignment(this.ruleId,id);
105 }
106
107
108 public void setTarget(TargetType newTarget) {
109 this.target = prepareForAssignment(this.target,newTarget);
110 }
111
112
113 public List<XMLObject> getOrderedChildren() {
114
115 ArrayList<XMLObject> children = new ArrayList<XMLObject>();
116
117 if(description != null){
118 children.add(description);
119 }
120 if(target != null){
121 children.add(target);
122 }
123 if(condition != null){
124 children.add(condition);
125 }
126
127 return Collections.unmodifiableList(children);
128 }
129 }