org.apache.ws.policy
Class PrimitiveAssertion

java.lang.Object
  extended byorg.apache.ws.policy.AbstractAssertion
      extended byorg.apache.ws.policy.PrimitiveAssertion
All Implemented Interfaces:
Assertion

public class PrimitiveAssertion
extends AbstractAssertion
implements Assertion

PrimitiveAssertion wraps an assertion which contain domain specific knowledge. This type of an assertion should only be evaluated by a component which contains the required knowledge. For instance a PrimitiveAssertion which contains a WSSecurity policy assertionshould be processed only by the security module.


Field Summary
 
Fields inherited from class org.apache.ws.policy.AbstractAssertion
childTerms, lineNo, parent, source
 
Fields inherited from interface org.apache.ws.policy.Assertion
COMPOSITE_AND_TYPE, COMPOSITE_POLICY_TYPE, COMPOSITE_XOR_TYPE, POLIY_REFERCE_TYPE, PRIMITIVE_TYPE
 
Constructor Summary
PrimitiveAssertion(javax.xml.namespace.QName qname)
           
PrimitiveAssertion(javax.xml.namespace.QName qname, java.lang.Object value)
           
 
Method Summary
 void addAttribute(javax.xml.namespace.QName qname, java.lang.Object value)
           
 void addTerm(Assertion term)
          Adds an assertion as a term of this assertion.
 void addTerms(java.util.List terms)
          Adds a list of assertions as terms of this assertion.
 java.lang.String getAttribute(javax.xml.namespace.QName qname)
           
 java.util.Hashtable getAttributes()
           
 javax.xml.namespace.QName getName()
           
 Assertion getParent()
          Returns the parent of self or null if a parent non-exists
 java.lang.String getStrValue()
           
 java.util.List getTerms()
          Returns the list of terms of this assertion.
 short getType()
          Returns a short type which describes the type of the assertion.
 java.lang.Object getValue()
           
 boolean hasParent()
          Returns ture if the assertion has a parent
 Assertion intersect(Assertion assertion)
          Returns an assertion which is the equivalent of intersect of self and argument.
 Assertion intersect(Assertion assertion, PolicyRegistry reg)
          Returns an assertion which is equivalent of intersect of self and argument.
 boolean isEmpty()
          Returns true if there are no terms in this assertion.
 boolean isNormalized()
          Returns true if the assertion is in normalized form.
 boolean isOptional()
           
 Assertion merge(Assertion assertion)
          Returns the equivalent of merge of self and argument.
 Assertion merge(Assertion assertion, PolicyRegistry reg)
          Returns the equivalent of merge of self and argument.
 Assertion normalize()
          Returns a new assertion which is the normalized form of this assertion.
 Assertion normalize(PolicyRegistry reg)
          Returns a new assertion which is the normalized form of this assertion.
 boolean remove(Assertion assertion)
          Removes the specified assertion from the terms list.
 void removeAttribute(javax.xml.namespace.QName qname)
           
 void setAttributes(java.util.Hashtable attributes)
           
 void setNormalized(boolean flag)
          Marks this assertion as in normalized form.
 void setOptional(boolean isOptional)
           
 void setParent(Assertion parent)
          Sets the parent to argument
 void setStrValue(java.lang.String strValue)
           
 void setTerms(java.util.List terms)
           
 int size()
          Returns the number of terms of this assertion.
 
Methods inherited from class org.apache.ws.policy.AbstractAssertion
getLineNo, getSource, setLineNo, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ws.policy.Assertion
getLineNo, getSource, setLineNo, setSource
 

Constructor Detail

PrimitiveAssertion

public PrimitiveAssertion(javax.xml.namespace.QName qname)

PrimitiveAssertion

public PrimitiveAssertion(javax.xml.namespace.QName qname,
                          java.lang.Object value)
Method Detail

getValue

public java.lang.Object getValue()

getName

public javax.xml.namespace.QName getName()

intersect

public Assertion intersect(Assertion assertion,
                           PolicyRegistry reg)
Description copied from interface: Assertion
Returns an assertion which is equivalent of intersect of self and argument. Here the external policy are resolved via a policy registry that is supplied as an argument.

Specified by:
intersect in interface Assertion
Parameters:
assertion - the assertion to intersect with
Returns:
the equivalent of intersection of self and argument

intersect

public Assertion intersect(Assertion assertion)
                    throws java.lang.UnsupportedOperationException
Description copied from interface: Assertion
Returns an assertion which is the equivalent of intersect of self and argument. The rules to construct the equivalent assertion are specified in WS Policy 1.0 specification.

Specified by:
intersect in interface Assertion
Overrides:
intersect in class AbstractAssertion
Parameters:
assertion - the assertion to intersect with this object.
Returns:
an assertion which is equivalent to the intersect of this assertion and the argument.
Throws:
java.lang.UnsupportedOperationException

merge

public Assertion merge(Assertion assertion,
                       PolicyRegistry reg)
Description copied from interface: Assertion
Returns the equivalent of merge of self and argument. The rules to construct argument are specified in WS Policy specification 1.0 Here the external policy references are resolved via a policy registry that is supplied as an argument

