Author: jkaputin
Date: Tue Mar 20 16:17:22 2007
New Revision: 520647

URL: http://svn.apache.org/viewvc?view=rev&rev=520647
Log:
WODEN-148 Removed deprecated methods from the old
version of HTTPLocation, prior to this JIRA.

Modified:
    
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java

Modified: 
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java?view=diff&rev=520647&r1=520646&r2=520647
==============================================================================
--- 
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java
 (original)
+++ 
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java
 Tue Mar 20 16:17:22 2007
@@ -75,9 +75,6 @@
  */
 public class HTTPLocation {
     
-    private String fLocationTemplate;       //deprecated by WODEN-148
-    private String fDerivedLocation = null; //deprecated by WODEN-148
-    
     private String fOriginalLocation;
     boolean fValid = true;
     
@@ -164,10 +161,6 @@
      */
     public String toString() {
         
-        if(fDerivedLocation != null) {
-            return fDerivedLocation;
-        }
-        
         StringBuffer buffer = new StringBuffer();
         Object currToken;
         HTTPLocationTemplate template;
@@ -191,9 +184,7 @@
             }
         }
         
-        fDerivedLocation = buffer.toString();
-        
-        return fDerivedLocation;
+        return buffer.toString();
     }
     
     /**
@@ -639,414 +630,5 @@
         
         fParsedList = tokens;
     }
-    
-    
//===============================================================================
-   
-    /*
-     * The following methods are deprecated from Woden M7. JIRA WODEN-148 has 
modified the way
-     * HTTP location template is treated and has introduced a new type, 
HTTPLocationTemplate,
-     * and new methods to access this type.  Once we have confirmed this new 
approach is
-     * suitable and functionally correct, the following deprecated methods 
will be removed
-     * (i.e. prior to Woden M8)
-     */
-
-    
//===============================================================================
-
-    /**
-     * Returns true if the format of the the {http location} property prior to 
any
-     * template substitution is valid, otherwise false.
-     * 
-     * TODO add more javadoc 
-     * @deprecated by WODEN-148
-     */
-    public boolean isTemplateValid() {
-        return fValid;
-    }
-    
-    /**
-     * Returns the original value of the HTTP location, prior to any template 
-     * substitution of element local names enclosed in curly braces with 
element values.
-     * If the property was parsed from a WSDL document, this will be the value 
of the 
-     * <code>whttp:location</code> attribute within a binding operation 
element.
-     * 
-     * @deprecated by WODEN-148
-     */
-    public String getLocationTemplate() {
-        return fLocationTemplate;
-    }
-    
-    /**
-     * Returns a String array containing the element local names that appear
-     * enclosed in curly braces in the location template, in the order that 
they
-     * appear in the template. Note that if a local name appears multiple 
times in
-     * the template, multiple corresponding occurrences will be present in the 
array.
-     * 
-     * @return a String array containing all element local names from the 
template
-     * 
-     * @deprecated by WODEN-148
-     */
-    public String[] getLocalNames() {
-        
-        List names = new Vector();
-        Object next;
-        String[] elem;
-        
-        Iterator it = fParsedList.iterator();
-        while(it.hasNext()) {
-            next = it.next();
-            if(next instanceof String[]) {
-                elem = (String[]) next;
-                names.add(elem[0]);
-            }
-        }
-        
-        String[] array = new String[names.size()];
-        names.toArray(array);
-        return array;
-    }
-    
-    /**
-     * Returns a String array containing the distinct element local names that 
appear
-     * enclosed in curly braces in the location template, in the order that 
they appear 
-     * in the template. If a local name appears multiple times in the template,
-     * only the first occurrence will be present in the array.
-     * 
-     * @return a String array containing the distinct element local names from 
the template
-     * 
-     * @deprecated by WODEN-148
-     */
-    public String[] getDistinctLocalNames() {
-        
-        List names = new Vector();
-        Object next;
-        String[] elem;
-        
-        Iterator it = fParsedList.iterator();
-        while(it.hasNext()) {
-            next = it.next();
-            if(next instanceof String[]) {
-                elem = (String[]) next;
-                String name = elem[0];
-                if(!names.contains(name)) {
-                    names.add(name);
-                }
-            }
-        }
-        
-        String[] array = new String[names.size()];
-        names.toArray(array);
-        return array;
-    }
-    
-    /**
-     * Counts the number of element local names enclosed in curly braces 
within the location template. 
-     * This is equal to <code>getLocalNames().length</code>.
-     * 
-     * @return the number of occurrences of <code>localName</code>
-     * 
-     * @deprecated by WODEN-148
-     */
-    public int countLocalNames() {
-        
-        Object next;
-        int count = 0;
-        
-        Iterator it = fParsedList.iterator();
-        while(it.hasNext()) {
-            next = it.next();
-            if(next instanceof String[]) {
-                count++;
-            }
-        }
-        
-        return count;
-    }
-    
-    /**
-     * Counts the occurrences of the specified element local name enclosed in 
curly braces
-     * within the location template.
-     * A null argument will return zero.
-     * 
-     * @param localName the local name of an element from the instance data of 
the message
-     * @return the number of occurrences of <code>localName</code>
-     * 
-     * @deprecated by WODEN-148
-     */
-    public int countOccurrences(String localName) {
-        
-        int count = 0;
-        Object next;
-        String[] elem;
-        
-        if(localName != null) {
-            Iterator it = fParsedList.iterator();
-            while(it.hasNext()) {
-                next = it.next();
-                if(next instanceof String[]) {
-                    elem = (String[]) next;
-                    if (elem[0].equals(localName)) {
-                        count++;
-                    }
-                }
-            }
-        }
-        
-        return count;
-    }
-    
-    //TODO public void substitute(String localName, int occurrence, String 
value) {}, required?
-    
-    /**
-     * Substitute the specified element local name and its enclosing curly 
braces within the
-     * location template with the specified String value of that element. 
-     * Note, this method assumes a single occurrence only of the specified 
local name, so if 
-     * if the local name appears multiple times in the template only the first 
occurrence 
-     * will be substituted. It does not handle multiple substitution.
-     * 
-     * @param localName the local name of an element from the instance data of 
the message
-     * @param value the value to be substitute for <code>localName</code>
-     * 
-     * @deprecated by WODEN-148
-     */
-    public void substitute(String localName, String value) {
-        
-        substitute(localName, value, false);
-    }
-    
-    /**
-     * Substitute either the first occurrence or all occurrences of the 
specified element local name
-     * and its enclosing curly braces within the location template with the 
specified String value 
-     * of that element. 
-     * If the <code>allOccurrences</code> argument is <it>false</it> only the 
first occurrence 
-     * of the specified local name will be substituted (this is the same 
behaviour as the method 
-     * <code>substitute(String localName, String value)</code>). If it is true 
-     * then all occurrences will be substituted with the specified value.
-     * 
-     * @param localName the local name of an element from the instance data of 
the message
-     * @param value the value to be substitute for <code>localName</code>
-     * @param allOccurrences indicates whether to substitute all occurrences 
of <code>localName</code> 
-     *        or just the first
-     * 
-     * //TODO determine if this method is actually needed and if not, remove 
it.
-     * 
-     * @deprecated by WODEN-148
-     */
-    public void substitute(String localName, String value, boolean 
allOccurrences) {
-        
-        if(localName == null) {
-            //TODO throw NPE?
-            return;
-        }
-        fDerivedLocation = null; //flush the cached value
-        
-        Object next;
-        String[] elem;
-        Iterator it = fParsedList.iterator();
-        while(it.hasNext()) {
-            next = it.next();
-            if(next instanceof String[]) {
-                elem = (String[])next;
-                if(elem[0].equals(localName)) {
-                    elem[1] = value;
-                    if(!allOccurrences) {
-                        break;
-                    }
-                }
-            }
-        }
-        
-    }
-
-    /**
-     * Substitute the occurrences of the specified element local name and its 
enclosing curly braces
-     * within the location template with the values contained in the specified 
String array, in the
-     * order they appear. 
-     * The size of the array should be equal to the number of occurrences of 
the local name appearing 
-     * within the template (i.e. equal to the result of the 
<code>countOccurrences(String localName)</code> 
-     * method).
-     * If it is shorter, any additional local name occurrences in the template 
will be ignored.
-     * If it is longer, any additional values in the array will be ignored.
-     * <p>
-     * A null element in the array will remove any previously substituted 
value for the 
-     * corresponding occurrence of the local name within the template.
-     * 
-     * @param localName the local name of an element from the instance data of 
the message
-     * @param values a String array containing the values to be substituted 
for occurrences of 
-     *               <code>localName</code>, in order.
-     *               
-     * @deprecated by WODEN-148
-     */
-    public void substitute(String localName, String[] values) {
-        
-        if(localName == null || values == null) {
-            //TODO throw NPE?
-            return;
-        }
-        fDerivedLocation = null; //flush the cached value
-        
-        Object next;
-        String[] elem;
-        int i = 0;
-        Iterator it = fParsedList.iterator();
-        while(it.hasNext() && i<values.length) {
-            next = it.next();
-            if(next instanceof String[]) {
-                elem = (String[])next;
-                if(elem[0].equals(localName)) {
-                    elem[1] = values[i];
-                    i++;
-                }
-            }
-        }
-
-    }
-    
-    /**
-     * Substitute the element local names and their enclosing curly braces 
within the location 
-     * template with the values contained in the specified String array, in 
the order they appear.
-     * The size of the array should be equal to the number of local names 
appearing within the 
-     * template (i.e. equal to the result of the 
<code>countLocalNames()</code> method).
-     * If it is shorter, any additional local names in the template will be 
ignored.
-     * If it is longer, any additional values in the array will be ignored.
-     * <p>
-     * A null element in the array will remove any previously substituted 
value for the 
-     * corresponding local name within the template.
-     * 
-     * @param values a String array containing the values to be substituted 
for any occurrences of an
-     *               element local name within the template, in order.
-     * 
-     * @deprecated by WODEN-148
-     */
-    public void substitute(String[] values) {
-        
-        if(values == null) {
-            //TODO throw NPE?
-            return;
-        }
-        fDerivedLocation = null; //flush the cached value
-
-        Object next;
-        String[] elem;
-        int i = 0;
-        Iterator it = fParsedList.iterator();
-        while(it.hasNext() && i<values.length) {
-            next = it.next();
-            if(next instanceof String[]) {
-                elem = (String[])next;
-                elem[1] = values[i];
-                i++;
-            }
-        }
-        
-    }
-
-    /**
-     * Return the String value associated with the specified element local 
name.
-     * If template substitution has already happened via any of the 
-     * <code>substitute</code> methods, this String should represent the value 
of 
-     * some element from the instance data of the message. If substitution has 
not 
-     * yet happened, a null value is returned.
-     * <p>
-     * Note, this method assumes a single occurrence of the specified local 
name
-     * within the template. If the local name appears multiple times in the 
template,
-     * the method returns the value associated with the first occurrence of 
this
-     * local name.
-     * 
-     * @param localName the local name of an element from the instance data of 
the message
-     * @return the String value associated with <code>localName</code>
-     * 
-     * @deprecated by WODEN-148
-     */
-    public String getValue(String localName) {
-        
-        Object next;
-        String[] elem;
-        String value = null;
-      
-        if(localName != null) {
-            Iterator it = fParsedList.iterator();
-            while (it.hasNext()) {
-                next = it.next();
-                if (next instanceof String[]) {
-                    elem = (String[]) next;
-                    if (elem[0].equals(localName)) {
-                        value = elem[1];
-                        break;
-                    }
-                }
-            }
-        }
-        
-        return value;
-    }
-    
-    /**
-     * Returns a String array containing the values associated with occurrences
-     * of the specified element local name, in the order they appear within 
the template.
-     * If template substitution has already happened via any of the 
-     * <code>substitute</code> methods, each String should represent the value 
of 
-     * some element from the instance data of the message. If substitution has 
not 
-     * yet happened for some occurrence of the local name, the corresponding
-     * array element will be null.
-     * 
-     * @param localName the local name of an element from the instance data of 
the message
-     * @return an array of String values associated with occurrences of 
<code>localName</code>
-     * @deprecated by WODEN-148
-     */
-    public String[] getValues(String localName) {
-        
-        List values = new Vector();
-        Object next;
-        String[] elem;
-        
-        if(localName != null) {
-            Iterator it = fParsedList.iterator();
-            while (it.hasNext()) {
-                next = it.next();
-                if (next instanceof String[]) {
-                    elem = (String[]) next;
-                    if (elem[0].equals(localName)) {
-                        values.add(elem[1]);
-                    }
-                }
-            }
-        }
-        
-        String[] array = new String[values.size()];
-        values.toArray(array);
-        return array;
-    }
-    
-    /**
-     * Returns a String array containing the values associated with all 
element local names,
-     * in the order they appear within the template.
-     * If template substitution has already happened via any of the 
-     * <code>substitute</code> methods, each String should represent the value 
of 
-     * some element from the instance data of the message. If substitution has 
not 
-     * yet happened for a local name, the corresponding array element will be 
null.
-     * 
-     * @return an array of String values associated with element local names 
within the template
-     * @deprecated by WODEN-148
-     */
-    public String[] getValues() {
-        
-        List values = new Vector();
-        Object next;
-        String[] elem;
-        
-        Iterator it = fParsedList.iterator();
-        while (it.hasNext()) {
-            next = it.next();
-            if (next instanceof String[]) {
-                elem = (String[]) next;
-                values.add(elem[1]);
-            }
-        }
-        
-        String[] array = new String[values.size()];
-        values.toArray(array);
-        return array;
-    }
-
     
 }



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

Reply via email to