You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2007/01/16 14:37:42 UTC

svn commit: r496683 - in /webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl: PropertyMetadata.java SimpleMetadataDescriptor.java

Author: danj
Date: Tue Jan 16 05:37:40 2007
New Revision: 496683

URL: http://svn.apache.org/viewvc?view=rev&rev=496683
Log:
Forgot to add setter methods for modifiability/mutability, per MUSE-179.

Modified:
    webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/PropertyMetadata.java
    webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/SimpleMetadataDescriptor.java

Modified: webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/PropertyMetadata.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/PropertyMetadata.java?view=diff&rev=496683&r1=496682&r2=496683
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/PropertyMetadata.java (original)
+++ webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/PropertyMetadata.java Tue Jan 16 05:37:40 2007
@@ -119,61 +119,14 @@
     //
     private String _valueUpperBound = null;
     
-    public PropertyMetadata(QName qname, int modifiability, int mutability)
-    {
-        if (qname == null)
-            throw new NullPointerException(_MESSAGES.get("NullPropertyName"));
-        
-        if (modifiability != READ_ONLY && modifiability != READ_WRITE)
-        {
-            Object[] filler = { qname, new Integer(modifiability) };
-            throw new RuntimeException(_MESSAGES.get("InvalidModifiability", filler));
-        }
-        
-        if (mutability != CONSTANT && mutability != APPENDABLE && mutability != MUTABLE)
-        {
-            Object[] filler = { qname, new Integer(mutability) };
-            throw new RuntimeException(_MESSAGES.get("InvalidMutability", filler));
-        }
-        
-        _qname = qname;
-        _modifiability = modifiability;
-        _mutability = mutability;
-    }
-    
     public PropertyMetadata(QName qname, String modifiability, String mutability)
     {
         if (qname == null)
             throw new NullPointerException(_MESSAGES.get("NullPropertyName"));
 
         _qname = qname;
-        
-        if (modifiability.equalsIgnoreCase(WsrmdConstants.READ_ONLY))
-            _modifiability = READ_ONLY;
-        
-        else if (modifiability.equalsIgnoreCase(WsrmdConstants.READ_WRITE))
-            _modifiability = READ_WRITE;
-        
-        else
-        {
-            Object[] filler = { _qname, modifiability };
-            throw new RuntimeException(_MESSAGES.get("InvalidModifiability", filler));
-        }
-        
-        if (mutability.equalsIgnoreCase(WsrmdConstants.CONSTANT))
-            _mutability = CONSTANT;
-        
-        else if (mutability.equalsIgnoreCase(WsrmdConstants.APPENDABLE))
-            _mutability = APPENDABLE;
-        
-        else if (mutability.equalsIgnoreCase(WsrmdConstants.MUTABLE))
-            _mutability = MUTABLE;
-        
-        else
-        {
-            Object[] filler = { _qname, mutability };
-            throw new RuntimeException(_MESSAGES.get("InvalidMutability", filler));
-        }
+        setModifiability(modifiability);
+        setMutability(mutability);
     }
     
     /**
@@ -501,6 +454,39 @@
     public void setLowerBound(String value)
     {
         _valueLowerBound = value;
+    }
+    
+    public void setModifiability(String value)
+    {
+        if (value.equalsIgnoreCase(WsrmdConstants.READ_ONLY))
+            _modifiability = READ_ONLY;
+        
+        else if (value.equalsIgnoreCase(WsrmdConstants.READ_WRITE))
+            _modifiability = READ_WRITE;
+        
+        else
+        {
+            Object[] filler = { _qname, value };
+            throw new RuntimeException(_MESSAGES.get("InvalidModifiability", filler));
+        }
+    }
+    
+    public void setMutability(String value)
+    {
+        if (value.equalsIgnoreCase(WsrmdConstants.CONSTANT))
+            _mutability = CONSTANT;
+        
+        else if (value.equalsIgnoreCase(WsrmdConstants.APPENDABLE))
+            _mutability = APPENDABLE;
+        
+        else if (value.equalsIgnoreCase(WsrmdConstants.MUTABLE))
+            _mutability = MUTABLE;
+        
+        else
+        {
+            Object[] filler = { _qname, value };
+            throw new RuntimeException(_MESSAGES.get("InvalidMutability", filler));
+        }
     }
     
     public void setStaticValues(Collection values)

Modified: webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/SimpleMetadataDescriptor.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/SimpleMetadataDescriptor.java?view=diff&rev=496683&r1=496682&r2=496683
==============================================================================
--- webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/SimpleMetadataDescriptor.java (original)
+++ webservices/muse/trunk/modules/muse-wsrf-impl/src/org/apache/muse/ws/resource/metadata/impl/SimpleMetadataDescriptor.java Tue Jan 16 05:37:40 2007
@@ -361,6 +361,16 @@
         getProperty(property).setLowerBound(value);
     }
 
+    public void setModifiability(QName property, String value)
+    {
+        getProperty(property).setModifiability(value);
+    }
+
+    public void setMutability(QName property, String value)
+    {
+        getProperty(property).setMutability(value);
+    }
+
     public void setStaticValues(QName property, Collection values)
         throws SoapFault
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org