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.


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  int lineNo
          To store the line no of the assertion in the file
protected  Assertion parent
          To refer to the parent of this assertion
protected  java.lang.String source
          To store the description of the origin of the 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.
 int getLineNo()
          Returns the line no of the assertion which is line no of the assertion in the file where the assertion is first read.
 Assertion getParent()
          Returns the parent of this assertion.
 java.lang.String getSource()
          Returns a string which describes the source of the 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 setLineNo(int lineNo)
          Sets the line no of the assertion which should be the line no of the assertion in the file where the assertion is first read.
 void setNormalized(boolean flag)
          Marks this assertion as it is in normalized format.
 void setParent(Assertion parent)
          Sets the parent of this assertion.
 void setSource(java.lang.String source)
          Sets specified string as the source of the 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


source

protected java.lang.String source
To store the description of the origin of the assertion


lineNo

protected int lineNo
To store the line no of the assertion in the file

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

setSource

public void setSource(java.lang.String source)
Description copied from interface: Assertion
Sets specified string as the source of the assertion.

Specified by:
setSource in interface Assertion
Parameters:
source - the string which describe the source of the origin of the assertion

getSource

public java.lang.String getSource()
Description copied from interface: Assertion
Returns a string which describes the source of the assertion. For instance name of the policy file that contains the assertion. Returns null if it is not set.

Specified by:
getSource in interface Assertion
Returns:
a string that describe the origin of the assertion.

setLineNo

public void setLineNo(int lineNo)
Description copied from interface: Assertion
Sets the line no of the assertion which should be the line no of the assertion in the file where the assertion is first read.

Specified by:
setLineNo in interface Assertion
Parameters:
lineNo -

getLineNo

public int getLineNo()
Description copied from interface: Assertion
Returns the line no of the assertion which is line no of the assertion in the file where the assertion is first read. came from. Returns -1 if it is not set.

Specified by:
getLineNo in interface Assertion
Returns:
the line no of the assertion in file where the assertion is first read.


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