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