FileDocCategorySizeDatePackage
RequiredElementsProcessor.javaAPI DocExample3825Tue May 29 16:56:50 BST 2007com.sun.xml.ws.security.impl.policyconv

RequiredElementsProcessor

public class RequiredElementsProcessor extends Object
author
K.Venugopal@sun.com

Fields Summary
private List
assertionList
private com.sun.xml.wss.impl.policy.mls.MessagePolicy
mp
Constructors Summary
public RequiredElementsProcessor(List al, com.sun.xml.wss.impl.policy.mls.MessagePolicy mp)
Creates a new instance of RequiredElementProcessor

        this.assertionList = al;
        this.mp = mp;
    
Methods Summary
public voidprocess()

        Vector<String> targetValues = new Vector<String>();
        MandatoryTargetPolicy mt = new MandatoryTargetPolicy();
        MandatoryTargetPolicy.FeatureBinding mfb = new MandatoryTargetPolicy.FeatureBinding();
        mt.setFeatureBinding(mfb);
        List<Target> targets = mfb.getTargetBindings();
        for(RequiredElements re : assertionList){
            Iterator itr = re.getTargets();
            while(itr.hasNext()){
                String xpathExpr = (String)itr.next();
                if(!targetValues.contains(xpathExpr)){
                    targetValues.add(xpathExpr);
                    Target tr = new Target();
                    tr.setType(Target.TARGET_TYPE_VALUE_XPATH);
                    tr.setValue(xpathExpr);
                    tr.setContentOnly(false);
                    tr.setEnforce(true);
                    targets.add(tr);
                }
            }
        } 
       mp.append(mt);