View Javadoc

1   /*
2    * Copyright 2009 University Corporation for Advanced Internet Development, Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.opensaml.ws.wsaddressing.impl;
18  
19  import org.opensaml.ws.wsaddressing.RelatesTo;
20  import org.opensaml.xml.schema.impl.XSURIImpl;
21  import org.opensaml.xml.util.AttributeMap;
22  
23  /**
24   * Implementation of {@link RelatesTo}.
25   */
26  public class RelatesToImpl extends XSURIImpl implements RelatesTo {
27      
28      /** RelationshipType attribute value. */
29      private String relationshipType;
30      
31      /** Wildcard attributes. */
32      private AttributeMap unknownAttributes;
33  
34      /**
35       * Constructor.
36       * 
37       * @param namespaceURI The namespace of the element
38       * @param elementLocalName The local name of the element
39       * @param namespacePrefix The namespace prefix of the element
40       */
41      public RelatesToImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
42          super(namespaceURI, elementLocalName, namespacePrefix);
43          unknownAttributes = new AttributeMap(this);
44          // Default attribute value per the schema.
45          setRelationshipType(RELATIONSHIP_TYPE_REPLY);
46      }
47  
48      /** {@inheritDoc} */
49      public String getRelationshipType() {
50          return relationshipType;
51      }
52  
53      /** {@inheritDoc} */
54      public void setRelationshipType(String newRelationshipType) {
55          relationshipType = prepareForAssignment(relationshipType, newRelationshipType);
56      }
57  
58      /** {@inheritDoc} */
59      public AttributeMap getUnknownAttributes() {
60          return unknownAttributes;
61      }
62  
63  }