/*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 * language governing rights and limitations under the License.
 * 
 * The Original Code is the Venice Web Communities System.
 * 
 * The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2002-03 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.dynamo;

import java.util.*;
import org.apache.commons.lang.enum.*;

public final class HTMLTagSet extends ValuedEnum
{
  /*--------------------------------------------------------------------------------
   * The actual enumeration values
   *--------------------------------------------------------------------------------
   */

  // N.B.: The index values are from the old Venice code, for compatibility

  /**
   * Denotes all tags that affect &quot;inline&quot; formatting only, such as &lt;EM&gt; and &lt;B&gt;.
   * These are usually allowed.
   */
  public static final HTMLTagSet INLINE = new HTMLTagSet("INLINE",1);

  /**
   * Denotes the &quot;A&quot; tag.
   */
  public static final HTMLTagSet ANCHOR = new HTMLTagSet("ANCHOR",2);

  /**
   * Denotes all tags that affect &quot;block-level&quot; formatting, such as &lt;P&gt; and &lt;Hn&gt;.
   */
  public static final HTMLTagSet BLOCK = new HTMLTagSet("BLOCK",3);

  /**
   * Denotes all tags that cause &quot;active&quot; content to be included in the HTML document, such as
   * &lt;OBJECT&gt;, &lt;APPLET&gt;, and &lt;SCRIPT&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet ACTIVECONTENT = new HTMLTagSet("ACTIVECONTENT",4);

  /**
   * Denotes the tags that create clickable image maps, such as &lt;AREA&gt; and &lt;MAP&gt;.
   */
  public static final HTMLTagSet IMAGEMAP = new HTMLTagSet("IMAGEMAP",5);

  /**
   * Denotes the tags that are used for document-level formatting and structure, such as &lt;HTML&gt;, &lt;BODY&gt;,
   * and &lt;TITLE&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet DOCUMENT = new HTMLTagSet("DOCUMENT",6);

  /**
   * Denotes the &lt;FONT&gt; tag.
   */
  public static final HTMLTagSet FONT = new HTMLTagSet("FONT",7);

  /**
   * Denotes all tags that are used in conjunction with forms, such as &lt;FORM&gt;, &lt;INPUT&gt;, and &lt;SELECT&gt;.
   */
  public static final HTMLTagSet FORMS = new HTMLTagSet("FORMS",8);

  /**
   * Denotes all tags that are used in conjunction with tables, such as &lt;TABLE&gt;, &lt;TR&gt;, and &lt;TD&gt;.
   */
  public static final HTMLTagSet TABLES = new HTMLTagSet("TABLES",9);

  /**
   * Denotes the &lt;DEL&gt; and &lt;INS&gt; tags, which are used for change markup.
   */
  public static final HTMLTagSet CHANGE = new HTMLTagSet("CHANGE",10);

  /**
   * Denotes all tags related to frames, such as &lt;FRAMESET&gt; and &lt;FRAME&gt;. These are generally not allowed.
   */
  public static final HTMLTagSet FRAMES = new HTMLTagSet("FRAMES",11);

  /**
   * Denotes the &lt;IMG&gt; tag.
   */
  public static final HTMLTagSet IMAGES = new HTMLTagSet("IMAGES",12);

  /**
   * Denotes tags like &lt;PRE&gt;, which are used to preformat input text.
   */
  public static final HTMLTagSet PREFORMAT = new HTMLTagSet("PREFORMAT",13);

  /**
   * Denotes Netscape-specific inline formatting, such as the hated &lt;BLINK&gt;.
   */
  public static final HTMLTagSet NSCP_INLINE = new HTMLTagSet("NSCP_INLINE",14);

  /**
   * Denotes Netscape's layer tags, such as &lt;LAYER&gt; and &lt;ILAYER&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet NSCP_LAYERS = new HTMLTagSet("NSCP_LAYERS",15);

  /**
   * Denotes Netscape-specific form tags, like &lt;KEYGEN&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet NSCP_FORMS = new HTMLTagSet("NSCP_FORMS",16);

  /**
   * Denotes Netscape-specific block formatting tags, like &lt;MULTICOL&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet NSCP_BLOCK = new HTMLTagSet("NSCP_BLOCK",17);

  /**
   * Denotes the Netscape &lt;SERVER&gt; tag, used for server-side execution.  This is generally not allowed.
   */
  public static final HTMLTagSet NSCP_SERVER = new HTMLTagSet("NSCP_SERVER",18);

  /**
   * Denotes Microsoft-specific document formatting tags, such as &lt;BGSOUND&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet MSFT_DOCUMENT = new HTMLTagSet("MSFT_DOCUMENT",19);

  /**
   * Denotes Microsoft-specific inline formatting tags, such as &lt;COMMENT&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet MSFT_INLINE = new HTMLTagSet("MSFT_INLINE",20);

  /**
   * Denotes Microsoft-specific block formatting tags, such as &lt;MARQUEE&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet MSFT_BLOCK = new HTMLTagSet("MSFT_BLOCK",21);

  /**
   * Denotes Microsoft-specific active-content tags, such as &lt;XML&gt;.  These are generally not allowed.
   */
  public static final HTMLTagSet MSFT_ACTIVECONTENT = new HTMLTagSet("MSFT_ACTIVECONTENT",22);

  /**
   * Denotes constructs for server-side page use only, such as with Microsoft Active Server Pages and Sun Java
   * Server Pages.  These are generally not allowed.
   */
  public static final HTMLTagSet SERVER = new HTMLTagSet("SERVER",23);

  /**
   * Denotes tags used by the Sun Java Server and other Java-compatible servers for including server-side components.
   * These are generally not allowed.
   */
  public static final HTMLTagSet JAVASERVER = new HTMLTagSet("JAVASERVER",24);

  /**
   * Denotes HTML comments.  These are generally not allowed.
   */
  public static final HTMLTagSet COMMENT = new HTMLTagSet("COMMENT",25);

  public static final HTMLTagSet _LAST = COMMENT;

  /*--------------------------------------------------------------------------------
   * Constructor
   *--------------------------------------------------------------------------------
   */

  /**
   * Internal constructor which creates a new element of this enumerated type.
   *
   * @param name The name of the <CODE>HTMLTagSet</CODE> to be created.
   * @param value The numeric value to assign to the <CODE>HTMLTagSet</CODE>.
   */
  private HTMLTagSet(String name, int value)
  {
    super(name,value);

  } // end constructor

  /*--------------------------------------------------------------------------------
   * Standard static method implementations
   *--------------------------------------------------------------------------------
   */

  /**
   * Gets a <CODE>HTMLTagSet</CODE> by name.
   *
   * @param name The name of the <CODE>HTMLTagSet</CODE> to get; may be <CODE>null</CODE>.
   * @return The <CODE>HTMLTagSet</CODE> object, or <CODE>null</CODE> if the <CODE>HTMLTagSet</CODE>
   *         does not exist.
   */
  public static HTMLTagSet getEnum(String name)
  {
    return (HTMLTagSet)getEnum(HTMLTagSet.class,name);

  } // end getEnum

  /**
   * Gets a <CODE>HTMLTagSet</CODE> by numeric value.
   *
   * @param code The numeric value of the <CODE>HTMLTagSet</CODE> to get.
   * @return The <CODE>HTMLTagSet</CODE> object, or <CODE>null</CODE> if the <CODE>HTMLTagSet</CODE>
   *         does not exist.
   */
  public static HTMLTagSet getEnum(int code)
  {
    return (HTMLTagSet)getEnum(HTMLTagSet.class,code);

  } // end getEnum

  /**
   * Gets the <CODE>Map</CODE> of <CODE>HTMLTagSet</CODE> objects by name.
   *
   * @return The <CODE>HTMLTagSet</CODE> object <CODE>Map</CODE>.
   */
  public static Map getEnumMap()
  {
    return getEnumMap(HTMLTagSet.class);

  } // end getEnumMap

  /**
   * Gets the <CODE>List</CODE> of <CODE>HTMLTagSet</CODE> objects, in the order in which the objects are listed
   * in the code above.
   *
   * @return The <CODE>HTMLTagSet</CODE> object <CODE>List</CODE>.
   */
  public static List getEnumList()
  {
    return getEnumList(HTMLTagSet.class);

  } // end getEnumList

  /**
   * Gets an iterator over all <CODE>HTMLTagSet</CODE> objects, in the order in which the objects are listed
   * in the code above.
   *
   * @return The <CODE>HTMLTagSet</CODE> object iterator.
   */
  public static Iterator iterator()
  {
    return iterator(HTMLTagSet.class);

  } // end iterator

} // end class HTMLTagSet
