
com.sun.xml.parser.ElementDecl Maven / Gradle / Ivy
/*
* $Id: ElementDecl.java,v 1.2 1999/04/11 16:07:45 db Exp $
*
* Copyright (c) 1998-1999 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*/
package com.sun.xml.parser;
/**
* Represents all of the DTD information about an element. That
* includes:
*
* - Element name
*
*
- Content model ... either ANY, EMPTY, or a parenthesized
* regular expression matching the content model in the DTD
* (but with whitespace removed)
*
*
- A hashtable mapping attribute names to the attribute
* metadata.
*
*
*
* This also records whether the element was declared in the
* internal subset, for use in validating standalone declarations.
*
* @author David Brownell
* @version $Revision: 1.2 $
*/
class ElementDecl
{
/** The element type name. */
String name;
/** The name of the element's ID attribute, if any */
String id;
// EMPTY
// ANY
// (#PCDATA) or (#PCDATA|name|...)
// (name,(name|name|...)+,...) etc
/** The compressed content model for the element */
String contentType;
// non-null (and fixed!) when validating and model == null
ElementValidator validator;
// non-null only when validating; holds a data structure
// representing (name,(name|name|...)+,...) style models
ContentModel model;
/** True for EMPTY and CHILDREN content models */
boolean ignoreWhitespace;
/** Used to validate standalone declarations */
boolean isFromInternalSubset;
SimpleHashtable attributes = new SimpleHashtable ();
ElementDecl (String s) { name = s; }
}