1 /* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5 /* 6 * Licensed to the Apache Software Foundation (ASF) under one or more 7 * contributor license agreements. See the NOTICE file distributed with 8 * this work for additional information regarding copyright ownership. 9 * The ASF licenses this file to You under the Apache License, Version 2.0 10 * (the "License"); you may not use this file except in compliance with 11 * the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 package com.sun.org.apache.xerces.internal.impl.xs.traversers; 23 24 import org.w3c.dom.Element; 25 import com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl; 26 27 /** 28 * Objects of this class contain the textual representation of 29 * an XML schema annotation as well as information on the location 30 * of the annotation in the document it originated from. 31 * 32 * @xerces.internal 33 * 34 * @author Michael Glavassevich, IBM 35 */ 36 final class XSAnnotationInfo { 37 38 /** Textual representation of annotation. **/ 39 String fAnnotation; 40 41 /** Line number of <annotation> element. **/ 42 int fLine; 43 44 /** Column number of <annotation> element. **/ 45 int fColumn; 46 47 /** Character offset of <annotation> element. **/ 48 int fCharOffset; 49 50 /** Next annotation. **/ 51 XSAnnotationInfo next; 52 53 XSAnnotationInfo(String annotation, int line, int column, int charOffset) { 54 fAnnotation = annotation; 55 fLine = line; 56 fColumn = column; 57 fCharOffset = charOffset; 58 } 59 60 XSAnnotationInfo(String annotation, Element annotationDecl) { 61 fAnnotation = annotation; 62 if (annotationDecl instanceof ElementImpl) { 63 final ElementImpl annotationDeclImpl = (ElementImpl) annotationDecl; 64 fLine = annotationDeclImpl.getLineNumber(); 65 fColumn = annotationDeclImpl.getColumnNumber(); 66 fCharOffset = annotationDeclImpl.getCharacterOffset(); 67 } 68 else { 69 fLine = -1; 70 fColumn = -1; 71 fCharOffset = -1; 72 } 73 } 74 } // XSAnnotationInfo