|
Java example source code file (PolicyAssertion.java)
The PolicyAssertion.java Java example source code/* * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.xml.internal.ws.policy; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.xml.namespace.QName; import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; import com.sun.xml.internal.ws.policy.sourcemodel.AssertionData; import com.sun.xml.internal.ws.policy.sourcemodel.ModelNode; /** * Base class for any policy assertion implementations. It defines the common * interface and provides some default implentation for common policy assertion * functionality. * <p/> * NOTE: Assertion implementers should not extend this class directly. {@link SimpleAssertion} * or {@link ComplexAssertion} should be used as a base class instead. * * @author Marek Potociar (marek.potociar at sun.com) * @author Fabian Ritzmann */ public abstract class PolicyAssertion { private final AssertionData data; private AssertionSet parameters; private NestedPolicy nestedPolicy; // TODO: remove protected PolicyAssertion() { this.data = AssertionData.createAssertionData(null); this.parameters = AssertionSet.createAssertionSet(null); } /** * Creates generic assertionand stores the data specified in input parameters * * @param assertionData assertion creation data specifying the details of newly created assertion. May be {@code null}. * @param assertionParameters collection of assertions parameters of this policy assertion. May be {@code null}. * @param nestedAlternative assertion set specifying nested policy alternative. May be {@code null}. * * @deprecated Non-abstract assertion types should derive from {@link SimpleAssertion} * or {@link ComplexAssertion} instead. {@link Policy} class will not provide support for * nested policy alternatives in the future. This responsibility is delegated to * {@link ComplexAssertion} class instead. */ @Deprecated protected PolicyAssertion(final AssertionData assertionData, final Collection<? extends PolicyAssertion> assertionParameters, final AssertionSet nestedAlternative) { this.data = assertionData; if (nestedAlternative != null) { this.nestedPolicy = NestedPolicy.createNestedPolicy(nestedAlternative); } this.parameters = AssertionSet.createAssertionSet(assertionParameters); } /** * Creates generic assertionand stores the data specified in input parameters * * @param assertionData assertion creation data specifying the details of newly created assertion * @param assertionParameters collection of assertions parameters of this policy assertion. May be {@code null}. */ protected PolicyAssertion(final AssertionData assertionData, final Collection<? extends PolicyAssertion> assertionParameters) { if (assertionData == null) { this.data = AssertionData.createAssertionData(null); } else { this.data = assertionData; } this.parameters = AssertionSet.createAssertionSet(assertionParameters); } /** * Returns the fully qualified name of the assertion. * * @return assertion's fully qualified name. */ public final QName getName() { return data.getName(); } /** * Returns the value of the assertion - the character data content contained in the assertion element representation. * * @return assertion's value. May return {@code null} if there is no value set for the assertion. */ public final String getValue() { return data.getValue(); } /** * Method specifies whether the assertion is otpional or not. * <p/> * This is a default implementation that may be overriden. The method returns {@code true} if the {@code wsp:optional} attribute * is present on the assertion and its value is {@code 'true'}. Otherwise the method returns {@code false}. * * @return {@code 'true'} if the assertion is optional. Returns {@code false} otherwise. */ public boolean isOptional() { return data.isOptionalAttributeSet(); } /** * Method specifies whether the assertion is ignorable or not. * <p/> * This is a default implementation that may be overriden. The method returns {@code true} if the {@code wsp:Ignorable} attribute * is present on the assertion and its value is {@code 'true'}. Otherwise the method returns {@code false}. * * @return {@code 'true'} if the assertion is ignorable. Returns {@code false} otherwise. */ public boolean isIgnorable() { return data.isIgnorableAttributeSet(); } /** * Method specifies whether the assertion is private or not. This is specified by our proprietary visibility element. * * @return {@code 'true'} if the assertion is marked as private (i.e. should not be marshalled int generated WSDL documents). Returns {@code false} otherwise. */ public final boolean isPrivate() { return data.isPrivateAttributeSet(); } /** * Returns the disconnected set of attributes attached to the assertion. Each attribute is represented as a single * {@code Map.Entry<attributeName, attributeValue>} element. * <p/> * 'Disconnected' means, that the result of this method will not be synchronized with any consequent assertion's attribute modification. It is * also important to notice that a manipulation with returned set of attributes will not have any effect on the actual assertion's * attributes. * * @return disconected set of attributes attached to the assertion. */ public final Set<Map.Entry Other Java examples (source code examples)Here is a short list of links related to this Java PolicyAssertion.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.