Source for javax.swing.text.html.parser.DTDConstants

   1: /* DTDConstants.java --
   2:    Copyright (C) 2005 Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   6: GNU Classpath is free software; you can redistribute it and/or modify
   7: it under the terms of the GNU General Public License as published by
   8: the Free Software Foundation; either version 2, or (at your option)
   9: any later version.
  10: 
  11: GNU Classpath is distributed in the hope that it will be useful, but
  12: WITHOUT ANY WARRANTY; without even the implied warranty of
  13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14: General Public License for more details.
  15: 
  16: You should have received a copy of the GNU General Public License
  17: along with GNU Classpath; see the file COPYING.  If not, write to the
  18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  21: Linking this library statically or dynamically with other modules is
  22: making a combined work based on this library.  Thus, the terms and
  23: conditions of the GNU General Public License cover the whole
  24: combination.
  25: 
  26: As a special exception, the copyright holders of this library give you
  27: permission to link this library with independent modules to produce an
  28: executable, regardless of the license terms of these independent
  29: modules, and to copy and distribute the resulting executable under
  30: terms of your choice, provided that you also meet, for each linked
  31: independent module, the terms and conditions of the license of that
  32: module.  An independent module is a module which is not derived from
  33: or based on this library.  If you modify this library, you may extend
  34: this exception to your version of the library, but you are not
  35: obligated to do so.  If you do not wish to do so, delete this
  36: exception statement from your version. */
  37: 
  38: 
  39: package javax.swing.text.html.parser;
  40: 
  41: /**
  42:  * <p>This class defines the SGML basic types, used for describing HTML 4.01
  43:  * at <a href="http://www.w3.org/TR/html4/types.html"
  44:  * >http://www.w3.org/TR/html4/types.html</a>. Not all constants,
  45:  * defined here, are actually used in HTML 4.01 SGML specification. Some others
  46:  * are defined just as part of the required implementation.
  47:  * </p>
  48:  * <p>
  49:  * If you need more information about SGML DTD documents,
  50:  * the author suggests to read SGML tutorial on
  51:  * <a href="http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html"
  52:  * >http://www.w3.org/TR/WD-html40-970708/intro/sgmltut.html</a>.
  53:  * We also recommend Goldfarb C.F (1991) <i>The SGML Handbook</i>,
  54:  * Oxford University Press, 688 p, ISBN: 0198537379.
  55:  * </p>
  56:  *
  57:  * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
  58:  */
  59: public interface DTDConstants
  60: {
  61:   /* ----- The data types, used in HTML 4.01 SGML definition: ---- */
  62: 
  63:   /**
  64:    * The CDATA (Character data) constant, specifes the content model,
  65:    * consisting of characters only. In SGML for HTML 4.01, the character
  66:    * entities must be replaced by characters, the line feeds must be
  67:    * ignored and any number of the subsequent carriage returns or tabs
  68:    * must be replaced by a single space.
  69:    */
  70:   int CDATA = 1;
  71: 
  72:   /**
  73:    *  The EMPTY constant, means the element with no content.
  74:    */
  75:   int EMPTY = 17;
  76: 
  77:   /**
  78:    * The ID constant, means that the token is the unique identifier.
  79:    * This identifier can be referenced by attribute with value of IDREF.
  80:    * The identifier must begin with letter, followed by any number of
  81:    * letters, digits, hyphens, underscores, colons and periods.
  82:    */
  83:   int ID = 4;
  84: 
  85:   /**
  86:    *  The IDREF constant, specifies reference to a valid ID within
  87:    * the document.
  88:    */
  89:   int IDREF = 5;
  90: 
  91:   /**
  92:    *  The IDREFS constant, a space separated list of IDREFs
  93:    */
  94:   int IDREFS = 6;
  95: 
  96:   /**
  97:    * The NAME constant, means the token that
  98:    * must begin with letter, followed by any number of
  99:    * letters, digits, hyphens, underscores, colons and periods.
 100:    */
 101:   int NAME = 7;
 102: 
 103:   /**
 104:    *  The NAMES constant, specifies a space separated of NAMEs.
 105:    */
 106:   int NAMES = 8;
 107: 
 108:   /**
 109:    * The NMTOKEN constant, specifies the attribute, consisting of
 110:    * characters that can be either digits or alphabetic characters).
 111:    */
 112:   int NMTOKEN = 9;
 113: 
 114:   /**
 115:    * The NMTOKENS constant, specifies a list of NMTOKENs.
 116:    */
 117:   int NMTOKENS = 10;
 118: 
 119:   /**
 120:    *  The NOTATION constant, a previously defined data type.
 121:    */
 122:   int NOTATION = 11;
 123: 
 124:   /**
 125:    * The NUMBER constant (means that the attribute consists of at least
 126:    * one decimal digit).
 127:    */
 128:   int NUMBER = 12;
 129: 
 130:   /**
 131:    *  The NUMBERS constant, specifies a space separated list of NUMBERs.
 132:    */
 133:   int NUMBERS = 13;
 134: 
 135:   /**
 136:    *  The NUTOKEN constant.
 137:    */
 138:   int NUTOKEN = 14;
 139: 
 140:   /**
 141:    *  The NUTOKENS constant.
 142:    */
 143:   int NUTOKENS = 15;
 144: 
 145:   /* -------
 146:      The entity scope constants.
 147:      As these four constants are combined with the bitwise OR,
 148:      they are defined in the hexadecimal notation.
 149:      The reason of setting the two bits at once (for PUBLIC and SYSTEM)
 150:      is probably historical.                                      ----- */
 151: 
 152:   /**
 153:    * The PUBLIC constant, specifies the public entity. The PUBLIC entities
 154:    * are assumed to be known to many systems so that a full declaration
 155:    * need not be transmitted. For example,
 156:    * &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN"&gt;
 157:    */
 158:   int PUBLIC = 0xA;
 159: 
 160:   /**
 161:    * The SYSTEM constant, specifies the system entitiy. The system entities
 162:    * are assumed to be known but require the clear identifer
 163:    * (like the file path), where they can be found in the system.
 164:    * For example, <code>
 165:    * &lt;DOCTYPE html SYSTEM "/path/to/file.dtd"&gt; </code>.
 166:    */
 167:   int SYSTEM = 0x11;
 168: 
 169:   /**
 170:    * The PARAMETER constant, specifies that entity is only valid
 171:    * inside SGML DTD scope.
 172:    */
 173:   int PARAMETER = 0x40000;
 174: 
 175:   /**
 176:    * The GENERAL constant, specifies theat the entity is valid in the
 177:    * whole HTML document scope.
 178:    */
 179:   int GENERAL = 0x10000;
 180: 
 181:   /* ---- The constants, defining if the element attribute is required,
 182:      fixed or implied.  ---- */
 183: 
 184:   /**
 185:    * The attribute modifier #REQUIRED constant, indicates that the
 186:    * value must be supplied.
 187:    */
 188:   int REQUIRED = 2;
 189: 
 190:   /**
 191:    * The attribute modifier #FIXED constant, means that the attribute has
 192:    * the fixed value that cannot be changed.
 193:    */
 194:   int FIXED = 1;
 195: 
 196:   /**
 197:    * The attribute modifier #IMPLIED constant,
 198:    * indicating that for this attribute the user agent must provide
 199:    * the value itself.
 200:    */
 201:   int IMPLIED = 5;
 202: 
 203:   /**
 204:    * The attribute modifier #CURRENT constant, specifies the value
 205:    * that at any point in the document is the last value supplied for
 206:    * that element. A value is required to be supplied for the first
 207:    * occurrence of an element
 208:    */
 209:   int CURRENT = 3;
 210: 
 211:   /**
 212:    * The attribute modifier #CONREF constant, specifies the IDREF value of
 213:    * the reference to content in another location of the document.
 214:    * The element with this attribute is empty, the content from
 215:    * that another location must be used instead.
 216:    */
 217:   int CONREF = 4;
 218: 
 219:   /* ----- Constants, defining if the element
 220:      start and end tags are required. ---- */
 221: 
 222:   /**
 223:    *  The STARTTAG, meaning that the element needs a starting tag.
 224:    */
 225:   int STARTTAG = 13;
 226: 
 227:   /**
 228:    *  The ENDTAG constant, meaning that the element needs a closing tag.
 229:    */
 230:   int ENDTAG = 14;
 231: 
 232:   /* ----- Other constants: ----- */
 233: 
 234:   /**
 235:    * The ANY constant, specifies
 236:    * an attribute, consisting from arbitrary characters.
 237:    */
 238:   int ANY = 19;
 239: 
 240:   /**
 241:    *  The DEFAULT constant, specifies the default value.
 242:    */
 243:   int DEFAULT = 131072;
 244: 
 245:   /**
 246:    *  The ENTITIES constant (list of ENTITYes)
 247:    */
 248:   int ENTITIES = 3;
 249: 
 250:   /**
 251:    *  The ENTITY constant, meaning the numeric or symbolic name of some
 252:    * HTML data.
 253:    */
 254:   int ENTITY = 2;
 255: 
 256:   /**
 257:    *  The MD constant.
 258:    */
 259:   int MD = 16;
 260: 
 261:   /**
 262:    *  The MODEL constant.
 263:    */
 264:   int MODEL = 18;
 265: 
 266:   /**
 267:    * The MS constant.
 268:    */
 269:   int MS = 15;
 270: 
 271:   /**
 272:    * The PI (Processing Instruction) constant, specifies a processing
 273:    * instruction. Processing instructions are used to embed information
 274:    * intended for specific applications.
 275:    */
 276:   int PI = 12;
 277: 
 278:   /**
 279:    * The RCDATA constant (Entity References and Character Data), specifies
 280:    * the content model, consisting of characters AND entities. The
 281:    * "&lt;" is threated as an ordinary character, but
 282:    * "<code>&amp;name;</code>" still means the general entity with
 283:    *  the given name.
 284:    */
 285:   int RCDATA = 16;
 286: 
 287:   /**
 288:    * The SDATA constant. Means that the value contains the entity name
 289:    * and the replacement value of a character entity reference.
 290:    */
 291:   int SDATA = 11;
 292: }