1 /*
   2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3  *
   4  * This code is free software; you can redistribute it and/or modify it
   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 /*
  26  * This file is available under and governed by the GNU General Public
  27  * License version 2 only, as published by the Free Software Foundation.
  28  * However, the following notice accompanied the original version of this
  29  * file and, per its terms, should not be removed:
  30  *
  31  * Copyright (c) 2004 World Wide Web Consortium,
  32  *
  33  * (Massachusetts Institute of Technology, European Research Consortium for
  34  * Informatics and Mathematics, Keio University). All Rights Reserved. This
  35  * work is distributed under the W3C(r) Software License [1] in the hope that
  36  * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  37  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  38  *
  39  * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  40  */
  41 
  42 package org.w3c.dom;
  43 
  44 /**
  45  * This interface represents a known entity, either parsed or unparsed, in an
  46  * XML document. Note that this models the entity itself <em>not</em> the entity declaration.
  47  * <p>The <code>nodeName</code> attribute that is inherited from
  48  * <code>Node</code> contains the name of the entity.
  49  * <p>An XML processor may choose to completely expand entities before the
  50  * structure model is passed to the DOM; in this case there will be no
  51  * <code>EntityReference</code> nodes in the document tree.
  52  * <p>XML does not mandate that a non-validating XML processor read and
  53  * process entity declarations made in the external subset or declared in
  54  * parameter entities. This means that parsed entities declared in the
  55  * external subset need not be expanded by some classes of applications, and
  56  * that the replacement text of the entity may not be available. When the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#intern-replacement'>
  57  * replacement text</a> is available, the corresponding <code>Entity</code> node's child list
  58  * represents the structure of that replacement value. Otherwise, the child
  59  * list is empty.
  60  * <p>DOM Level 3 does not support editing <code>Entity</code> nodes; if a
  61  * user wants to make changes to the contents of an <code>Entity</code>,
  62  * every related <code>EntityReference</code> node has to be replaced in the
  63  * structure model by a clone of the <code>Entity</code>'s contents, and
  64  * then the desired changes must be made to each of those clones instead.
  65  * <code>Entity</code> nodes and all their descendants are readonly.
  66  * <p>An <code>Entity</code> node does not have any parent.
  67  * <p ><b>Note:</b> If the entity contains an unbound namespace prefix, the
  68  * <code>namespaceURI</code> of the corresponding node in the
  69  * <code>Entity</code> node subtree is <code>null</code>. The same is true
  70  * for <code>EntityReference</code> nodes that refer to this entity, when
  71  * they are created using the <code>createEntityReference</code> method of
  72  * the <code>Document</code> interface.
  73  * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
  74  */
  75 public interface Entity extends Node {
  76     /**
  77      * The public identifier associated with the entity if specified, and
  78      * <code>null</code> otherwise.
  79      */
  80     public String getPublicId();
  81 
  82     /**
  83      * The system identifier associated with the entity if specified, and
  84      * <code>null</code> otherwise. This may be an absolute URI or not.
  85      */
  86     public String getSystemId();
  87 
  88     /**
  89      * For unparsed entities, the name of the notation for the entity. For
  90      * parsed entities, this is <code>null</code>.
  91      */
  92     public String getNotationName();
  93 
  94     /**
  95      * An attribute specifying the encoding used for this entity at the time
  96      * of parsing, when it is an external parsed entity. This is
  97      * <code>null</code> if it an entity from the internal subset or if it
  98      * is not known.
  99      * @since 1.5, DOM Level 3
 100      */
 101     public String getInputEncoding();
 102 
 103     /**
 104      * An attribute specifying, as part of the text declaration, the encoding
 105      * of this entity, when it is an external parsed entity. This is
 106      * <code>null</code> otherwise.
 107      * @since 1.5, DOM Level 3
 108      */
 109     public String getXmlEncoding();
 110 
 111     /**
 112      * An attribute specifying, as part of the text declaration, the version
 113      * number of this entity, when it is an external parsed entity. This is
 114      * <code>null</code> otherwise.
 115      * @since 1.5, DOM Level 3
 116      */
 117     public String getXmlVersion();
 118 
 119 }