View Javadoc

1   /*
2    * Copyright [2006] [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.saml2.core.impl;
18  
19  import java.util.List;
20  
21  import org.opensaml.common.impl.AbstractSAMLObject;
22  import org.opensaml.saml2.core.NameIDType;
23  import org.opensaml.xml.XMLObject;
24  
25  /**
26   * Abstract implementation of {@link org.opensaml.saml2.core.NameIDType}.
27   */
28  public class AbstractNameIDType extends AbstractSAMLObject implements NameIDType {
29  
30      /** Name of the Name ID. */
31      private String name;
32      
33      /** Name Qualifier of the Name ID. */
34      private String nameQualifier;
35  
36      /** SP Name Qualifier of the Name ID. */
37      private String spNameQualifier;
38  
39      /** Format of the Name ID. */
40      private String format;
41  
42      /** SP ProvidedID of the NameID. */
43      private String spProvidedID;
44  
45      /**
46       * Constructor.
47       * 
48       * @param namespaceURI the namespace the element is in
49       * @param elementLocalName the local name of the XML element this Object represents
50       * @param namespacePrefix the prefix for the given namespace
51       */
52      protected AbstractNameIDType(String namespaceURI, String elementLocalName, String namespacePrefix) {
53          super(namespaceURI, elementLocalName, namespacePrefix);
54      }
55  
56      /** {@inheritDoc} */
57      public String getValue() {
58          return name;
59      }
60      
61      /** {@inheritDoc} */
62      public void setValue(String newName) {
63          this.name = prepareForAssignment(this.name, newName);
64      }
65      
66      /** {@inheritDoc} */
67      public String getNameQualifier() {
68          return nameQualifier;
69      }
70  
71      /** {@inheritDoc} */
72      public void setNameQualifier(String newNameQualifier) {
73          this.nameQualifier = prepareForAssignment(this.nameQualifier, newNameQualifier);
74      }
75  
76      /** {@inheritDoc} */
77      public String getSPNameQualifier() {
78          return spNameQualifier;
79      }
80  
81      /** {@inheritDoc} */
82      public void setSPNameQualifier(String newSPNameQualifier) {
83          this.spNameQualifier = prepareForAssignment(this.spNameQualifier, newSPNameQualifier);
84      }
85  
86      /** {@inheritDoc} */
87      public String getFormat() {
88          return format;
89      }
90  
91      /** {@inheritDoc} */
92      public void setFormat(String newFormat) {
93          this.format = prepareForAssignment(this.format, newFormat);
94      }
95  
96      /** {@inheritDoc} */
97      public String getSPProvidedID() {
98          return spProvidedID;
99      }
100 
101     /** {@inheritDoc} */
102     public void setSPProvidedID(String newSPProvidedID) {
103         this.spProvidedID = prepareForAssignment(this.spProvidedID, newSPProvidedID);
104     }
105 
106     /** {@inheritDoc} */
107     public List<XMLObject> getOrderedChildren() {
108         return null;
109     }
110 }