325N/A * This class is a root of unmarshaled policy source structure. Each instance of the class contains factory method
325N/A * to create new {@link com.sun.xml.internal.ws.policy.sourcemodel.ModelNode} instances associated with the actual model instance.
325N/A private static final Map<String, String> DEFAULT_NAMESPACE_TO_PREFIX = new HashMap<String, String>();
325N/A private final List<ModelNode> references = new LinkedList<ModelNode>(); // links to policy reference nodes
325N/A * JAX-WS. Otherwise use com.sun.xml.internal.ws.policy.api.SourceModel.
325N/A * Factory method that creates new policy source model instance and initializes it according to parameters provided.
325N/A * JAX-WS. Otherwise use com.sun.xml.internal.ws.policy.api.SourceModel.
325N/A * @param policyName global policy identifier - absolute policy expression URI. May be {@code null}.
325N/A public static PolicySourceModel createPolicySourceModel(final NamespaceVersion nsVersion, final String policyId, final String policyName) {
325N/A * This constructor is intended to be used by the JAX-WS com.sun.xml.internal.ws.policy.api.SourceModel.
325N/A * @param prefixMappers A collection of PrefixMappers to be used with this instance. May be {@code null}.
325N/A return policyName;
325N/A return nsToPrefixMap;
325N/A * When child nodes are tested for equality, the parent policy source model is not considered. Thus two different
325N/A result = result && ((this.policyId == null) ? that.policyId == null : this.policyId.equals(that.policyId));
325N/A result = result && ((this.policyName == null) ? that.policyName == null : this.policyName.equals(that.policyName));
325N/A * Returns a string representation of the object. In general, the <code>toString</code> method
325N/A buffer.append(innerIndent).append("policy id = '").append(policyId).append('\'').append(PolicyUtils.Text.NEW_LINE);
325N/A buffer.append(innerIndent).append("policy name = '").append(policyName).append('\'').append(PolicyUtils.Text.NEW_LINE);
325N/A } catch (IllegalAccessException e) {
325N/A throw LOGGER.logSevereException(new CloneNotSupportedException(LocalizationMessages.WSP_0013_UNABLE_TO_SET_PARENT_MODEL_ON_ROOT()), e);
325N/A * Returns a boolean value indicating whether this policy source model contains references to another policy source models.
325N/A * Every source model that references other policies must be expanded before it can be translated into a Policy objects. See
325N/A * @return {@code true} or {code false} depending on whether this policy source model contains references to another policy source models.
325N/A * Returns a boolean value indicating whether this policy source model contains is already expanded (i.e. contains no unexpanded
325N/A * policy references) or not. This means that if model does not originally contain any policy references, it is considered as expanded,
325N/A * thus this method returns {@code true} in such case. Also this method does not check whether the references policy source models are expanded
325N/A * as well, so after expanding this model a value of {@code true} is returned even if referenced models are not expanded yet. Thus each model
325N/A * can be considered to be fully expanded only if all policy source models stored in PolicySourceModelContext instance are expanded, provided the
325N/A * Every source model that references other policies must be expanded before it can be translated into a Policy object. See
325N/A * {@link #expand(PolicySourceModelContext)} and {@link #containsPolicyReferences()} for more details.
325N/A * @return {@code true} or {@code false} depending on whether this policy source model contains is expanded or not.
325N/A * Expands current policy model. This means, that if this model contains any (unexpanded) policy references, then the method expands those
325N/A * references by placing the content of the referenced policy source models under the policy reference nodes. This operation merely creates
325N/A * a link between this and referenced policy source models. Thus any change in the referenced models will be visible wihtin this model as well.
325N/A * Please, notice that the method does not check if the referenced models are already expanded nor does the method try to expand unexpanded
325N/A * referenced models. This must be preformed manually within client's code. Consecutive calls of this method will have no effect.
325N/A * Every source model that references other policies must be expanded before it can be translated into a Policy object. See
325N/A * @param context a policy source model context holding the set of unmarshalled policy source models within the same context.
325N/A public synchronized void expand(final PolicySourceModelContext context) throws PolicyException {
325N/A if (!isExpanded()) {
325N/A referencedModel = context.retrieveModel(refData.getReferencedModelUri(), refData.getDigestAlgorithmUri(), digest);
325N/A throw new IllegalArgumentException(LocalizationMessages.WSP_0042_POLICY_REFERENCE_NODE_EXPECTED_INSTEAD_OF(node.getType()));
325N/A throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0081_UNABLE_TO_INSERT_CHILD(nodesToBeProcessed, child)));
325N/A return namespaces;