Author: sanka
Date: Sun Nov 12 20:23:35 2006
New Revision: 474136

URL: http://svn.apache.org/viewvc?view=rev&rev=474136
Log:
Updated the README, RELEASE-NOTE for the release.
Added more documentation.


Modified:
    webservices/commons/trunk/modules/neethi/README.txt
    webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt
    webservices/commons/trunk/modules/neethi/maven.xml
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/AbstractPolicyOperator.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/All.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Constants.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/ExactlyOne.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Policy.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyEngine.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyOperator.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistry.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/AssertionBuilder.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XMLPrimitiveAssertionBuilder.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XmlPrimtiveAssertion.java
    
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java

Modified: webservices/commons/trunk/modules/neethi/README.txt
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/README.txt?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- webservices/commons/trunk/modules/neethi/README.txt (original)
+++ webservices/commons/trunk/modules/neethi/README.txt Sun Nov 12 20:23:35 2006
@@ -1,11 +1,14 @@
 
 Apache Commons Neethi:
 
-This is an implementation of WS-Policy Specification (September,2004) which 
-can be located at:http://schemas.xmlsoap.org/ws/2004/09/policy/
+This is an implementation of WS-Policy Specification (March, 2006) which 
+can be located at:http://specs.xmlsoap.org/ws/2004/09/policy/ws-policy.pdf
 
 It provides a convenient model and an API to process policy information at 
-runtime. This framework is heavily used in Apache Axis2, Apache Sandesha2, 
+runtime and an extension model for serailization and de-serialization of 
+domain specific Assertions. 
+
+This framework is heavily used in Apache Axis2, Apache Sandesha2, 
 Apache WSS4J (as an experimental feature) and now gaining its maturity.
 
 Please visit : http://ws.apache.org/commons/neethi/ for further infomation.

Modified: webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt (original)
+++ webservices/commons/trunk/modules/neethi/RELEASE-NOTE.txt Sun Nov 12 
20:23:35 2006
@@ -1,14 +1,26 @@
 
-Apache Commons Neethi 1.0.1 Release Note:
+Apache Commons Neethi-2.0 Release Note:
 
 Feature List:
 
-Fully compliant with the WS Policy Specification (September 2004)
-Passes WS Policy Interop Round1 TestSuite
+Adhere the latest WS-Policy 1.2 specification 
+see: http://specs.xmlsoap.org/ws/2004/09/policy/ws-policy.pdf
+
+Provides a convenient API to access and process Policies
+
+Provides an extension model where custom serialization, de-serialization of
+assertion can be supported.
+see: 
https://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/secpolicy/
+
+Provides a mechanism where domain specific types can be used assertion within
+the generic framework
+
+Provides more control to the assertion authors to control behavior of the 
+assertions they implement
+
+
 
-User's guide:
 
-please visit http://ws.apache.org/commons/policy/1_0/userguide.html
 
 
 

Modified: webservices/commons/trunk/modules/neethi/maven.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/maven.xml?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- webservices/commons/trunk/modules/neethi/maven.xml (original)
+++ webservices/commons/trunk/modules/neethi/maven.xml Sun Nov 12 20:23:35 2006
@@ -1,191 +1,157 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright 2003-2004 The Apache Software Foundation
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-
-
-<!-- $Rev: 330371 $ $Date: 2005-11-02 16:57:37 -0500 (Wed, 02 Nov 2005) $ -->
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2003-2004 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+
+<!-- $Rev: 330371 $ $Date: 2005-11-02 16:57:37 -0500 (Wed, 02 Nov 2005) $ -->
+
 <project 
