View Javadoc
1   /*
2    * reserved comment block
3    * DO NOT REMOVE OR ALTER!
4    */
5   /*
6    * Copyright 2003,2004 The Apache Software Foundation.
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   *      http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS,
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   * See the License for the specific language governing permissions and
18   * limitations under the License.
19   */
20  
21  package com.sun.org.apache.xerces.internal.xs;
22  
23  /**
24   * This interface represents the Annotation schema component.
25   */
26  public interface XSAnnotation extends XSObject {
27      // TargetType
28      /**
29       * The object type is <code>org.w3c.dom.Element</code>.
30       */
31      public static final short W3C_DOM_ELEMENT           = 1;
32      /**
33       * The object type is <code>org.xml.sax.ContentHandler</code>.
34       */
35      public static final short SAX_CONTENTHANDLER        = 2;
36      /**
37       * The object type is <code>org.w3c.dom.Document</code>.
38       */
39      public static final short W3C_DOM_DOCUMENT          = 3;
40  
41      /**
42       *  Write contents of the annotation to the specified object. If the
43       * specified <code>target</code> is a DOM object, in-scope namespace
44       * declarations for <code>annotation</code> element are added as
45       * attribute nodes of the serialized <code>annotation</code>, otherwise
46       * the corresponding events for all in-scope namespace declarations are
47       * sent via the specified document handler.
48       * @param target  A target pointer to the annotation target object, i.e.
49       *   <code>org.w3c.dom.Document</code>, <code>org.w3c.dom.Element</code>
50       *   , <code>org.xml.sax.ContentHandler</code>.
51       * @param targetType  A target type.
52       * @return  True if the <code>target</code> is a recognized type and
53       *   supported by this implementation, otherwise false.
54       */
55      public boolean writeAnnotation(Object target,
56                                     short targetType);
57  
58      /**
59       * A text representation of the annotation.
60       */
61      public String getAnnotationString();
62  
63  }