com.sun.xml.ws.policy.sourcemodel
Class PolicyModelGenerator

java.lang.Object
  extended by com.sun.xml.ws.policy.sourcemodel.PolicyModelGenerator
Direct Known Subclasses:
ModelGenerator

public abstract class PolicyModelGenerator
extends Object

Translate a policy into a PolicySourceModel. Code that depends on JAX-WS should use com.sun.xml.ws.api.policy.ModelGenerator instead of this class.

Author:
Marek Potociar, Fabian Ritzmann

Nested Class Summary
protected static class PolicyModelGenerator.PolicySourceModelCreator
          Allows derived classes to pass their own implementation of PolicySourceModelCreator into the PolicyModelGenerator instance.
 
Constructor Summary
protected PolicyModelGenerator()
          This protected constructor avoids direct instantiation from outside of the class
 
Method Summary
protected static PolicyModelGenerator getCompactGenerator(PolicyModelGenerator.PolicySourceModelCreator creator)
          Allows derived classes to create instances of the package private CompactModelGenerator.
static PolicyModelGenerator getGenerator()
          Factory method that returns a PolicyModelGenerator instance.
protected static PolicyModelGenerator getNormalizedGenerator(PolicyModelGenerator.PolicySourceModelCreator creator)
          Allows derived classes to create instances of the package private NormalizedModelGenerator.
protected  void translate(ModelNode node, AssertionSet assertions)
          Add the contents of the assertion set as child node to the given model node.
protected  void translate(ModelNode assertionNode, Iterator<PolicyAssertion> assertionParametersIterator)
          Iterates through all contained assertions and adds them to the info model.
protected abstract  ModelNode translate(ModelNode parentAssertion, NestedPolicy policy)
          Iterates through a nested policy and returns the corresponding policy info model.
abstract  PolicySourceModel translate(Policy policy)
          This method translates a Policy into a policy infoset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyModelGenerator

protected PolicyModelGenerator()
This protected constructor avoids direct instantiation from outside of the class

Method Detail

getGenerator

public static PolicyModelGenerator getGenerator()
Factory method that returns a PolicyModelGenerator instance.

Returns:
PolicyModelGenerator instance

getCompactGenerator

protected static PolicyModelGenerator getCompactGenerator(PolicyModelGenerator.PolicySourceModelCreator creator)
Allows derived classes to create instances of the package private CompactModelGenerator.

Parameters:
creator - An implementation of the PolicySourceModelCreator.
Returns:
An instance of CompactModelGenerator.

getNormalizedGenerator

protected static PolicyModelGenerator getNormalizedGenerator(PolicyModelGenerator.PolicySourceModelCreator creator)
Allows derived classes to create instances of the package private NormalizedModelGenerator.

Parameters:
creator - An implementation of the PolicySourceModelCreator.
Returns:
An instance of NormalizedModelGenerator.

translate

public abstract PolicySourceModel translate(Policy policy)
                                     throws PolicyException
This method translates a Policy into a policy infoset. The resulting PolicySourceModel is disconnected from the input policy, thus any additional changes in the policy will have no effect on the PolicySourceModel.

Parameters:
policy - The policy to be translated into an infoset. May be null.
Returns:
translated The policy infoset. May be null if the input policy was null.
Throws:
PolicyException - in case Policy translation fails.

translate

protected abstract ModelNode translate(ModelNode parentAssertion,
                                       NestedPolicy policy)
Iterates through a nested policy and returns the corresponding policy info model.

Parameters:
parentAssertion - The parent node.
policy - The nested policy.
Returns:
The nested policy translated to the policy info model.

translate

protected void translate(ModelNode node,
                         AssertionSet assertions)
Add the contents of the assertion set as child node to the given model node.

Parameters:
node - The content of this assertion set are added as child nodes to this node. May not be null.
assertions - The assertions that are to be added to the node. May not be null.

translate

protected void translate(ModelNode assertionNode,
                         Iterator<PolicyAssertion> assertionParametersIterator)
Iterates through all contained assertions and adds them to the info model.

Parameters:
assertionParametersIterator - The contained assertions.
assertionNode - The node to which the assertions are added as child nodes


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.