-       default="jar"
-       xmlns:j="jelly:core"
-    xmlns:u="jelly:util"
-    xmlns:ant="jelly:ant"
-    xmlns:maven="jelly:maven"
-    xmlns:define="jelly:define"
-    xmlns:velocity="jelly:velocity"
-    >
-
-    <j:set var="dist.name" value="${pom.artifactId}-${pom.currentVersion}"/>
-    
-    <ant:property name="build.dist.dir" value="${maven.build.dir}/dist" />
-    
-    <ant:property name="jar.file" value="${dist.name}.jar" />
-    
-    <ant:property name="license.file" value="LICENSE.txt" />
-    
-    <ant:property name="notice.file" value="NOTICE.txt" />
-    
-    <ant:property name="readme.file" value="README.txt" />
-    
-    <ant:property name="authors.file" value="AUTHORS.txt" />
-    
-    <ant:property name="release.note.file" value="RELEASE-NOTE.txt"/>
-    
-    <!-- ==================== -->
-    <!-- Default Global Goals -->
-    <!-- ==================== -->
-
-
-    <goal name="jar">
-        <attainGoal name="jar:install"/>
-    </goal>
-    
-    <goal name="default">
-        <attainGoal name="jar:install"/>
-    </goal>
-
-    <goal name="build">
-           
-        <attainGoal name="default"/>
-    </goal>
-
-    <goal name="rebuild">
-        <attainGoal name="clean"/>
-        <attainGoal name="build"/>
-    </goal>
-    
-    <!-- ================================================================ -->
-    <!--- Create the Source Distribution -->
-    <!-- ================================================================ -->
-    
-    <goal name="dist-src">
-        <ant:property name="dist.src.root.file" 
value="${build.dist.dir}/dist-src"/>
-       
-       <ant:property name="dist.src.file" 
value="${dist.src.root.file}/${dist.name}-src" />
-       
-       <!-- <mkdir dir="${build.dist.dir}"/> -->
-       
-       <mkdir dir="${dist.src.file}" />
-       
-       <ant:copy todir="${dist.src.file}">
-               <ant:fileset dir=".">
-                       <ant:include name="**"/>
-                       <ant:exclude name="**/target/**"/>
-                       <ant:exclude name="**/.svn/**"/>
-                       <ant:exclude name="**/bin/**"/>
-                       <ant:exclude name=".*"/>
-                       <!-- <ant:exclude name="**/*.license"/> -->
-               </ant:fileset>
-        </ant:copy>
-
-       <ant:zip destfile="${build.dist.dir}/${dist.name}-src.zip" 
basedir="${dist.src.root.file}"/>
-       
-       <ant:tar tarfile="${build.dist.dir}/${dist.name}-src.tar" 
basedir="${dist.src.root.file}"/>
-               
-       <ant:gzip src="${build.dist.dir}/${dist.name}-src.tar" 
zipfile="${build.dist.dir}/${dist.name}-src.tar.gz"/>
-        
-       <ant:delete file="${build.dist.dir}/${dist.name}-src.tar"/>
-       
-       <ant:delete dir = "${dist.src.root.file}"/>
-       
-     </goal>
-     
-     
-     <!-- ================================================================== 
-->
-     <!-- Creates and Install Neethi-SNAPSHOT jar                           -->
-     <!-- ================================================================== 
-->
-     
-     <goal name="neethi:jar:install"  prereqs="clean,test">
-        <ant:property name="dest.file"
-           value="${pom.artifactId}-${pom.currentVersion}.jar" />
-       <ant:jar destfile="${maven.build.dir}/${dest.file}"
-           basedir="${maven.build.dest}"
-           includes="**/policy/**"
-           excludes="**/neethi/**" />
-       <ant:copy file="${maven.build.dir}/${dest.file}" 
-           todir="${maven.repo.local}/${pom.artifactDirectory}/jars"
-           overwirte="true" />
-     </goal>
-     
-     
-     <!-- ================================================================== 
-->
-     <!-- Creates and Install Neethi2-SNAPSHOT jar                           
-->
-     <!-- ================================================================== 
-->
-     
-     <goal name="neethi2:jar:install"  prereqs="clean,test">
-        <ant:property name="dest.file"
-           value="${pom.artifactId}2-${pom.currentVersion}.jar" />
-       <ant:jar destfile="${maven.build.dir}/${dest.file}"
-           basedir="${maven.build.dest}"
-           includes="**/neethi/**"
-           excludes="**/policy/**" />
-       <ant:copy file="${maven.build.dir}/${dest.file}" 
-           todir="${maven.repo.local}/${pom.artifactDirectory}/jars"
-           overwirte="true" />
-     </goal>
-     
-     <!-- ================================================================ -->
-     <!--- Create the Binary Distribution -->
-     <!-- ================================================================ -->
-     
-     <goal name="dist-bin" prereqs="default,javadoc">
-            
-            
-        <property name="dist.bin.root.file" value="${build.dist.dir}/dist-bin" 
/>
-       
-       <property name="dist.bin.file" 
value="${dist.bin.root.file}/${dist.name}-bin"/>
-       
-       <mkdir dir="${dist.bin.file}" />
-       
-       <mkdir dir="${dist.bin.file}/docs" />
-       
-       <mkdir dir="${dist.bin.file}/docs/apidocs"/>
-       
-       <mkdir dir="${dist.bin.file}/lib"/>
-       
-       <ant:copy todir="${dist.bin.file}/docs/apidocs">
-           <ant:fileset dir="target/docs/apidocs/">
-               <ant:include name="**"/>
-           </ant:fileset>
-        </ant:copy>
-       
-       <ant:copy file="target/${jar.file}" todir="${dist.bin.file}/lib" />
-       
-       
-       <ant:copy file="${license.file}" todir="${dist.bin.file}" />
-       
-       <ant:copy file="${readme.file}" todir="${dist.bin.file}" />
-       
-       <ant:copy file="${notice.file}" todir="${dist.bin.file}" />
-       
-       <ant:copy file="${authors.file}" todir="${dist.bin.file}" />
-        
-       <ant:copy file="${release.note.file}" todir="${dist.bin.file}" />
-       
-       <ant:zip destfile="${build.dist.dir}/${dist.name}-bin.zip" 
basedir="${dist.bin.root.file}"/>
-       
-       <ant:tar tarfile="${build.dist.dir}/${dist.name}-bin.tar" 
basedir="${dist.bin.root.file}"/>
-       
-       <ant:gzip src="${build.dist.dir}/${dist.name}-bin.tar" 
zipfile="${build.dist.dir}/${dist.name}-bin.tar.gz"/>
-       
-       <ant:delete file="${build.dist.dir}/${dist.name}-bin.tar"/>
-       
-       <ant:delete dir = "${dist.bin.root.file}"/>
-            
-    </goal>
- 
+       default="jar"
+       xmlns:j="jelly:core"
+    xmlns:u="jelly:util"
+    xmlns:ant="jelly:ant"
+    xmlns:maven="jelly:maven"
+    xmlns:define="jelly:define"
+    xmlns:velocity="jelly:velocity"
+    >
+
+    <j:set var="dist.name" value="${pom.artifactId}-${pom.currentVersion}"/>
+    
+    <ant:property name="build.dist.dir" value="${maven.build.dir}/dist" />
+    
+    <ant:property name="jar.file" value="${dist.name}.jar" />
+    
+    <ant:property name="license.file" value="LICENSE.txt" />
+    
+    <ant:property name="notice.file" value="NOTICE.txt" />
+    
+    <ant:property name="readme.file" value="README.txt" />
+    
+    <ant:property name="authors.file" value="AUTHORS.txt" />
+    
+    <ant:property name="release.note.file" value="RELEASE-NOTE.txt"/>
+    
+    <!-- ==================== -->
+    <!-- Default Global Goals -->
+    <!-- ==================== -->
+
+
+    <goal name="jar">
+        <attainGoal name="jar:install"/>
+    </goal>
+    
+    <goal name="default">
+        <attainGoal name="jar:install"/>
+    </goal>
+
+    <goal name="build">
+           
+        <attainGoal name="default"/>
+    </goal>
+
+    <goal name="rebuild">
+        <attainGoal name="clean"/>
+        <attainGoal name="build"/>
+    </goal>
+    
+    <!-- ================================================================ -->
+    <!--- Create the Source Distribution -->
+    <!-- ================================================================ -->
+    
+    <goal name="dist-src">
+        <ant:property name="dist.src.root.file" 
value="${build.dist.dir}/dist-src"/>
+       
+       <ant:property name="dist.src.file" 
value="${dist.src.root.file}/${dist.name}-src" />
+       
+       <!-- <mkdir dir="${build.dist.dir}"/> -->
+       
+       <mkdir dir="${dist.src.file}" />
+       
+       <ant:copy todir="${dist.src.file}">
+               <ant:fileset dir=".">
+                       <ant:include name="**"/>
+                       <ant:exclude name="**/target/**"/>
+                       <ant:exclude name="**/.svn/**"/>
+                       <ant:exclude name="**/bin/**"/>
+                       <ant:exclude name=".*"/>
+                       <!-- <ant:exclude name="**/*.license"/> -->
+               </ant:fileset>
+        </ant:copy>
+
+       <ant:zip destfile="${build.dist.dir}/${dist.name}-src.zip" 
basedir="${dist.src.root.file}"/>
+       
+       <ant:tar tarfile="${build.dist.dir}/${dist.name}-src.tar" 
basedir="${dist.src.root.file}"/>
+               
+       <ant:gzip src="${build.dist.dir}/${dist.name}-src.tar" 
zipfile="${build.dist.dir}/${dist.name}-src.tar.gz"/>
+        
+       <ant:delete file="${build.dist.dir}/${dist.name}-src.tar"/>
+       
+       <ant:delete dir = "${dist.src.root.file}"/>
+       
+     </goal>
+     
+     <!-- ================================================================ -->
+     <!--- Create the Binary Distribution -->
+     <!-- ================================================================ -->
+     
+     <goal name="dist-bin" prereqs="default,javadoc">
+            
+            
+        <property name="dist.bin.root.file" value="${build.dist.dir}/dist-bin" 
/>
+       
+       <property name="dist.bin.file" 
value="${dist.bin.root.file}/${dist.name}-bin"/>
+       
+       <mkdir dir="${dist.bin.file}" />
+       
+       <mkdir dir="${dist.bin.file}/docs" />
+       
+       <mkdir dir="${dist.bin.file}/docs/apidocs"/>
+       
+       <mkdir dir="${dist.bin.file}/lib"/>
+       
+       <ant:copy todir="${dist.bin.file}/docs/apidocs">
+           <ant:fileset dir="target/docs/apidocs/">
+               <ant:include name="**"/>
+           </ant:fileset>
+        </ant:copy>
+       
+       <ant:copy file="target/${jar.file}" todir="${dist.bin.file}/lib" />
+       
+       
+       <ant:copy file="${license.file}" todir="${dist.bin.file}" />
+       
+       <ant:copy file="${readme.file}" todir="${dist.bin.file}" />
+       
+       <ant:copy file="${notice.file}" todir="${dist.bin.file}" />
+       
+       <ant:copy file="${authors.file}" todir="${dist.bin.file}" />
+        
+       <ant:copy file="${release.note.file}" todir="${dist.bin.file}" />
+       
+       <ant:zip destfile="${build.dist.dir}/${dist.name}-bin.zip" 
basedir="${dist.bin.root.file}"/>
+       
+       <ant:tar tarfile="${build.dist.dir}/${dist.name}-bin.tar" 
basedir="${dist.bin.root.file}"/>
+       
+       <ant:gzip src="${build.dist.dir}/${dist.name}-bin.tar" 
zipfile="${build.dist.dir}/${dist.name}-bin.tar.gz"/>
+       
+       <ant:delete file="${build.dist.dir}/${dist.name}-bin.tar"/>
+       
+       <ant:delete dir = "${dist.bin.root.file}"/>
+            
+    </goal>
+ 
 </project>

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/AbstractPolicyOperator.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/AbstractPolicyOperator.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/AbstractPolicyOperator.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/AbstractPolicyOperator.java
 Sun Nov 12 20:23:35 2006
