org.apache.ws.policy
Class AbstractAssertion

java.lang.Object
  extended byorg.apache.ws.policy.AbstractAssertion
All Implemented Interfaces:
Assertion
Direct Known Subclasses:
AndCompositeAssertion, Policy, PrimitiveAssertion, XorCompositeAssertion

public abstract class AbstractAssertion
extends java.lang.Object
implements Assertion

AbstractAssertion provides the default implementation of some basic functions definded in Assertion interface.

Author:
Sanka Samaranayake (sanka@apache.org)

Field Summary
protected  java.util.ArrayList childTerms
          To store terms of this assertion
protected  boolean flag
          Flag to mark whether this assertion is in normalize format
protected  Assertion parent
          To refer to the parent of this assertion
 
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
AbstractAssertion()
           
 
Method Summary
 void addTerm(Assertion assertion)
          Adds an assertion as a term of this assertion.
 void addTerms(java.util.List assertions)
          Adds a list of assertions as terms of this assertion.
 Assertion getParent()
          Returns the parent of this assertion.
 java.util.List getTerms()
          Returns the list of terms of this assertion.
 boolean hasParent()
          Returns true if this assertion object has a parent.
 Assertion intersect(Assertion assertion)
          Default implementation of intersect(Assertion) operation.
 boolean isEmpty()
          Returns true if this assertion has no terms.
 boolean isNormalized()
          Returns true if this assertion is in normalzied format.
 Assertion merge(Assertion assertion)
          Default implementation of merge(Assertion) operation.
 Assertion normalize()
          Default implementation of normalize() operation.
 boolean remove(Assertion assertion)
          Remove the geven term from the set of terms of this assertion.
 void setNormalized(boolean flag)
          Marks this assertion as it is in normalized format.
 void setParent(Assertion parent)
          Sets the parent of this assertion.
 int size()
          Returns the number of terms this assertion has.
 
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
getType, intersect, merge, normalize
 

Field Detail

flag

protected boolean flag
Flag to mark whether this assertion is in normalize format


childTerms

protected java.util.ArrayList childTerms
To store terms of this assertion


parent

protected Assertion parent
To refer to the parent of this assertion

Constructor Detail

AbstractAssertion

public AbstractAssertion()
Method Detail

normalize

public Assertion normalize()
                    throws java.lang.UnsupportedOperationException
Default implementation of normalize() operation.

Specified by:
normalize in interface Assertion
Returns:
an assertion which is the normalized format of this assertion.
Throws:
java.lang.UnsupportedOperationException

intersect

public Assertion intersect(Assertion assertion)
                    throws java.lang.UnsupportedOperationException
Default implementation of intersect(Assertion) operation.

Specified by:
intersect in interface Assertion
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)
                throws java.lang.UnsupportedOperationException
Default implementation of merge(Assertion) operation.

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

isNormalized

public boolean isNormalized()
Returns true if this assertion is in normalzied format.

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

setNormalized

public void setNormalized(boolean flag)
Marks this assertion as it is in normalized format.

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

hasParent

public boolean hasParent()
Returns true if this assertion object has a parent.

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

getParent

public Assertion getParent()
Returns the parent of this assertion.

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

setParent

public void setParent(Assertion parent)
Sets the parent of this assertion.

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

addTerm

public void addTerm(Assertion assertion)
Adds an assertion as a term of this assertion.

Specified by:
addTerm in interface Assertion
Parameters:
assertion - the term to add

addTerms

public void addTerms(java.util.List assertions)
Adds a list of assertions as terms of this assertion.

Specified by:
addTerms in interface Assertion
Parameters:
assertions - list of terms to add

getTerms

public java.util.List getTerms()
Returns the list of terms of this assertion.

Specified by:
getTerms in interface Assertion
Returns:
list of terms

isEmpty

public boolean isEmpty()
Returns true if this assertion has no terms.

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

remove

public boolean remove(Assertion assertion)
Remove the geven term from the set of terms of this assertion.

Specified by:
remove in interface Assertion
Parameters:
assertion - the assertion to remove from the terms list.
Returns:
true if it is removed from the child list.

size

public int size()
Returns the number of terms this assertion has.

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


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