Path: blob/master/src/java.xml/share/classes/org/w3c/dom/Entity.java
40948 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* This file is available under and governed by the GNU General Public26* License version 2 only, as published by the Free Software Foundation.27* However, the following notice accompanied the original version of this28* file and, per its terms, should not be removed:29*30* Copyright (c) 2004 World Wide Web Consortium,31*32* (Massachusetts Institute of Technology, European Research Consortium for33* Informatics and Mathematics, Keio University). All Rights Reserved. This34* work is distributed under the W3C(r) Software License [1] in the hope that35* it will be useful, but WITHOUT ANY WARRANTY; without even the implied36* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.37*38* [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-2002123139*/4041package org.w3c.dom;4243/**44* This interface represents a known entity, either parsed or unparsed, in an45* XML document. Note that this models the entity itself <em>not</em> the entity declaration.46* <p>The <code>nodeName</code> attribute that is inherited from47* <code>Node</code> contains the name of the entity.48* <p>An XML processor may choose to completely expand entities before the49* structure model is passed to the DOM; in this case there will be no50* <code>EntityReference</code> nodes in the document tree.51* <p>XML does not mandate that a non-validating XML processor read and52* process entity declarations made in the external subset or declared in53* parameter entities. This means that parsed entities declared in the54* external subset need not be expanded by some classes of applications, and55* 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'>56* replacement text</a> is available, the corresponding <code>Entity</code> node's child list57* represents the structure of that replacement value. Otherwise, the child58* list is empty.59* <p>DOM Level 3 does not support editing <code>Entity</code> nodes; if a60* user wants to make changes to the contents of an <code>Entity</code>,61* every related <code>EntityReference</code> node has to be replaced in the62* structure model by a clone of the <code>Entity</code>'s contents, and63* then the desired changes must be made to each of those clones instead.64* <code>Entity</code> nodes and all their descendants are readonly.65* <p>An <code>Entity</code> node does not have any parent.66* <p ><b>Note:</b> If the entity contains an unbound namespace prefix, the67* <code>namespaceURI</code> of the corresponding node in the68* <code>Entity</code> node subtree is <code>null</code>. The same is true69* for <code>EntityReference</code> nodes that refer to this entity, when70* they are created using the <code>createEntityReference</code> method of71* the <code>Document</code> interface.72* <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>.73*/74public interface Entity extends Node {75/**76* The public identifier associated with the entity if specified, and77* <code>null</code> otherwise.78*/79public String getPublicId();8081/**82* The system identifier associated with the entity if specified, and83* <code>null</code> otherwise. This may be an absolute URI or not.84*/85public String getSystemId();8687/**88* For unparsed entities, the name of the notation for the entity. For89* parsed entities, this is <code>null</code>.90*/91public String getNotationName();9293/**94* An attribute specifying the encoding used for this entity at the time95* of parsing, when it is an external parsed entity. This is96* <code>null</code> if it an entity from the internal subset or if it97* is not known.98* @since 1.5, DOM Level 399*/100public String getInputEncoding();101102/**103* An attribute specifying, as part of the text declaration, the encoding104* of this entity, when it is an external parsed entity. This is105* <code>null</code> otherwise.106* @since 1.5, DOM Level 3107*/108public String getXmlEncoding();109110/**111* An attribute specifying, as part of the text declaration, the version112* number of this entity, when it is an external parsed entity. This is113* <code>null</code> otherwise.114* @since 1.5, DOM Level 3115*/116public String getXmlVersion();117118}119120121