throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
  public Entity declareEntity(String name,                              String publicId,                              String systemId,                              String notation)  {    DomEntity entity;        if (name.charAt(0) == '%' || "[dtd]".equals(name))      {        return null;      }    if (isReadonly())      {        throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);      }    getEntities();        DomDocument.checkName(name, (owner != null) ?                          "1.1".equals(owner.getXmlVersion()) : false);    if (entities.getNamedItem(name) != null)      {        return null;      }        entity = new DomEntity(owner, name, publicId, systemId, notation);    entities.setNamedItem(entity);    return entity;  }