本文整理汇总了Java中com.sun.xml.internal.ws.api.policy.ModelTranslator类的典型用法代码示例。如果您正苦于以下问题:Java ModelTranslator类的具体用法?Java ModelTranslator怎么用?Java ModelTranslator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelTranslator类属于com.sun.xml.internal.ws.api.policy包,在下文中一共展示了ModelTranslator类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPolicies
import com.sun.xml.internal.ws.api.policy.ModelTranslator; //导入依赖的package包/类
final Collection<Policy> getPolicies() throws PolicyException {
if (null == policyURIs) {
throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1004_POLICY_URIS_CAN_NOT_BE_NULL()));
}
if (null == policyStore) {
throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1010_NO_POLICIES_DEFINED()));
}
final Collection<Policy> result = new ArrayList<Policy>(policyURIs.size());
for (String policyURI : policyURIs) {
final PolicySourceModel sourceModel = policyStore.get(policyURI);
if (sourceModel == null) {
throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1005_POLICY_REFERENCE_DOES_NOT_EXIST(policyURI)));
} else {
result.add(ModelTranslator.getTranslator().translate(sourceModel));
}
}
return result;
}