PrimitiveAssertion.java
1.75 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.wspolicy;
import com.adobe.xfa.Document;
import com.adobe.xfa.Element;
import com.adobe.xfa.Node;
import com.adobe.xfa.wspolicy.CompoundAssertion;
import com.adobe.xfa.wspolicy.Policy;
public class PrimitiveAssertion
extends Policy {
PrimitiveAssertion(Document oDestDoc, Element oSrcNode) {
super(oDestDoc, oSrcNode);
this.setAssertionType(0);
for (Node oChild = oSrcNode.getFirstXMLChild(); oChild != null; oChild = oChild.getNextXMLSibling()) {
Element e;
if (!(oChild instanceof Element) || !PrimitiveAssertion.isPolicyOrRef(e = (Element)oChild)) continue;
Policy poChildPolicy = Policy.loadPolicy(oDestDoc, e);
if (poChildPolicy == null) break;
this.addPolicy(poChildPolicy);
break;
}
}
PrimitiveAssertion(Document oDestDoc, String aNameSpaceURI, String aLocalName) {
super(oDestDoc, aNameSpaceURI, aLocalName);
this.setAssertionType(0);
}
public boolean hasNestedPolicy() {
return this.getFirstPolicyChild() != null;
}
public CompoundAssertion getNestedPolicy() {
Policy policy = this.getFirstPolicyChild();
if (policy != null) {
assert (policy instanceof CompoundAssertion);
return (CompoundAssertion)policy;
}
return null;
}
public CompoundAssertion addNestedPolicy() {
if (!this.hasNestedPolicy()) {
Document oDoc = this.getDomNode().getOwnerDocument();
CompoundAssertion poPolicy = new CompoundAssertion(oDoc, "http://schemas.xmlsoap.org/ws/2004/09/policy", "Policy");
this.addPolicy(poPolicy);
}
return this.getNestedPolicy();
}
}