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.wssecurity.impl;
18  
19  import org.opensaml.ws.wssecurity.AttributedURI;
20  import org.opensaml.xml.util.AttributeMap;
21  
22  /**
23   * Implementation of {@link AttributedURI}.
24   */
25  public class AttributedURIImpl extends AbstractWSSecurityObject implements AttributedURI {
26      
27      /** The string value. */
28      private String value;
29      
30      /** The wsu:Id attribute value. */
31      private String id;
32      
33      /** The wildcard attributes. */
34      private AttributeMap attributes;
35      
36      /**
37       * Constructor.
38       * 
39       * @param namespaceURI namespace of the element
40       * @param elementLocalName name of the element
41       * @param namespacePrefix namespace prefix of the element
42       */
43      public AttributedURIImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
44          super(namespaceURI, elementLocalName, namespacePrefix);
45          attributes = new AttributeMap(this);
46      }
47  
48      /** {@inheritDoc} */
49      public String getValue() {
50          return value;
51      }
52  
53      /** {@inheritDoc} */
54      public void setValue(String newValue) {
55          value = prepareForAssignment(value, newValue);
56      }
57  
58      /** {@inheritDoc} */
59      public String getWSUId() {
60          return id;
61      }
62  
63      /** {@inheritDoc} */
64      public void setWSUId(String newId) {
65          String oldId = id;
66          id = prepareForAssignment(id, newId);
67          registerOwnID(oldId, id);
68      }
69  
70      /** {@inheritDoc} */
71      public AttributeMap getUnknownAttributes() {
72          return attributes;
73      }
74  
75  }