View Javadoc

1   /*
2    * Copyright 2008 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.xacml.ctx.impl;
18  
19  import java.util.ArrayList;
20  import java.util.Collections;
21  import java.util.List;
22  
23  import org.opensaml.xacml.ctx.AttributeValueType;
24  import org.opensaml.xacml.ctx.MissingAttributeDetailType;
25  import org.opensaml.xml.XMLObject;
26  import org.opensaml.xml.util.XMLObjectChildrenList;
27  import org.opensaml.xml.validation.AbstractValidatingXMLObject;
28  
29  /** Concrete implementation of {@link MissingAttributeDetailType}. */
30  public class MissingAttributeDetailTypeImpl extends AbstractValidatingXMLObject implements MissingAttributeDetailType {
31  
32      /** Lists of the attribute values in details. */
33      private XMLObjectChildrenList<AttributeValueType> attributeValues;
34  
35      /** ID of the attribute. */
36      private String attributeId;
37  
38      /** Data type of the attribute. */
39      private String dataType;
40  
41      /** Issuer of the attribute. */
42      private String issuer;
43  
44      /**
45       * Constructor.
46       * 
47       * @param namespaceURI the namespace the element is in
48       * @param elementLocalName the local name of the XML element this Object represents
49       * @param namespacePrefix the prefix for the given namespace
50       */
51      protected MissingAttributeDetailTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
52          super(namespaceURI, elementLocalName, namespacePrefix);
53          attributeValues = new XMLObjectChildrenList<AttributeValueType>(this);
54      }
55  
56      /** {@inheritDoc} */
57      public String getAttributeId() {
58          return attributeId;
59      }
60  
61      /** {@inheritDoc} */
62      public List<AttributeValueType> getAttributeValues() {
63          return attributeValues;
64      }
65  
66      /** {@inheritDoc} */
67      public String getDataType() {
68          return dataType;
69      }
70  
71      /** {@inheritDoc} */
72      public String getIssuer() {
73          return issuer;
74      }
75  
76      /** {@inheritDoc} */
77      public List<XMLObject> getOrderedChildren() {
78          ArrayList<XMLObject> children = new ArrayList<XMLObject>();
79          
80          children.addAll(attributeValues);
81          
82          return Collections.unmodifiableList(children);
83      }
84  
85      /** {@inheritDoc} */
86      public void setAttributeId(String id) {
87          attributeId = prepareForAssignment(attributeId, id);
88      }
89  
90      /** {@inheritDoc} */
91      public void setDataType(String type) {
92          dataType = prepareForAssignment(dataType, type);
93      }
94  
95      /** {@inheritDoc} */
96      public void setIssuer(String issuer) {
97          this.issuer = prepareForAssignment(this.issuer, issuer);
98      }
99  }