java.lang.Object
com.sun.xml.ws.policy.sourcemodel.PolicySourceModel
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
SourceModel
This class is a root of unmarshaled policy source structure. Each instance of the class contains factory method
to create new
ModelNode
instances associated with the actual model instance.- Author:
- Marek Potociar, Fabian Ritzmann
-
Constructor Summary
ModifierConstructorDescriptionprotected
PolicySourceModel
(NamespaceVersion nsVersion, String policyId, String policyName, Collection<PrefixMapper> prefixMappers) Constructor that creates a new policy source model instance with given id or name identifier and a set of PrefixMappers. -
Method Summary
Modifier and TypeMethodDescriptionprotected PolicySourceModel
clone()
boolean
Returns a boolean value indicating whether this policy source model contains references to another policy source models.static PolicySourceModel
createPolicySourceModel
(NamespaceVersion nsVersion) Factory method that creates new policy source model instance.static PolicySourceModel
createPolicySourceModel
(NamespaceVersion nsVersion, String policyId, String policyName) Factory method that creates new policy source model instance and initializes it according to parameters provided.boolean
AnObject.equals(Object obj)
method override.void
expand
(PolicySourceModelContext context) Expands current policy model.Returns an original namespace version of this policy source model.Returns a policy ID of this policy source model.Returns a policy name of this policy source model.Returns a root node of this policy source model.int
hashCode()
AnObject.hashCode()
method override.toString()
Returns a string representation of the object.
-
Constructor Details
-
PolicySourceModel
protected PolicySourceModel(NamespaceVersion nsVersion, String policyId, String policyName, Collection<PrefixMapper> prefixMappers) Constructor that creates a new policy source model instance with given id or name identifier and a set of PrefixMappers. This constructor is intended to be used by the JAX-WS com.sun.xml.ws.policy.api.SourceModel.- Parameters:
nsVersion
- The WS-Policy version.policyId
- Relative policy reference within an XML document. May benull
.policyName
- Absolute IRI of policy expression. May benull
.prefixMappers
- A collection of PrefixMappers to be used with this instance. May benull
.
-
-
Method Details
-
createPolicySourceModel
Factory method that creates new policy source model instance. This method is only intended to be used by code that has no dependencies on JAX-WS. Otherwise use com.sun.xml.ws.policy.api.SourceModel.- Parameters:
nsVersion
- The policy version- Returns:
- Newly created policy source model instance.
-
createPolicySourceModel
public static PolicySourceModel createPolicySourceModel(NamespaceVersion nsVersion, String policyId, String policyName) Factory method that creates new policy source model instance and initializes it according to parameters provided. This method is only intended to be used by code that has no dependencies on JAX-WS. Otherwise use com.sun.xml.ws.policy.api.SourceModel.- Parameters:
nsVersion
- The policy versionpolicyId
- local policy identifier - relative URI. May benull
.policyName
- global policy identifier - absolute policy expression URI. May benull
.- Returns:
- Newly created policy source model instance with its name and id properly set.
-
getRootNode
Returns a root node of this policy source model. It is allways of POLICY type.- Returns:
- root policy source model node - allways of POLICY type.
-
getPolicyName
Returns a policy name of this policy source model.- Returns:
- policy name.
-
getPolicyId
Returns a policy ID of this policy source model.- Returns:
- policy ID.
-
getNamespaceVersion
Returns an original namespace version of this policy source model.- Returns:
- namespace version.
-
equals
AnObject.equals(Object obj)
method override.
When child nodes are tested for equality, the parent policy source model is not considered. Thus two different policy source models instances may be equal based on their node content. -
hashCode
public int hashCode()AnObject.hashCode()
method override. -
toString
Returns a string representation of the object. In general, thetoString
method returns a string that "textually represents" this object. -
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
containsPolicyReferences
public boolean containsPolicyReferences()Returns a boolean value indicating whether this policy source model contains references to another policy source models.
Every source model that references other policies must be expanded before it can be translated into a Policy objects. Seeexpand(PolicySourceModelContext)
andisExpanded()
for more details.- Returns:
true
orfalse
depending on whether this policy source model contains references to another policy source models.
-
expand
Expands current policy model. This means, that if this model contains any (unexpanded) policy references, then the method expands those references by placing the content of the referenced policy source models under the policy reference nodes. This operation merely creates a link between this and referenced policy source models. Thus any change in the referenced models will be visible wihtin this model as well.
Please, notice that the method does not check if the referenced models are already expanded nor does the method try to expand unexpanded referenced models. This must be preformed manually within client's code. Consecutive calls of this method will have no effect.
Every source model that references other policies must be expanded before it can be translated into a Policy object. SeeisExpanded()
andcontainsPolicyReferences()
for more details.- Parameters:
context
- a policy source model context holding the set of unmarshalled policy source models within the same context.- Throws:
PolicyException
- Thrown if a referenced policy could not be resolved
-