KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > impl > xs > traversers > XSAnnotationInfo


1 /*
2  * Copyright 2004 The Apache Software Foundation.
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 package com.sun.org.apache.xerces.internal.impl.xs.traversers;
17
18 import org.w3c.dom.Element JavaDoc;
19 import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl;
20
21 /**
22  * Objects of this class contain the textual representation of
23  * an XML schema annotation as well as information on the location
24  * of the annotation in the document it originated from.
25  *
26  * @xerces.internal
27  *
28  * @author Michael Glavassevich, IBM
29  * @version $Id: XSAnnotationInfo.java,v 1.1.4.1 2005/09/09 07:48:53 sunithareddy Exp $
30  */

31 final class XSAnnotationInfo {
32
33     /** Textual representation of annotation. **/
34     String JavaDoc fAnnotation;
35     
36     /** Line number of <annotation> element. **/
37     int fLine;
38     
39     /** Column number of <annotation> element. **/
40     int fColumn;
41     
42     /** Character offset of <annotation> element. **/
43     int fCharOffset;
44     
45     /** Next annotation. **/
46     XSAnnotationInfo next;
47     
48     XSAnnotationInfo(String JavaDoc annotation, int line, int column, int charOffset) {
49         fAnnotation = annotation;
50         fLine = line;
51         fColumn = column;
52         fCharOffset = charOffset;
53     }
54     
55     XSAnnotationInfo(String JavaDoc annotation, Element JavaDoc annotationDecl) {
56         fAnnotation = annotation;
57         if (annotationDecl instanceof ElementImpl) {
58             final ElementImpl annotationDeclImpl = (ElementImpl) annotationDecl;
59             fLine = annotationDeclImpl.getLineNumber();
60             fColumn = annotationDeclImpl.getColumnNumber();
61             fCharOffset = annotationDeclImpl.getCharacterOffset();
62         }
63         else {
64             fLine = -1;
65             fColumn = -1;
66             fCharOffset = -1;
67         }
68     }
69 } // XSAnnotationInfo
70
Popular Tags