Class PolicyModelGenerator
- java.lang.Object
-
- 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
Nested Classes Modifier and Type Class Description protected static classPolicyModelGenerator.PolicySourceModelCreatorAllows derived classes to pass their own implementation of PolicySourceModelCreator into the PolicyModelGenerator instance.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPolicyModelGenerator()This protected constructor avoids direct instantiation from outside of the class
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static PolicyModelGeneratorgetCompactGenerator(PolicyModelGenerator.PolicySourceModelCreator creator)Allows derived classes to create instances of the package private CompactModelGenerator.static PolicyModelGeneratorgetGenerator()Factory method that returns aPolicyModelGeneratorinstance.protected static PolicyModelGeneratorgetNormalizedGenerator(PolicyModelGenerator.PolicySourceModelCreator creator)Allows derived classes to create instances of the package private NormalizedModelGenerator.abstract PolicySourceModeltranslate(Policy policy)This method translates aPolicyinto apolicy infoset.protected voidtranslate(ModelNode node, AssertionSet assertions)Add the contents of the assertion set as child node to the given model node.protected abstract ModelNodetranslate(ModelNode parentAssertion, NestedPolicy policy)Iterates through a nested policy and returns the corresponding policy info model.protected voidtranslate(ModelNode assertionNode, Iterator<PolicyAssertion> assertionParametersIterator)Iterates through all contained assertions and adds them to the info model.
-
-
-
Method Detail
-
getGenerator
public static PolicyModelGenerator getGenerator()
Factory method that returns aPolicyModelGeneratorinstance.- Returns:
PolicyModelGeneratorinstance
-
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 aPolicyinto apolicy 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
-
-