Source for org.w3c.dom.css.CSSCharsetRule

   1: /*
   2:  * Copyright (c) 2000 World Wide Web Consortium,
   3:  * (Massachusetts Institute of Technology, Institut National de
   4:  * Recherche en Informatique et en Automatique, Keio University). All
   5:  * Rights Reserved. This program is distributed under the W3C's Software
   6:  * Intellectual Property License. This program is distributed in the
   7:  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
   8:  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
   9:  * PURPOSE.
  10:  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11:  */
  12: 
  13: package org.w3c.dom.css;
  14: 
  15: import org.w3c.dom.DOMException;
  16: 
  17: /**
  18:  *  The <code>CSSCharsetRule</code> interface represents a @charset rule in a
  19:  * CSS style sheet. The value of the <code>encoding</code> attribute does
  20:  * not affect the encoding of text data in the DOM objects; this encoding is
  21:  * always UTF-16. After a stylesheet is loaded, the value of the
  22:  * <code>encoding</code> attribute is the value found in the
  23:  * <code>@charset</code> rule. If there was no <code>@charset</code> in the
  24:  * original document, then no <code>CSSCharsetRule</code> is created. The
  25:  * value of the <code>encoding</code> attribute may also be used as a hint
  26:  * for the encoding used on serialization of the style sheet.
  27:  * <p> The value of the @charset rule (and therefore of the
  28:  * <code>CSSCharsetRule</code>) may not correspond to the encoding the
  29:  * document actually came in; character encoding information e.g. in an HTTP
  30:  * header, has priority (see CSS document representation) but this is not
  31:  * reflected in the <code>CSSCharsetRule</code>.
  32:  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
  33:  * @since DOM Level 2
  34:  */
  35: public interface CSSCharsetRule extends CSSRule {
  36:     /**
  37:      *  The encoding information used in this <code>@charset</code> rule.
  38:      */
  39:     public String getEncoding();
  40:     /**
  41:      *  The encoding information used in this <code>@charset</code> rule.
  42:      * @exception DOMException
  43:      *   SYNTAX_ERR: Raised if the specified encoding value has a syntax error
  44:      *   and is unparsable.
  45:      *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is
  46:      *   readonly.
  47:      */
  48:     public void setEncoding(String encoding)
  49:                            throws DOMException;
  50: 
  51: }