Specified by:
merge in interface Assertion
Parameters:
assertion - the assertion to merge with
reg - the policy registry that should be used to resolve external policy references
Returns:
the equivalent of merge of self and argument

merge

public Assertion merge(Assertion assertion)
Description copied from interface: Assertion
Returns the equivalent of merge of self and argument. The rules to construct the equivalent of merge are defined in WS Policy specification 1.0

Specified by:
merge in interface Assertion
Overrides:
merge in class AbstractAssertion
Parameters:
assertion - the assertion to merge with this object.
Returns:
an assertion which is equivalent to the merge of this assertion and the argument.

normalize

public Assertion normalize()
Description copied from interface: Assertion
Returns a new assertion which is the normalized form of this assertion.

Specified by:
normalize in interface Assertion
Overrides:
normalize in class AbstractAssertion
Returns:
an assertion which is the normalized format of this assertion.

normalize

public Assertion normalize(PolicyRegistry reg)
Description copied from interface: Assertion
Returns a new assertion which is the normalized form of this assertion.

Specified by:
normalize in interface Assertion
Parameters:
reg - the registry which is used to resolve any policy references in the process of normalization.
Returns:

hasParent

public boolean hasParent()
Description copied from interface: Assertion
Returns ture if the assertion has a parent

Specified by:
hasParent in interface Assertion
Overrides:
hasParent in class AbstractAssertion
Returns:
returns true if this has a parent.

getParent

public Assertion getParent()
Description copied from interface: Assertion
Returns the parent of self or null if a parent non-exists

Specified by:
getParent in interface Assertion
Overrides:
getParent in class AbstractAssertion
Returns:
parent of this assertion.

setAttributes

public void setAttributes(java.util.Hashtable attributes)

getAttributes

public java.util.Hashtable getAttributes()

addAttribute

public void addAttribute(javax.xml.namespace.QName qname,
                         java.lang.Object value)

getAttribute

public java.lang.String getAttribute(javax.xml.namespace.QName qname)

removeAttribute

public void removeAttribute(javax.xml.namespace.QName qname)

setParent

public void setParent(Assertion parent)
Description copied from interface: Assertion
Sets the parent to argument

Specified by:
setParent in interface Assertion
Overrides:
setParent in class AbstractAssertion
Parameters:
parent - of this assertion.

getTerms

public java.util.List getTerms()
Description copied from interface: Assertion
Returns the list of terms of this assertion.

Specified by:
getTerms in interface Assertion
Overrides:
getTerms in class AbstractAssertion

setTerms

public void setTerms(java.util.List terms)

addTerm

public void addTerm(Assertion term)
Description copied from interface: Assertion
Adds an assertion as a term of this assertion.

Specified by:
addTerm in interface Assertion
Overrides:
addTerm in class AbstractAssertion
Parameters:
term - the term to add

addTerms

public void addTerms(java.util.List terms)
Description copied from interface: Assertion
Adds a list of assertions as terms of this assertion.

Specified by:
addTerms in interface Assertion
Overrides:
addTerms in class AbstractAssertion
Parameters:
terms - list of terms to add

isNormalized

public boolean isNormalized()
Description copied from interface: Assertion
Returns true if the assertion is in normalized form.

Specified by:
isNormalized in interface Assertion
Overrides:
isNormalized in class AbstractAssertion
Returns:
true if this assertion is in normalized format.

setNormalized

public void setNormalized(boolean flag)
Description copied from interface: Assertion
Marks this assertion as in normalized form.

Specified by:
setNormalized in interface Assertion
Overrides:
setNormalized in class AbstractAssertion
Parameters:
flag - which marks this object as in its normalized format or not.

getStrValue

public java.lang.String getStrValue()

setStrValue

public void setStrValue(java.lang.String strValue)

isOptional

public boolean isOptional()

setOptional

public void setOptional(boolean isOptional)

isEmpty

public boolean isEmpty()
Description copied from interface: Assertion
Returns true if there are no terms in this assertion.

Specified by:
isEmpty in interface Assertion
Overrides:
isEmpty in class AbstractAssertion
Returns:
if this assertion has no terms.

remove

public boolean remove(Assertion assertion)
Description copied from interface: Assertion
Removes the specified assertion from the terms list.

Specified by:
remove in interface Assertion
Overrides:
remove in class AbstractAssertion

size

public int size()
Description copied from interface: Assertion
Returns the number of terms of this assertion.

Specified by:
size in interface Assertion
Overrides:
size in class AbstractAssertion
Returns:
the number of terms

getType

public final short getType()
Description copied from interface: Assertion
Returns a short type which describes the type of the assertion.

Specified by:
getType in interface Assertion
Returns:
a short value of one of following values: PRIMITIVE_TYPE : if the assertion is a PrimitiveAssertion COMPOSITE_AND_TYPE : if the assertion is a AndCompositeAssertion COMPOSITE_XOR_TYPE : if the assertion is a XorCompositeAssertion COMPOSITE_POLICY_TYPE : if the assertion is a Policy POLICY_REFERENCE_TYPE : if the assertion is a PolicyReferece


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.