1. /*
  2. * Copyright (c) 2004 World Wide Web Consortium,
  3. *
  4. * (Massachusetts Institute of Technology, European Research Consortium for
  5. * Informatics and Mathematics, Keio University). All Rights Reserved. This
  6. * work is distributed under the W3C(r) Software License [1] in the hope that
  7. * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. *
  10. * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  11. */
  12. package org.w3c.dom;
  13. /**
  14. * This interface represents a known entity, either parsed or unparsed, in an
  15. * XML document. Note that this models the entity itself <em>not</em> the entity declaration.
  16. * <p>The <code>nodeName</code> attribute that is inherited from
  17. * <code>Node</code> contains the name of the entity.
  18. * <p>An XML processor may choose to completely expand entities before the
  19. * structure model is passed to the DOM; in this case there will be no
  20. * <code>EntityReference</code> nodes in the document tree.
  21. * <p>XML does not mandate that a non-validating XML processor read and
  22. * process entity declarations made in the external subset or declared in
  23. * parameter entities. This means that parsed entities declared in the
  24. * external subset need not be expanded by some classes of applications, and
  25. * 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'>
  26. * replacement text</a> is available, the corresponding <code>Entity</code> node's child list
  27. * represents the structure of that replacement value. Otherwise, the child
  28. * list is empty.
  29. * <p>DOM Level 3 does not support editing <code>Entity</code> nodes; if a
  30. * user wants to make changes to the contents of an <code>Entity</code>,
  31. * every related <code>EntityReference</code> node has to be replaced in the
  32. * structure model by a clone of the <code>Entity</code>'s contents, and
  33. * then the desired changes must be made to each of those clones instead.
  34. * <code>Entity</code> nodes and all their descendants are readonly.
  35. * <p>An <code>Entity</code> node does not have any parent.
  36. * <p ><b>Note:</b> If the entity contains an unbound namespace prefix, the
  37. * <code>namespaceURI</code> of the corresponding node in the
  38. * <code>Entity</code> node subtree is <code>null</code>. The same is true
  39. * for <code>EntityReference</code> nodes that refer to this entity, when
  40. * they are created using the <code>createEntityReference</code> method of
  41. * the <code>Document</code> interface.
  42. * <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>.
  43. */
  44. public interface Entity extends Node {
  45. /**
  46. * The public identifier associated with the entity if specified, and
  47. * <code>null</code> otherwise.
  48. */
  49. public String getPublicId();
  50. /**
  51. * The system identifier associated with the entity if specified, and
  52. * <code>null</code> otherwise. This may be an absolute URI or not.
  53. */
  54. public String getSystemId();
  55. /**
  56. * For unparsed entities, the name of the notation for the entity. For
  57. * parsed entities, this is <code>null</code>.
  58. */
  59. public String getNotationName();
  60. /**
  61. * An attribute specifying the encoding used for this entity at the time
  62. * of parsing, when it is an external parsed entity. This is
  63. * <code>null</code> if it an entity from the internal subset or if it
  64. * is not known.
  65. * @since DOM Level 3
  66. */
  67. public String getInputEncoding();
  68. /**
  69. * An attribute specifying, as part of the text declaration, the encoding
  70. * of this entity, when it is an external parsed entity. This is
  71. * <code>null</code> otherwise.
  72. * @since DOM Level 3
  73. */
  74. public String getXmlEncoding();
  75. /**
  76. * An attribute specifying, as part of the text declaration, the version
  77. * number of this entity, when it is an external parsed entity. This is
  78. * <code>null</code> otherwise.
  79. * @since DOM Level 3
  80. */
  81. public String getXmlVersion();
  82. }