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 22package com.sun.org.apache.xerces.internal.impl.xs; 23 24import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl; 25import com.sun.org.apache.xerces.internal.xs.XSAnnotation; 26import com.sun.org.apache.xerces.internal.xs.XSConstants; 27import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem; 28import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration; 29import com.sun.org.apache.xerces.internal.xs.XSObjectList; 30 31/** 32 * The XML representation for a NOTATION declaration 33 * schema component is a global <notation> element information item 34 * 35 * @xerces.internal 36 * 37 * @author Rahul Srivastava, Sun Microsystems Inc. 38 */ 39public class XSNotationDecl implements XSNotationDeclaration { 40 41 // name of the group 42 public String fName = null; 43 // target namespace of the group 44 public String fTargetNamespace = null; 45 // public id of the notation 46 public String fPublicId = null; 47 // system id of the notation 48 public String fSystemId = null; 49 50 // optional annotation 51 public XSObjectList fAnnotations = null; 52 53 // The namespace schema information item corresponding to the target namespace 54 // of the notation declaration, if it is globally declared; or null otherwise. 55 private XSNamespaceItem fNamespaceItem = null; 56 57 /** 58 * Get the type of the object, i.e ELEMENT_DECLARATION. 59 */ 60 public short getType() { 61 return XSConstants.NOTATION_DECLARATION; 62 } 63 64 /** 65 * The <code>name</code> of this <code>XSObject</code> depending on the 66 * <code>XSObject</code> type. 67 */ 68 public String getName() { 69 return fName; 70 } 71 72 /** 73 * The namespace URI of this node, or <code>null</code> if it is 74 * unspecified. defines how a namespace URI is attached to schema 75 * components. 76 */ 77 public String getNamespace() { 78 return fTargetNamespace; 79 } 80 81 /** 82 * Optional if {public identifier} is present. A URI reference. 83 */ 84 public String getSystemId() { 85 return fSystemId; 86 } 87 88 /** 89 * Optional if {system identifier} is present. A public identifier, 90 * as defined in [XML 1.0 (Second Edition)]. 91 */ 92 public String getPublicId() { 93 return fPublicId; 94 } 95 96 /** 97 * Optional. Annotation. 98 */ 99 public XSAnnotation getAnnotation() { 100 return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null; 101 } 102 103 /** 104 * Optional. Annotations. 105 */ 106 public XSObjectList getAnnotations() { 107 return (fAnnotations != null) ? fAnnotations : XSObjectListImpl.EMPTY_LIST; 108 } 109 110 /** 111 * @see org.apache.xerces.xs.XSObject#getNamespaceItem() 112 */ 113 public XSNamespaceItem getNamespaceItem() { 114 return fNamespaceItem; 115 } 116 117 void setNamespaceItem(XSNamespaceItem namespaceItem) { 118 fNamespaceItem = namespaceItem; 119 } 120 121} // class XSNotationDecl 122