Author: jkaputin
Date: Fri Mar 9 17:16:23 2007
New Revision: 516632
URL: http://svn.apache.org/viewvc?view=rev&rev=516632
Log:
WODEN-148 modified HTTPLocation to support changes
to spec under CR117
Added:
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java
Added:
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=auto&rev=516632
==============================================================================
---
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java
(added)
+++
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java
Fri Mar 9 17:16:23 2007
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.woden.wsdl20.extensions.http;
+
+
+/**
+ * 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}".
+ * <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.
+ * <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).
+ * <p>
+ * This 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.
+ * </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).
+ * </li>
+ * </ul>
+ *
+ * @author John Kaputin ([EMAIL PROTECTED])
+ */
+public class HTTPLocationTemplate {
+
+ private String fName;
+ private String fValue = null;
+ private boolean fIsEncoded;
+ private boolean fIsQuery;
+
+ /**
+ * This constructor creates an HTTPLocationTemplate object.
+ *
+ * @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 "?").
+ */
+ public HTTPLocationTemplate(String name, boolean isEncoded, boolean
isQuery) {
+
+ //TODO - check syntax, not null, not empty string...throw IllegalArgExc
+
+ fName = name;
+ fIsEncoded = isEncoded;
+ fIsQuery = isQuery;
+ }
+
+ public String getName() {
+ return fName;
+ }
+
+ public String getValue() {
+ return fValue;
+ }
+
+ public void setValue(String value) {
+ fValue = value;
+ }
+
+ public boolean isEncoded() {
+ return fIsEncoded;
+ }
+
+ public boolean isQuery() {
+ return fIsQuery;
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]