1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2001-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.impl.xs;
  22 
  23 import com.sun.org.apache.xerces.internal.impl.xs.util.XSObjectListImpl;
  24 import com.sun.org.apache.xerces.internal.xs.XSAnnotation;
  25 import com.sun.org.apache.xerces.internal.xs.XSConstants;
  26 import com.sun.org.apache.xerces.internal.xs.XSNamespaceItem;
  27 import com.sun.org.apache.xerces.internal.xs.XSNotationDeclaration;
  28 import com.sun.org.apache.xerces.internal.xs.XSObjectList;
  29 
  30 /**
  31  * The XML representation for a NOTATION declaration
  32  * schema component is a global <notation> element information item
  33  *
  34  * @xerces.internal
  35  *
  36  * @author Rahul Srivastava, Sun Microsystems Inc.
  37  * @version $Id: XSNotationDecl.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
  38  */
  39 public 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