FileDocCategorySizeDatePackage
RequiredElements.javaAPI DocExample5317Tue May 29 16:56:46 BST 2007com.sun.xml.ws.security.impl.policy

RequiredElements

public class RequiredElements extends com.sun.xml.ws.policy.PolicyAssertion implements com.sun.xml.ws.security.policy.RequiredElements, com.sun.xml.ws.security.policy.SecurityAssertionValidator
author
mayank.mishra@Sun.com

Fields Summary
private String
xpathVersion
private List
targetList
private boolean
populated
private static QName
XPathVersion
private AssertionFitness
fitness
Constructors Summary
public RequiredElements()
Creates a new instance of RequiredElements

           
      
    
public RequiredElements(com.sun.xml.ws.policy.sourcemodel.AssertionData name, Collection nestedAssertions, com.sun.xml.ws.policy.AssertionSet nestedAlternative)

        super(name,nestedAssertions,nestedAlternative);
    
Methods Summary
public voidaddTarget(java.lang.String target)

        if ( targetList == null ) {
            targetList = new ArrayList<String>();
        }
        targetList.add(target);
    
public java.util.IteratorgetTargets()

        populate();
        if ( targetList != null ) {
            return targetList.iterator();
        }
        return Collections.emptyList().iterator();
    
public java.lang.StringgetXPathVersion()

        populate();
        return xpathVersion;
    
private synchronized AssertionFitnesspopulate(boolean isServer)

        if(!populated){
            this.xpathVersion = (String)this.getAttributeValue(XPathVersion);
            if ( this.hasNestedAssertions() ) {
                Iterator <PolicyAssertion> it = this.getNestedAssertionsIterator();
                if ( it.hasNext() ) {
                    PolicyAssertion assertion = it.next();
                    if ( PolicyUtil.isXPath(assertion)) {
                        addTarget(assertion.getValue());
                    } else{
                        if(!assertion.isOptional()){
                            log_invalid_assertion(assertion, isServer,RequiredElements);
                            fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                        }
                    }
                }
            }
            populated = true;
        }
        return fitness;
    
private voidpopulate()

        populate(false);
    
public voidremoveTarget(java.lang.String target)

        if ( targetList != null ) {
            targetList.remove(target);
        }
    
public voidsetXPathVersion(java.lang.String version)

        this.xpathVersion = version;
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);