View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements. See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership. The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License. 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,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied. See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.ws.commons.schema;
21  
22  import org.w3c.dom.Attr;
23  
24  /**
25   * The base class for any element that can contain annotation elements.
26   */
27  
28  public class XmlSchemaAnnotated extends XmlSchemaObject {
29      /**
30       * Defines an annotation.
31       * Creates an annotation element.
32       * Represents the W3C annotation element.
33       */
34      XmlSchemaAnnotation annotation;
35      String id;
36  
37      // Stores qualified attributes that do not belong to the schema target namespace.
38      public Attr[] unhandledAttributes;
39  
40  
41      /**
42       * Creates new XmlSchemaAnnotated
43       */
44      public XmlSchemaAnnotated() {
45      }
46  
47      public String getId() {
48          return id;
49      }
50  
51      public void setId(String id) {
52          this.id = id;
53      }
54  
55      public XmlSchemaAnnotation getAnnotation() {
56          return annotation;
57      }
58  
59      public void setAnnotation(XmlSchemaAnnotation annotation) {
60          this.annotation = annotation;
61      }
62  
63      public Attr[] getUnhandledAttributes() {
64          return unhandledAttributes;
65      }
66  
67      public void setUnhandledAttributes(Attr[] unhandledAttributes) {
68          this.unhandledAttributes = unhandledAttributes;
69      }
70      
71      public String toString() {
72      	if (id == null)
73      		return super.toString();
74      	else
75      		return super.toString() + " [id:" + id + "]";
76      }
77  
78  }
79