@@ -107,7 +107,7 @@
                     exactlyOne.addPolicyComponent(all);
                     childComponentsList.add(exactlyOne);
                 }
-            } else if (policyComponent.getType() == Constants.TYPE_POLICYREF) {
+            } else if (policyComponent.getType() == Constants.TYPE_POLICY_REF) 
{
                 String uri = ((PolicyReference) policyComponent).getURI();
                 policyComponent = reg.lookup(uri);
                 

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/All.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/All.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/All.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/All.java
 Sun Nov 12 20:23:35 2006
@@ -26,14 +26,25 @@
  */
 public class All extends AbstractPolicyOperator {
     
+    /**
+     * Adds an assertion to its PolicyComponent list.
+     * 
+     * @param assertion the assertion to be added.
+     */
     public void addAssertion(Assertion assertion) {
         addPolicyComponent(assertion);
     }
 
+    /**
+     * Returns a <tt>List</tt> of it's PolicyComponents.
+     * 
+     * @return a List of it's PolicyComponents
+     */
     public List getAssertions() {
         return policyComponents;
     }
 
+    
     public void serialize(XMLStreamWriter writer) throws XMLStreamException {
         String prefix = writer.getPrefix(Constants.URI_POLICY_NS);
 
@@ -56,6 +67,9 @@
         writer.writeEndElement();
     }
 
+    /**
+     * Returns Constants.TYPE_ALL
+     */
     public short getType() {
         return Constants.TYPE_ALL;
     }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Constants.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Constants.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Constants.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Constants.java
 Sun Nov 12 20:23:35 2006
@@ -52,7 +52,7 @@
 
     public static final short TYPE_ALL = 0x3;
 
-    public static final short TYPE_POLICYREF = 0x4;
+    public static final short TYPE_POLICY_REF = 0x4;
 
     public static final short TYPE_ASSERTION = 0x5;
 

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/ExactlyOne.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/ExactlyOne.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/ExactlyOne.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/ExactlyOne.java
 Sun Nov 12 20:23:35 2006
@@ -52,6 +52,9 @@
         writer.writeEndElement();
     }
 
+    /**
+     * Returns Constants.TYPE_EXACTLYONE;
+     */
     public final short getType() {
         return Constants.TYPE_EXACTLYONE;
     }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Policy.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Policy.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Policy.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/Policy.java
 Sun Nov 12 20:23:35 2006
@@ -32,14 +32,41 @@
 
     private HashMap attributes = new HashMap();
 
+    /**
+     * Returns a Normalized version of self. If <tt>deep</tt> is set
+     * <tt>false</tt> then the assertions are not normalized and it returns a
+     * partially normalized version of self.
+     * 
+     * @param deep
+     *            a flag to indicate whether to normalize the assertions
+     * @return a PolicyComponent that is normalized version of self
+     */
     public PolicyComponent normalize(boolean deep) {
         return normalize(null, deep);
     }
 
+    /**
+     * Returns a normalized version of self.If <tt>deep</tt> is set
+     * <tt>false</tt> then the assertions are not normalized and it returns a
+     * partially normalized version of self.
+     * 
+     * @param reg
+     *            a PolicyRegistry from which the PolicyReferences are resolved
+     * @param deep
+     *            a flag to indicate whether to normalize the assertions
+     * @return a normalzied version of self
+     */
     public PolicyComponent normalize(PolicyRegistry reg, boolean deep) {
         return normalize(this, reg, deep);
     }
 
+    /**
+     * Returns a Policy that is the merge of specified Policy and self.
+     * 
+     * @param policy
+     *            the Policy to be merged with self
+     * @return a Policy that is the merge of the specified Policy and self
+     */
     public Policy merge(Policy policy) {
         Policy result = new Policy();
         result.addPolicyComponents(getPolicyComponents());
@@ -47,64 +74,73 @@
         return result;
     }
 
+    /**
+     * Throws an UnSupportedOpertionException. TODO for a next version.
+     */
     public Policy intersect(Policy policy) {
         throw new UnsupportedOperationException();
     }
 
+    /**
+     * Serializes the Policy to a XMLStreamWriter.
+     */
     public void serialize(XMLStreamWriter writer) throws XMLStreamException {
         String wspPrefix = writer.getPrefix(Constants.URI_POLICY_NS);
-       
+
         if (wspPrefix == null) {
             wspPrefix = Constants.ATTR_WSP;
             writer.setPrefix(wspPrefix, Constants.URI_POLICY_NS);
         }
-        
+
         String wsuPrefix = writer.getPrefix(Constants.URI_WSU_NS);
         if (wsuPrefix == null) {
             wsuPrefix = Constants.ATTR_WSU;
             writer.setPrefix(wsuPrefix, Constants.URI_WSU_NS);
         }
-        
-        writer.writeStartElement(wspPrefix, Constants.ELEM_POLICY, 
Constants.URI_POLICY_NS);
-        
+
+        writer.writeStartElement(wspPrefix, Constants.ELEM_POLICY,
+                Constants.URI_POLICY_NS);
+
         QName key;
         String prefix;
-         
+
         HashMap prefix2ns = new HashMap();
-        
-        for (Iterator iterator = getAttributes().keySet().iterator(); 
iterator.hasNext();) {
+
+        for (Iterator iterator = getAttributes().keySet().iterator(); iterator
+                .hasNext();) {
             key = (QName) iterator.next();
-            
+
             prefix = writer.getPrefix(key.getNamespaceURI());
-            if (prefix == null) { 
+            if (prefix == null) {
                 prefix = key.getPrefix();
-                
+
                 if (prefix != null) {
                     writer.setPrefix(prefix, key.getNamespaceURI());
                 }
             }
-            
+
             if (prefix != null) {
-                writer.writeAttribute(prefix, key.getNamespaceURI(), 
key.getLocalPart(), getAttribute(key));
+                writer.writeAttribute(prefix, key.getNamespaceURI(), key
+                        .getLocalPart(), getAttribute(key));
                 prefix2ns.put(prefix, key.getNamespaceURI());
-                
+
             } else {
-                writer.writeAttribute(key.getNamespaceURI(), 
key.getLocalPart(), getAttribute(key));
+                writer.writeAttribute(key.getNamespaceURI(),
+                        key.getLocalPart(), getAttribute(key));
             }
         }
-        
-        // writes xmlns:wsp=".." 
+
+        // writes xmlns:wsp=".."
         writer.writeNamespace(wspPrefix, Constants.URI_POLICY_NS);
-        
+
         String prefiX;
-        
-        for (Iterator iterator = prefix2ns.keySet().iterator(); 
iterator.hasNext();) {
+
+        for (Iterator iterator = prefix2ns.keySet().iterator(); iterator
+                .hasNext();) {
             prefiX = (String) iterator.next();
             writer.writeNamespace(prefiX, (String) prefix2ns.get(prefiX));
         }
-        
-        
-        
+
         PolicyComponent policyComponent;
 
         for (Iterator iterator = getPolicyComponents().iterator(); iterator
@@ -117,10 +153,22 @@
 
     }
 
+    /**
+     * Returns Constants.TYPE_POLICY
+     */
     public short getType() {
         return Constants.TYPE_POLICY;
     }
 
+    /**
+     * Returns an Iterator that will return a list of assertions correspond to 
a
+     * Policy alternative if any. The <tt>iterator.next()</tt> will return a
+     * list of assertions correspond to a Policy alternative if any and
+     * <tt>iterator.hasNext()</tt> will indicates whether there is another
+     * Policy alternative.
+     * 
+     * @return
+     */
     public Iterator getAlternatives() {
         return new PolicyIterator(this);
     }
@@ -149,30 +197,73 @@
         }
     }
 
+    /**
+     * Adds an attribute to self.
+     * 
+     * @param name
+     *            the name of the attribute
+     * @param value
+     *            the value of the attribute
+     */
     public void addAttribute(QName name, String value) {
         attributes.put(name, value);
     }
 
+    /**
+     * Returns the value of the attribute specified by the QName. Returns
+     * <tt>null</tt> if not present.
+     * 
+     * @param name
+     *            the QName of the attribute
+     * @return the value of the attribute specified by the QName
+     */
     public String getAttribute(QName name) {
         return (String) attributes.get(name);
     }
 
+    /**
+     * Returns a <tt>Map</tt> of all attributes of self.
+     * 
+     * @return a Map of all attributes of self
+     */
     public Map getAttributes() {
         return attributes;
     }
 
+    /**
+     * Sets the <tt>Name</tt> attribute of self.
+     * 
+     * @param name
+     *            the Name attribute of self
+     */
     public void setName(String name) {
         addAttribute(new QName("", Constants.ATTR_NAME), name);
     }
 
+    /**
+     * Returns the <tt>Name</tt> attribute of self.
+     * 
+     * @return the Name attribute of self
+     */
     public String getName() {
         return getAttribute(new QName("", Constants.ATTR_NAME));
     }
 
+    /**
+     * Sets the wsu:Id attribute of self.
+     * 
+     * @param id
+     *            the Id attribute of self
+     */
     public void setId(String id) {
         addAttribute(new QName(Constants.URI_WSU_NS, Constants.ATTR_ID), id);
     }
 
+    /**
+     * Returns the Id attribute of self.
+     * 
+     * @return the Id attribute of self
+     */
     public String getId() {
         return getAttribute(new QName(Constants.URI_WSU_NS, 
Constants.ATTR_ID));
     }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyEngine.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyEngine.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyEngine.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyEngine.java
 Sun Nov 12 20:23:35 2006
@@ -54,7 +54,10 @@
      * OMElement with the specified QName.
      * 
      * @param qname
+     *            the QName of the Assertion that the Builder can build
      * @param builder
+     *            the AssertionBuilder that can build assertions that of 
'qname'
+     *            type
      */
     public static void registerBuilder(QName qname, AssertionBuilder builder) {
         AssertionBuilderFactory.registerBuilder(qname, builder);
@@ -64,7 +67,8 @@
      * Creates a Policy object from an InputStream.
      * 
      * @param inputStream
-     * @return
+     *            the InputStream of the Policy
+     * @return a Policy object of the Policy that is fed as a InputStream
      */
     public static Policy getPolicy(InputStream inputStream) {
         try {
@@ -82,6 +86,13 @@
         return null;
     }
 
+    /**
+     * Creates a PolicyReference object.
+     * 
+     * @param inputStream
+     *            the InputStream of the PolicyReference
+     * @return a PolicyReference object of the PolicyReference
+     */
     public static PolicyReference getPolicyReferene(InputStream inputStream) {
 
         try {
@@ -102,14 +113,22 @@
 
     /**
      * Creates a Policy object from an OMElement.
-     *
+     * 
      * @param element
-     * @return
+     *            the Policy element
+     * @retun a Policy object of the Policy element
      */
     public static Policy getPolicy(OMElement element) {
         return getPolicyOperator(element);
     }
 
+    /**
+     * Creates a PolicyReference object from an OMElement.
+     * 
+     * @param element
+     *            the PolicyReference element
+     * @return a PolicyReference object of the PolicyReference element
+     */
     public static PolicyReference getPolicyReference(OMElement element) {
 
         if (!(Constants.URI_POLICY_NS.equals(element.getNamespace()
@@ -144,31 +163,33 @@
 
         if (Constants.TYPE_POLICY == operator.getType()) {
             Policy policyOperator = (Policy) operator;
-            
+
             OMAttribute attribute;
             OMNamespace namespace;
             QName key;
-            
-            for (Iterator iterator = operationElement.getAllAttributes(); 
iterator.hasNext(); ) {
+
+            for (Iterator iterator = operationElement.getAllAttributes(); 
iterator
+                    .hasNext();) {
                 attribute = (OMAttribute) iterator.next();
                 namespace = attribute.getNamespace();
-                
+
                 if (namespace == null) {
                     key = new QName(attribute.getLocalName());
-                    
+
                 } else if (namespace.getPrefix() == null) {
-                    key = new QName(namespace.getNamespaceURI(), 
attribute.getLocalName());
-                    
+                    key = new QName(namespace.getNamespaceURI(), attribute
+                            .getLocalName());
+
                 } else {
-                    key = new QName(namespace.getNamespaceURI(), 
attribute.getLocalName(), namespace.getPrefix());
+                    key = new QName(namespace.getNamespaceURI(), attribute
+                            .getLocalName(), namespace.getPrefix());
                 }
-                
+
                 policyOperator.addAttribute(key, 
attribute.getAttributeValue());
             }
         }
-        
+
         OMElement childElement;
-        
 
         for (Iterator iterator = operationElement.getChildElements(); iterator
                 .hasNext();) {
@@ -197,7 +218,7 @@
                 }
 
             } else {
-                    operator.addPolicyComponent(factory.build(childElement));
+                operator.addPolicyComponent(factory.build(childElement));
             }
         }
         return operator;

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyOperator.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyOperator.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyOperator.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyOperator.java
 Sun Nov 12 20:23:35 2006
@@ -18,11 +18,13 @@
 import java.util.List;
 
 /**
- * PolicyOperator is an interface that all Policy operators must implement.
+ * PolicyOperator is an interface that all Policy operators must implement. It
+ * can contain any number of Assertions or PolicyOperators and it has an
+ * implecit logic of how those PolicyComponents should be met.
  * 
  */
 public interface PolicyOperator extends PolicyComponent {
- 
+
     /**
      * Add a PolicyComponent to the PolicyOperator.
      * 
@@ -36,7 +38,7 @@
      * @return the List of PolicyComponents that this PolicyOperator contains.
      */
     public List getPolicyComponents();
-    
+
     /**
      * Returns true if the PolicyOperator doesn't contain any PolicyComponents.
      * 

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyReference.java
 Sun Nov 12 20:23:35 2006
@@ -25,10 +25,18 @@
 
     private String uri;
 
+    /**
+     * Sets the Policy URI
+     * @param uri the Policy URI
+     */
     public void setURI(String uri) {
         this.uri = uri;
     }
 
+    /**
+     * Gets the Policy URI that is refered by self.
+     * @return a String that is the Policy URI refered by self
+     */
     public String getURI() {
         return uri;
     }
@@ -37,14 +45,32 @@
         throw new UnsupportedOperationException("TODO");
     }
 
+
+    /**
+     * Returns short value of Constants.TYPE_POLICY_REF 
+     */
     public short getType() {
-        return Constants.TYPE_POLICYREF;
+        return Constants.TYPE_POLICY_REF;
     }
 
+    /**
+     * Throws an UnsupportedOperationException since 
PolicyReference.normalize()
+     * can't resolve the Policy that it refers to unless a PolicyRegistry is
+     * provided.
+     */
     public PolicyComponent normalize() {
         throw new UnsupportedOperationException("PolicyReference.normalize() 
is meaningless");
     }
     
+    /**
+     * Returns normalized version of the Policy that is refered by self. The 
specified 
+     * PolicyRegistry is used to lookup for the Policy that is refered and 
<tt>dee</tt> 
+     * indicates the level of normalization fo the returning Policy.
+     * 
+     * @param reg the PolicyRegistry that is used to resolved the Policy 
refered by self
+     * @param deep the falg to indicate whether returning Policy should be 
fully normailized
+     * @return the normalized version fo the Policy refered by self
+     */
     public PolicyComponent normalize(PolicyRegistry reg, boolean deep) {
         String key = getURI();
         if (key.startsWith("#")) {

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistry.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistry.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistry.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistry.java
 Sun Nov 12 20:23:35 2006
@@ -16,15 +16,38 @@
 package org.apache.neethi;
 
 /**
- * PolicyRegistry contains (URI,Policy) pairs and it is used to resolve 
explicit Policy references.
- *
+ * PolicyRegistry contains (URI,Policy) pairs and it is used to resolve 
explicit
+ * Policy references.
+ * 
  */
 public interface PolicyRegistry {
-    
+
+    /**
+     * Associates a key with a Policy
+     * 
+     * @param key
+     *            the key that the specified Policy to be associated
+     * @param policy
+     *            the policy to be associated with the key
+     */
     public void register(String key, Policy policy);
-    
+
+    /**
+     * Returns the Policy that the specified key is mapped. Retruns null if no
+     * Policy is associated with that key.
+     * 
+     * @param key
+     *            the key whose associated Policy is to be returned.
+     * @return the policy associated with the specified key.
+     */
     public Policy lookup(String key);
-    
+
+    /**
+     * Removes the mapping for this key if present.
+     * 
+     * @param key
+     *            the key whose mapping is to be removed
+     */
     public void remove(String key);
 
 }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/PolicyRegistryImpl.java
 Sun Nov 12 20:23:35 2006
@@ -29,6 +29,13 @@
     public PolicyRegistryImpl() {
     }
     
+    /**
+     * Constructs a PolicyRegistryImpl with the specified PolicyRegistry
+     * as it's parent. If it can't lookup a Policy in it's own registry
+     * then it lookup in the parent and returns the results.  
+     * 
+     * @param parent the Parent of this PolicyRegistry
+     */
     public PolicyRegistryImpl(PolicyRegistry parent) {
         this.parent = parent;
     }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/AssertionBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/AssertionBuilder.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/AssertionBuilder.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/AssertionBuilder.java
 Sun Nov 12 20:23:35 2006
@@ -34,8 +34,28 @@
  */
 public interface AssertionBuilder {
 
+    /**
+     * Constructs an assertion from a known OMElement. If that element contains
+     * other child elements that the Builder doesn't understand, it uses the
+     * AssertionBuilderFactory to construct assertions from them.
+     * 
+     * @param element
+     *            the known element from which an assertion can be built
+     * @param factory
+     *            the factory from which AssertionBuilders are taken to build
+     *            assertion from unknown child elements
+     * @return an Assertion built from the given element
+     * @throws IllegalArgumentException
+     *             if the given element is malformed
+     */
     public Assertion build(OMElement element, AssertionBuilderFactory factory)
             throws IllegalArgumentException;
-    
+
+    /**
+     * Returns an array of QNames of OMElements from which assertion can be
+     * built by this AssertionFactory.
+     * 
+     * @return an array of QNames of known OMElements
+     */
     public QName[] getKnownElements();
 }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XMLPrimitiveAssertionBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XMLPrimitiveAssertionBuilder.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XMLPrimitiveAssertionBuilder.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XMLPrimitiveAssertionBuilder.java
 Sun Nov 12 20:23:35 2006
@@ -24,11 +24,12 @@
 
 public class XMLPrimitiveAssertionBuilder implements AssertionBuilder {
 
-    public Assertion build(OMElement element, AssertionBuilderFactory factory) 
throws IllegalArgumentException {
+    public Assertion build(OMElement element, AssertionBuilderFactory factory)
+            throws IllegalArgumentException {
         return new XmlPrimtiveAssertion(element);
     }
-    
+
     public QName[] getKnownElements() {
-        return new QName[] {new QName("UnknownElement")};
+        return new QName[] { new QName("UnknownElement") };
     }
 }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XmlPrimtiveAssertion.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XmlPrimtiveAssertion.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XmlPrimtiveAssertion.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/builders/xml/XmlPrimtiveAssertion.java
 Sun Nov 12 20:23:35 2006
@@ -27,52 +27,69 @@
 import org.apache.neethi.ExactlyOne;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
-import org.apache.neethi.PolicyEngine;
 import org.apache.neethi.PolicyRegistry;
 
-import java.util.Iterator;
-
+/**
+ * XmlPrimitiveAssertion wraps an OMElement s.t. any unkown elements can be
+ * treated an assertions if there is no AssertionBuilder that can build an
+ * assertion from that OMElement.
+ * 
+ */
 public class XmlPrimtiveAssertion implements Assertion {
 
     OMElement element;
 
     boolean isOptional;
 
-    
-    // Assertions can contain policies inside it.
-    Policy policy;
-
+    /**
+     * Constructs a XmlPrimitiveAssertion from an OMElement.
+     * 
+     * @param element
+     *            the OMElement from which the XmlAssertion is constructed
+     */
     public XmlPrimtiveAssertion(OMElement element) {
         setValue(element);
         setOptionality(element);
     }
 
+    /**
+     * Returns the QName of the wrapped OMElement.
+     */
     public QName getName() {
         return (element != null) ? element.getQName() : null;
     }
 
+    /**
+     * Sets the wrapped OMElement.
+     * 
+     * @param element
+     *            the OMElement to be set as wrapped
+     */
     public void setValue(OMElement element) {
         this.element = element;
-        // get all the policy namespace children
-        // actually there can only be one nested policy
-        Iterator iter = element.getChildrenWithName(new 
QName(Constants.URI_POLICY_NS, Constants.ELEM_POLICY));
-        if (iter.hasNext()) {
-            OMElement policyOMElement = (OMElement) iter.next();
-            this.policy = PolicyEngine.getPolicy(policyOMElement);
-            // detach element from the om tree
-            policyOMElement.detach();
-        }
-
     }
 
+    /**
+     * Returns the wrapped OMElement.
+     * 
+     * @return the wrapped OMElement
+     */
     public OMElement getValue() {
         return element;
     }
 
+    /**
+     * Returns <tt>true</tt> if the wrapped element that assumed to be an
+     * assertion, is optional.
+     */
     public boolean isOptional() {
         return isOptional;
     }
 
+    /**
+     * Returns the partial normalized version of the wrapped OMElement, that is
+     * assumed to be an assertion.
+     */
     public PolicyComponent normalize() {
         if (isOptional) {
             Policy policy = new Policy();
@@ -81,7 +98,8 @@
             All all = new All();
             OMElement omElement = element.cloneOMElement();
 
-            
omElement.removeAttribute(omElement.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR));
+            omElement.removeAttribute(omElement
+                    .getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR));
             all.addPolicyComponent(new XmlPrimtiveAssertion(omElement));
             exactlyOne.addPolicyComponent(all);
 
@@ -94,71 +112,33 @@
         return this;
     }
 
+    /**
+     * Throws an UnsupportedOperationException since an assertion of an unknown
+     * element can't be fully normalized due to it's unkonwn composite.
+     */
     public PolicyComponent normalize(boolean isDeep) {
         throw new UnsupportedOperationException();
     }
 
-    public PolicyComponent normalize(PolicyRegistry registry) {
-
-        if (isOptional) {
-            Policy policy = new Policy();
-            ExactlyOne alternatives = new ExactlyOne();
-
-            All alternative1 = new All();
-            OMElement element1 = element.cloneOMElement();
-            
element1.removeAttribute(element1.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR));
-            alternative1.addPolicyComponent(new 
XmlPrimtiveAssertion(element1));
-            alternatives.addPolicyComponent(alternative1);
-
-            All alternative2 = new All();
-            alternatives.addPolicyComponent(alternative2);
-
-            policy.addPolicyComponent(alternatives);
-            return policy;
-        }
-        return this;
-    }
-
     public void serialize(XMLStreamWriter writer) throws XMLStreamException {
         if (element != null) {
-
-            if (policy != null) {
-                // write the start part of the element
-                String prefix = writer.getPrefix(element.getNamespace()
-                        .getNamespaceURI());
-                if (prefix == null) {
-                    writer.writeStartElement(element.getQName().getPrefix(),
-                            element.getQName().getLocalPart(), element
-                                    .getNamespace().getNamespaceURI());
-                    writer.writeNamespace(element.getQName().getPrefix(),
-                            element.getNamespace().getNamespaceURI());
-                    writer.setPrefix(element.getQName().getPrefix(), element
-                            .getNamespace().getNamespaceURI());
-
-                } else {
-                    writer.writeStartElement(element.getNamespace()
-                            .getNamespaceURI(), element.getQName()
-                            .getLocalPart());
-                }
-                // TODO : write attributes and inner elements
-                policy.serialize(writer);
-                writer.writeEndElement();
-            } else {
-                // we can not serialize as follows since OMElement seriali
-                element.serialize(writer);
-            }
+            element.serialize(writer);
 
         } else {
-            // TODO throw an exception??
+            throw new RuntimeException("Wrapped Element is not set");
         }
     }
 
+    /**
+     * Returns Constants.TYPE_ASSERTION
+     */
     public final short getType() {
         return Constants.TYPE_ASSERTION;
     }
 
     private void setOptionality(OMElement element) {
-        OMAttribute attribute = 
element.getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
+        OMAttribute attribute = element
+                .getAttribute(Constants.Q_ELEM_OPTIONAL_ATTR);
         if (attribute != null) {
             this.isOptional = (new Boolean(attribute.getAttributeValue())
                     .booleanValue());
@@ -175,5 +155,4 @@
 
         return getName().equals(((Assertion) policyComponent).getName());
     }
-
 }

Modified: 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java?view=diff&rev=474136&r1=474135&r2=474136
==============================================================================
--- 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java
 (original)
+++ 
webservices/commons/trunk/modules/neethi/src/main/java/org/apache/neethi/util/PolicyComparator.java
 Sun Nov 12 20:23:35 2006
@@ -24,14 +24,38 @@
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
 
+/**
+ * A Utility class that provides methods the check the equality of
+ * PolicyComponents.
+ * 
+ */
 public class PolicyComparator {
 
+    /**
+     * Returns <tt>true</tt> if the two policies have the same semantics
+     * 
+     * @param arg1
+     *            a Policy
+     * @param arg2
+     *            an another Policy
+     * @return <tt>true</tt> if both policies have the same semantics
+     */
     public static boolean compare(Policy arg1, Policy arg2) {
         return compare(arg1.getPolicyComponents(), arg2.getPolicyComponents());
     }
-    
+
+    /**
+     * Returns <tt>true</tt> if the two PolicyComponents have the same
+     * semantics.
+     * 
+     * @param arg1
+     *            a PolicyComponent
+     * @param arg2
+     *            an another PolicyComponent
+     * @return <tt>true</tt> if both PolicyComponents have the same semantics
+     */
     public static boolean compare(PolicyComponent arg1, PolicyComponent arg2) {
-        if (! arg1.getClass().equals(arg2.getClass())) {
+        if (!arg1.getClass().equals(arg2.getClass())) {
             return false;
         }
 
@@ -39,11 +63,10 @@
             return compare((Policy) arg1, (Policy) arg2);
 
         } else if (arg1 instanceof All) {
-            return compare((All) arg1,(All) arg2);
+            return compare((All) arg1, (All) arg2);
 
         } else if (arg1 instanceof ExactlyOne) {
-            return compare((ExactlyOne) arg1,
-                    (ExactlyOne) arg2);
+            return compare((ExactlyOne) arg1, (ExactlyOne) arg2);
 
         } else if (arg1 instanceof Assertion) {
             return compare((Assertion) arg1, (Assertion) arg2);
@@ -55,18 +78,15 @@
         return false;
     }
 
-    public static boolean compare(All arg1,
-            All arg2) {
+    public static boolean compare(All arg1, All arg2) {
         return compare(arg1.getPolicyComponents(), arg2.getPolicyComponents());
     }
 
-    public static boolean compare(ExactlyOne arg1,
-            ExactlyOne arg2) {
+    public static boolean compare(ExactlyOne arg1, ExactlyOne arg2) {
         return compare(arg1.getPolicyComponents(), arg2.getPolicyComponents());
     }
 
-    public static boolean compare(Assertion arg1,
-            Assertion arg2) {
+    public static boolean compare(Assertion arg1, Assertion arg2) {
         if (!(arg1.getName().equals(arg2.getName()))) {
             return false;
         }
@@ -77,7 +97,7 @@
         if (arg1.size() != arg2.size()) {
             return false;
         }
-        
+
         Iterator iterator = arg1.iterator();
         PolicyComponent assertion1;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to