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