package com.dbxml.db.admin.xmleditor;

/*
 * dbXML - Native XML Database
 * Copyright (C) 1999-2004  The dbXML Group, L.L.C.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: ElementContentModel.java,v 1.2 2004/02/12 00:17:55 bradford Exp $
 */

/**
 * ElementContentModel
 */

public interface ElementContentModel {
   /**
    * getElements returns all elements from the content model.
    *
    * @return A list of element names
    */
   String[] getElements();

   /**
    * getRoot returns all elements from the content model that might serve as
    * the root of the Document.
    *
    * @return A list of element names
    */
   String[] getRoot();

   /**
    * getChildren returns all elements from the content model that might serve
    * as children to the specified element.
    *
    * @param element The element name to check
    * @return A list of element names
    */
   String[] getChildren(String element);

   /**
    * getRequiredChildren returns all elements from the content model that
    * might be required children of the specified element.
    *
    * @param element The element name to check
    * @return A list of element names
    */
   String[] getRequiredChildren(String element);

   /**
    * getAttributes returns all possible attribute names from the content
    * model for the specified element.
    *
    * @param element The element name to check
    * @return A list of attribute names
    */
   String[] getAttributes(String element);

   /**
    * getRequiredAttributes returns all possible required attributes from the
    * content model for the specified element.
    *
    * @param element The element name to check
    * @return A list of attribute names
    */
   String[] getRequiredAttributes(String element);

   /**
    * getAttributeValues returns all possible enumerated values for an
    * attribute from the content model for the specified element.
    *
    * @param element The element name to check
    * @param attribute The attribute name to check
    * @return A list of possible attribute values
    */
   String[] getAttributeValues(String element, String attribute);

   /**
    * isAttributeValid returns whether or not the specified attribute value is
    * valid based on the content model.
    *
    * @param element The element name to check
    * @param attribute The attribute name to check
    * @param value The attribute value to check
    * @return Whether or not the value is valid
    */
   boolean isAttributeValid(String element, String attribute, String value);

   /**
    * getSchemaDoc returns a SchemaDoc string for the specified element based
    * on the content model.
    *
    * @param element The element name to check
    * @return The SchemaDoc as HTML
    */
   String getSchemaDoc(String element);

   /**
    * getSchemaDoc returns a SchemaDoc string for the specified attribute based
    * on the content model.
    *
    * @param element The element name to check
    * @param attribute The attribute name to check
    * @return The SchemaDoc as HTML
    */
   String getSchemaDoc(String element, String attribute);
}
