public static WSS4JPolicyData build(ArrayList topLevelPeds)
throws WSSPolicyException {
Iterator topLevelPEDIterator = topLevelPeds.iterator();
WSS4JPolicyData wpd = new WSS4JPolicyData();
while (topLevelPEDIterator.hasNext()) {
PolicyEngineData ped = (PolicyEngineData) topLevelPEDIterator
.next();
if (ped instanceof Binding) {
if (ped instanceof SymmetricBinding) {
processSymmetricPolicyBinding((SymmetricBinding) ped, wpd);
} else {
processAsymmetricPolicyBinding((AsymmetricBinding) ped, wpd);
}
/*
* Don't change the order of Wss11 / Wss10 instance checks
* because Wss11 extends Wss10 - thus first check Wss11.
*/
} else if (ped instanceof Wss11) {
processWSS11((Wss11) ped, wpd);
} else if (ped instanceof Wss10) {
processWSS10((Wss10) ped, wpd);
} else if (ped instanceof SignedEncryptedElements) {
processSignedEncryptedElements((SignedEncryptedElements) ped,
wpd);
} else if (ped instanceof SignedEncryptedParts) {
processSignedEncryptedParts((SignedEncryptedParts) ped, wpd);
} else if (ped instanceof SupportingToken) {
processSupportingToken((SupportingToken) ped, wpd);
} else {
System.out.println("Unknown top level PED found: "
+ ped.getClass().getName());
}
}
return wpd;
}