assert port != null;
assert policyMap != null;
PolicyMapKey key = PolicyMap.createWsdlEndpointScopeKey(port.getOwner().getName(),port.getName());
Policy policy = policyMap.getEndpointEffectivePolicy(key);
if (null!=policy && policy.contains(SELECT_OPTIMAL_ENCODING_ASSERTION)) {
Iterator <AssertionSet> assertions = policy.iterator();
while(assertions.hasNext()){
AssertionSet assertionSet = assertions.next();
Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
while(policyAssertion.hasNext()){
PolicyAssertion assertion = policyAssertion.next();
if(SELECT_OPTIMAL_ENCODING_ASSERTION.equals(assertion.getName())){
String value = assertion.getAttributeValue(enabled);
boolean isSelectOptimalEncodingEnabled = value == null || Boolean.valueOf(value.trim());
port.addFeature(
new SelectOptimalEncodingFeature(isSelectOptimalEncodingEnabled));
}
}
}
}