org.apache.woden.wsdl20.extensions.http

## Class HTTPLocationTemplate

- java.lang.Object
- - org.apache.woden.wsdl20.extensions.http.HTTPLocationTemplate

-     public class HTTPLocationTemplate
      extends Object

  This class represents a template specified within the HTTP Location string used as the value of the `whttp:location` 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.

  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.

  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 encoded templates because these encoding rules also apply to any element values substituted for these templates. A raw 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}".

  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.

  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 and whether it appears in the Query portion of the HTTP Location.

  The class has the following characteristics:

  - It returns the element local name cited by the template.
  - It does not permit the cited element name to be modified.
  - It accepts a String value for the element cited by the template.
  - It differentiates an encoded template from a raw template.
  - It differentiates a template that appears in the Path from one that appears in the Query.
  Author:
    John Kaputin (jkaputin@apache.org)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HTTPLocationTemplate(String name, boolean isEncoded, boolean isQuery)` Creates an HTTP Location template that cites the specified element.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName()` Returns a String representing the local name of the element cited by this template.
    `String` | `getValue()` Returns a String representing the value of the element cited by this template.
    `boolean` | `isEncoded()` Returns 'true' if the template is encoded, otherwise 'false'.
    `boolean` | `isQuery()` Returns 'true' if the template appears in the URI Query portion of the HTTP Location string, otherwise false.
    `void` | `setValue(String value)` Sets the String value of the element cited by this template.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HTTPLocationTemplate

          public HTTPLocationTemplate(String name,
                              boolean isEncoded,
                              boolean isQuery)

      Creates an HTTP Location template that cites the specified element. The three parameters must be specified, they cannot be null.
      Parameters:
        `name` - a String representing the local name of the element cited by this template.
        `isEncoded` - a boolean value 'true' if it is an encoded template or 'false' if it is a raw template.
        `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 '?'.

  - ### Method Detail

    - #### getName

          public String getName()

      Returns a String representing the local name of the element cited by this template.

    - #### getValue

          public String getValue()

      Returns a String representing the value of the element cited by this template.

    - #### setValue

          public void setValue(String value)

      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.
      Parameters:
        `value` - the cited element's String value

    - #### isEncoded

          public boolean isEncoded()

      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}".

    - #### isQuery

          public boolean isQuery()

      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.

Copyright ? Apache Software Foundation. All Rights Reserved.