Author: jkaputin
Date: Mon Apr 23 07:34:07 2007
New Revision: 531482
URL: http://svn.apache.org/viewvc?view=rev&rev=531482
Log:
Improved javadoc.
Modified:
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java
Modified:
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java
URL:
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java?view=diff&rev=531482&r1=531481&r2=531482
==============================================================================
---
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java
(original)
+++
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java
Mon Apr 23 07:34:07 2007
@@ -18,40 +18,47 @@
/**
- * This class represents the curly brace template syntax used within the
- * <code>whttp:location</code> extension attribute and the {http location}
extension property.
- * That is, it represents an element cited in the HTTP location by enclosing
the element's
- * local name within curly braces. There are two types of template syntax;
<it>encoded</it>
- * templates (which must be percent-encoded in the resulting URI) have the
syntax "{localname}",
- * whereas <it>raw</it> templates (which are not percent-encoded) have the
exclamated syntax
- * "{!localname}".
+ * This class represents a template specified within the HTTP Location string
used as the value
+ * of the <code>whttp:location</code> extension attribute. The template cites
an element from
+ * the instance data of the message to be serialized in the request IRI by
enclosing the element's
+ * local name in curly braces. The template is then matched against an element
in the instance
+ * data and replaced in the HTTP Location string by that element's String
value.
* <p>
- * For example, in the encoded template "{accountBalance}", accountBalance is
the local name
- * of an element from the instance data. This template could appear in an HTTP
location such as
- * "?balance={accountBalance}", which represents a URI query string with one
query parameter,
- * 'balance', and a templated parameter value which will be substituted with
the value
- * of the element <accountBalance> from the instance data.
+ * For example, the template "{postcode}" is matched to the instance data
element
+ * <postcode>90210</postcode> and the String value "90210"
replaces "{postcode}"
+ * in the formatted HTTP Location string.
+ * <p>
+ * The WSDL 2.0 HTTP binding extension requires certain encoding be performed
on the content of
+ * the HTTP Location string. Templates of the form "{localname}" are called
<it>encoded</it>
+ * templates because these encoding rules also apply to any element values
substituted
+ * for these templates. A <it>raw</it> template is used to indicate that
encoding is not to
+ * be performed on the substituted value. Raw templates are identified by the
exclamated curly
+ * brace syntax "{!localname}".
+ * <p>
+ * A template that appears in the HTTP Location String before the first
occurrence of '?' is
+ * in the URI Path portion of the HTTP Location. One that appears after the
first occurrence of
+ * '?' is in the URI Query portion.
* <p>
* This class has a single constructor which takes three parameters that
indicate the local name
- * of the element cited in the template, whether the template is encoded or
raw and whether the
- * template appears in the path or the query string.
- * This template is immutable (i.e. there is no setter method to change the
template represented
- * by this class).
+ * of the element cited in the template, whether the template is encoded and
whether it appears
+ * in the Query portion of the HTTP Location.
* <p>
- * This class has the following characteristics:
+ * The class has the following characteristics:
* <ul>
* <li>
* It returns the element local name cited by the template.
* </li>
* <li>
- * It accepts a String value for the cited element.
+ * It does not permit the cited element name to be modified.
+ * </li>
+ * <li>
+ * It accepts a String value for the element cited by the template.
* </li>
* <li>
* It differentiates an encoded template from a raw template.
* </li>
* <li>
- * It differentiates a template that occurs in the path from one that occurs
in the query portion
- * of the HTTP location (i.e. before or after the first "?" character).
+ * It differentiates a template that appears in the Path from one that appears
in the Query.
* </li>
* </ul>
*
@@ -65,13 +72,15 @@
private boolean fIsQuery;
/**
- * This constructor creates an HTTPLocationTemplate object.
+ * Creates an HTTP Location template that cites the specified element. The
three parameters must
+ * be specified, they cannot be null.
*
* @param name a String representing the local name of the element cited
by this template.
* @param isEncoded a boolean value 'true' if it is an encoded template or
'false' if it is a
* raw template.
- * @param isQuery a boolean value 'true' if the template appears in the
query string or 'false' if
- * it appears in the path (i.e. before the first occurrence of "?").
+ * @param isQuery a boolean value 'true' if the template appears in the
URI Query portion of the
+ * HTTP Location string or 'false' if it appears in the URI Path.
+ * So 'true' means it appears after first occurrence of '?'.
*/
public HTTPLocationTemplate(String name, boolean isEncoded, boolean
isQuery) {
@@ -82,22 +91,45 @@
fIsQuery = isQuery;
}
+ /**
+ * Returns a String representing the local name of the element cited by
this template.
+ */
public String getName() {
return fName;
}
+ /**
+ * Returns a String representing the value of the element cited by this
template.
+ */
public String getValue() {
return fValue;
}
+ /**
+ * Sets the String value of the element cited by this template. This is
the String
+ * substituted for the template in the formatted HTTP Location string.
+ *
+ * @param value the cited element's String value
+ */
public void setValue(String value) {
fValue = value;
}
+ /**
+ * Returns 'true' if the template is encoded, otherwise 'false'.
+ * That is, 'true' if it is of the form "{localname}".
+ * So, 'false' indicates a 'raw' template of the form "{!localname}".
+ */
public boolean isEncoded() {
return fIsEncoded;
}
+ /**
+ * Returns 'true' if the template appears in the URI Query portion of the
HTTP Location string,
+ * otherwise false. That is, 'true' if it appears after the first
occurrence of '?'.
+ * So, 'false' indicates a template that appears in the URI Path portion
of the HTTP Location
+ * string.
+ */
public boolean isQuery() {
return fIsQuery;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]