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
  • Constructor Details

    • PolicyModelGenerator

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

    • 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