本文整理汇总了Java中com.sun.xml.internal.ws.policy.privateutil.PolicyUtils类的典型用法代码示例。如果您正苦于以下问题:Java PolicyUtils类的具体用法?Java PolicyUtils怎么用?Java PolicyUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PolicyUtils类属于com.sun.xml.internal.ws.policy.privateutil包,在下文中一共展示了PolicyUtils类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toString
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
/**
* A helper method that appends indented string representation of this instance to the input string buffer.
*
* @param indentLevel indentation level to be used.
* @param buffer buffer to be used for appending string representation of this instance
* @return modified buffer containing new string representation of the instance
*/
public StringBuffer toString(final int indentLevel, final StringBuffer buffer) {
final String indent = PolicyUtils.Text.createIndent(indentLevel);
final String innerIndent = PolicyUtils.Text.createIndent(indentLevel + 1);
buffer.append(indent).append("reference data {").append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("referenced policy model URI = '").append(referencedModelUri).append('\'').append(PolicyUtils.Text.NEW_LINE);
if (digest == null) {
buffer.append(innerIndent).append("no digest specified").append(PolicyUtils.Text.NEW_LINE);
} else {
buffer.append(innerIndent).append("digest algorith URI = '").append(digestAlgorithmUri).append('\'').append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("digest = '").append(digest).append('\'').append(PolicyUtils.Text.NEW_LINE);
}
buffer.append(indent).append('}');
return buffer;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:PolicyReferenceData.java
示例2: Policy
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
/**
* Constructor that should be overridden by child implementation. The constructor allows for easy toString() output
* customization.
*
* @param toStringName a general name of the object (such as 'policy' or 'nested policy') that will be used in the
* toString() method to identify the object.
* @param sets represents the collection of policy alternatives of the policy object created. During the creation of
* the new policy object, the content of the alternatives collection is copied into an internal policy object structure,
* thus any subsequent operations on the collection will have no impact on the newly constructed policy object. The
* collection may be {@code null} or empty. In such case a 'NULL' policy object is constructed.
*/
Policy(final String toStringName, final Collection<AssertionSet> sets) {
this.nsVersion = NamespaceVersion.getLatestVersion();
this.toStringName = toStringName;
if (sets == null || sets.isEmpty()) {
this.assertionSets = NULL_POLICY_ASSERTION_SETS;
this.vocabulary = EMPTY_VOCABULARY;
this.immutableVocabulary = EMPTY_VOCABULARY;
} else {
this.assertionSets = new LinkedList<AssertionSet>();
this.vocabulary = new TreeSet<QName>(PolicyUtils.Comparison.QNAME_COMPARATOR);
this.immutableVocabulary = Collections.unmodifiableCollection(this.vocabulary);
addAll(sets);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Policy.java
示例3: readExternalFile
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
private boolean readExternalFile(final String fileUrl) {
InputStream ios = null;
XMLStreamReader reader = null;
try {
final URL xmlURL = new URL(fileUrl);
ios = xmlURL.openStream();
reader = XmlUtil.newXMLInputFactory(true).createXMLStreamReader(ios);
while (reader.hasNext()) {
if (reader.isStartElement() && NamespaceVersion.resolveAsToken(reader.getName()) == XmlToken.Policy) {
readSinglePolicy(policyReader.readPolicyElement(reader, fileUrl), false);
}
reader.next();
}
return true;
} catch (IOException ioe) {
return false;
} catch (XMLStreamException xmlse) {
return false;
} finally {
PolicyUtils.IO.closeResource(reader);
PolicyUtils.IO.closeResource(ios);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:PolicyWSDLParserExtension.java
示例4: toString
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
/**
* A helper method that appends indented string representation of this instance to the input string buffer.
*
* @param indentLevel indentation level to be used.
* @param buffer buffer to be used for appending string representation of this instance
* @return modified buffer containing new string representation of the instance
*/
StringBuffer toString(final int indentLevel, final StringBuffer buffer) {
final String indent = PolicyUtils.Text.createIndent(indentLevel);
final String innerIndent = PolicyUtils.Text.createIndent(indentLevel + 1);
buffer.append(indent).append("assertion set {").append(PolicyUtils.Text.NEW_LINE);
if (assertions.isEmpty()) {
buffer.append(innerIndent).append("no assertions").append(PolicyUtils.Text.NEW_LINE);
} else {
for (PolicyAssertion assertion : assertions) {
assertion.toString(indentLevel + 1, buffer).append(PolicyUtils.Text.NEW_LINE);
}
}
buffer.append(indent).append('}');
return buffer;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:AssertionSet.java
示例5: readExternalFile
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
private boolean readExternalFile(final String fileUrl) {
InputStream ios = null;
XMLStreamReader reader = null;
try {
final URL xmlURL = new URL(fileUrl);
ios = xmlURL.openStream();
reader = XMLInputFactory.newInstance().createXMLStreamReader(ios);
while (reader.hasNext()) {
if (reader.isStartElement() && NamespaceVersion.resolveAsToken(reader.getName()) == XmlToken.Policy) {
readSinglePolicy(policyReader.readPolicyElement(reader, fileUrl), false);
}
reader.next();
}
return true;
} catch (IOException ioe) {
return false;
} catch (XMLStreamException xmlse) {
return false;
} finally {
PolicyUtils.IO.closeResource(reader);
PolicyUtils.IO.closeResource(ios);
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:24,代码来源:PolicyWSDLParserExtension.java
示例6: toString
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
/**
* A helper method that appends indented string representation of this instance to the input string buffer.
*
* @param indentLevel indentation level to be used.
* @param buffer buffer to be used for appending string representation of this instance
* @return modified buffer containing new string representation of the instance
*/
StringBuffer toString(final int indentLevel, final StringBuffer buffer) {
final String indent = PolicyUtils.Text.createIndent(indentLevel);
final String innerIndent = PolicyUtils.Text.createIndent(indentLevel + 1);
buffer.append(indent).append("policy subject {").append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("subject = '").append(subject).append('\'').append(PolicyUtils.Text.NEW_LINE);
for (Policy policy : policies) {
policy.toString(indentLevel + 1, buffer).append(PolicyUtils.Text.NEW_LINE);
}
buffer.append(indent).append('}');
return buffer;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:PolicySubject.java
示例7: createPolicyAlternatives
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
/**
* Method creates policy alternatives according to provided model. The model structure is modified in the process.
*
* @return created policy alternatives resulting from policy source model.
*/
private Collection<AssertionSet> createPolicyAlternatives(final PolicySourceModel model) throws PolicyException {
// creating global method variables
final ContentDecomposition decomposition = new ContentDecomposition();
// creating processing queue and starting the processing iterations
final Queue<RawPolicy> policyQueue = new LinkedList<RawPolicy>();
final Queue<Collection<ModelNode>> contentQueue = new LinkedList<Collection<ModelNode>>();
final RawPolicy rootPolicy = new RawPolicy(model.getRootNode(), new LinkedList<RawAlternative>());
RawPolicy processedPolicy = rootPolicy;
do {
Collection<ModelNode> processedContent = processedPolicy.originalContent;
do {
decompose(processedContent, decomposition);
if (decomposition.exactlyOneContents.isEmpty()) {
final RawAlternative alternative = new RawAlternative(decomposition.assertions);
processedPolicy.alternatives.add(alternative);
if (!alternative.allNestedPolicies.isEmpty()) {
policyQueue.addAll(alternative.allNestedPolicies);
}
} else { // we have a non-empty collection of exactly ones
final Collection<Collection<ModelNode>> combinations = PolicyUtils.Collections.combine(decomposition.assertions, decomposition.exactlyOneContents, false);
if (combinations != null && !combinations.isEmpty()) {
// processed alternative was split into some new alternatives, which we need to process
contentQueue.addAll(combinations);
}
}
} while ((processedContent = contentQueue.poll()) != null);
} while ((processedPolicy = policyQueue.poll()) != null);
// normalize nested policies to contain single alternative only
final Collection<AssertionSet> assertionSets = new LinkedList<AssertionSet>();
for (RawAlternative rootAlternative : rootPolicy.alternatives) {
final Collection<AssertionSet> normalizedAlternatives = normalizeRawAlternative(rootAlternative);
assertionSets.addAll(normalizedAlternatives);
}
return assertionSets;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:PolicyModelTranslator.java
示例8: normalizeRawAlternative
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
private List<AssertionSet> normalizeRawAlternative(final RawAlternative alternative) throws AssertionCreationException, PolicyException {
final List<PolicyAssertion> normalizedContentBase = new LinkedList<PolicyAssertion>();
final Collection<List<PolicyAssertion>> normalizedContentOptions = new LinkedList<List<PolicyAssertion>>();
if (!alternative.nestedAssertions.isEmpty()) {
final Queue<RawAssertion> nestedAssertionsQueue = new LinkedList<RawAssertion>(alternative.nestedAssertions);
RawAssertion rawAssertion;
while((rawAssertion = nestedAssertionsQueue.poll()) != null) {
final List<PolicyAssertion> normalized = normalizeRawAssertion(rawAssertion);
// if there is only a single result, we can add it direclty to the content base collection
// more elements in the result indicate that we will have to create combinations
if (normalized.size() == 1) {
normalizedContentBase.addAll(normalized);
} else {
normalizedContentOptions.add(normalized);
}
}
}
final List<AssertionSet> options = new LinkedList<AssertionSet>();
if (normalizedContentOptions.isEmpty()) {
// we do not have any options to combine => returning this assertion
options.add(AssertionSet.createAssertionSet(normalizedContentBase));
} else {
// we have some options to combine => creating assertion options based on content combinations
final Collection<Collection<PolicyAssertion>> contentCombinations = PolicyUtils.Collections.combine(normalizedContentBase, normalizedContentOptions, true);
for (Collection<PolicyAssertion> contentOption : contentCombinations) {
options.add(AssertionSet.createAssertionSet(contentOption));
}
}
return options;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:PolicyModelTranslator.java
示例9: toString
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
/**
* Returns a string representation of the object. In general, the <code>toString</code> method
* returns a string that "textually represents" this object.
*
* @return a string representation of the object.
*/
@Override
public String toString() {
final String innerIndent = PolicyUtils.Text.createIndent(1);
final StringBuffer buffer = new StringBuffer(60);
buffer.append("Policy source model {").append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("policy id = '").append(policyId).append('\'').append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("policy name = '").append(policyName).append('\'').append(PolicyUtils.Text.NEW_LINE);
rootNode.toString(1, buffer).append(PolicyUtils.Text.NEW_LINE).append('}');
return buffer.toString();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:PolicySourceModel.java
示例10: toString
import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; //导入依赖的package包/类
/**
* A helper method that appends indented string representation of this instance to the input string buffer.
*
* @param indentLevel indentation level to be used.
* @param buffer buffer to be used for appending string representation of this instance
* @return modified buffer containing new string representation of the instance
*/
public StringBuffer toString(final int indentLevel, final StringBuffer buffer) {
final String indent = PolicyUtils.Text.createIndent(indentLevel);
final String innerIndent = PolicyUtils.Text.createIndent(indentLevel + 1);
final String innerDoubleIndent = PolicyUtils.Text.createIndent(indentLevel + 2);
buffer.append(indent);
if (type == ModelNode.Type.ASSERTION) {
buffer.append("assertion data {");
} else {
buffer.append("assertion parameter data {");
}
buffer.append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("namespace = '").append(name.getNamespaceURI()).append('\'').append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("prefix = '").append(name.getPrefix()).append('\'').append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("local name = '").append(name.getLocalPart()).append('\'').append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("value = '").append(value).append('\'').append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("optional = '").append(optional).append('\'').append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("ignorable = '").append(ignorable).append('\'').append(PolicyUtils.Text.NEW_LINE);
synchronized (attributes) {
if (attributes.isEmpty()) {
buffer.append(innerIndent).append("no attributes");
} else {
buffer.append(innerIndent).append("attributes {").append(PolicyUtils.Text.NEW_LINE);
for(Map.Entry<QName, String> entry : attributes.entrySet()) {
final QName aName = entry.getKey();
buffer.append(innerDoubleIndent).append("name = '").append(aName.getNamespaceURI()).append(':').append(aName.getLocalPart());
buffer.append("', value = '").append(entry.getValue()).append('\'').append(PolicyUtils.Text.NEW_LINE);
}
buffer.append(innerIndent).append('}');
}
}
buffer.append(PolicyUtils.Text.NEW_LINE).append(indent).append('}');
return buffer;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:AssertionData.java
注:本文中的com.sun.xml.internal.ws.policy.privateutil.PolicyUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论