View Javadoc

1   /*
2   Copyright 2008 Members of the EGEE Collaboration.
3   Copyright 2008 University Corporation for Advanced Internet Development,
4   Inc.
5   
6   Licensed under the Apache License, Version 2.0 (the "License");
7   you may not use this file except in compliance with the License.
8   You may obtain a copy of the License at
9   
10      http://www.apache.org/licenses/LICENSE-2.0
11  
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17   */
18  
19  package org.opensaml.xacml.ctx.impl;
20  
21  import java.util.ArrayList;
22  import java.util.Collections;
23  import java.util.List;
24  
25  import javax.xml.namespace.QName;
26  
27  import org.opensaml.xacml.ctx.StatusCodeType;
28  import org.opensaml.xacml.ctx.StatusDetailType;
29  import org.opensaml.xml.XMLObject;
30  import org.opensaml.xml.util.IndexedXMLObjectChildrenList;
31  import org.opensaml.xml.validation.AbstractValidatingXMLObject;
32  
33  /** Concrete implementation of {@link StatusCodeType}. */
34  public class StatusDetailTypeImpl extends AbstractValidatingXMLObject implements StatusDetailType {
35  
36      /** "any" children. */
37      private IndexedXMLObjectChildrenList<XMLObject> unknownChildren;
38  
39      /**
40       * Constructor.
41       * 
42       * @param namespaceURI the namespace the element is in
43       * @param elementLocalName the local name of the XML element this Object represents
44       * @param namespacePrefix the prefix for the given namespace
45       */
46      protected StatusDetailTypeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
47          super(namespaceURI, elementLocalName, namespacePrefix);
48          unknownChildren = new IndexedXMLObjectChildrenList<XMLObject>(this);
49      }
50  
51      /** {@inheritDoc} */
52      public List<XMLObject> getOrderedChildren() {
53          ArrayList<XMLObject> children = new ArrayList<XMLObject>();
54          
55          children.addAll(unknownChildren);
56  
57          return Collections.unmodifiableList(children);
58      }
59  
60      /** {@inheritDoc} */
61      public List<XMLObject> getUnknownXMLObjects() {
62          return unknownChildren;
63      }
64  
65      /** {@inheritDoc} */
66      public List<XMLObject> getUnknownXMLObjects(QName typeOrName) {
67          return (List<XMLObject>) unknownChildren.subList(typeOrName);
68      }
69  }