View Javadoc

1   ////////////////////////////////////////////////////////////////////////////////
2   // MillScript-XML: an Open Spice interpreter and batch website creation tool
3   // Copyright (C) 2005 Kevin Rogers
4   //
5   // This file is part of MillScript-XML.
6   //
7   // MillScript-XML is free software; you can redistribute it and/or modify it under
8   // the terms of the GNU General Public License as published by the Free
9   // Software Foundation; either version 2 of the License, or (at your option)
10  // any later version.
11  //
12  // MillScript-XML is distributed in the hope that it will be useful, but WITHOUT
13  // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  // more details.
16  //
17  // You should have received a copy of the GNU General Public License along with
18  // MillScript-XML; if not, write to the Free Software Foundation, Inc., 59 Temple
19  // Place, Suite 330, Boston, MA  02111-1307  USA
20  ////////////////////////////////////////////////////////////////////////////////
21  package org.millscript.commons.xml.atttype;
22  
23  import org.millscript.commons.util.IList;
24  import org.millscript.commons.xml.api.Name;
25  import org.millscript.commons.xml.api.atttype.EnumerationAttDef;
26  import org.millscript.commons.xml.tokenizer.AbstractXmlTokenizerImpl;
27  
28  /**
29   * This class provides a default implementation of the
30   * <code>EnumerationAttDef</code> interface, to handle an enumeration attribute
31   * definition in the DTD.
32   */
33  public class EnumerationAttDefImpl extends AttDefImpl implements EnumerationAttDef {
34  
35      /**
36       * The list of enumeration tokens in this enumerated declaration.
37       */
38      private final IList< String > enumerationNmtokens;
39  
40      /**
41       * Constructs a new enumeration attribute definition object with the specified
42       * <code>Name</code>, reading the default mode and value from the specified
43       * XML tokenizer.
44       *
45       * @param an    the attributes <code>Name</code>
46       * @param l the <code>List</code> of <code>String</code> enumeration tokens
47       * @param xt    the XML tokenizer to obtain the default mode and value from
48       */
49      public EnumerationAttDefImpl( final Name an, final IList< String > l, final AbstractXmlTokenizerImpl xt ) {
50          super( an, xt );
51          this.enumerationNmtokens = l;
52      }
53  
54      /**
55       * Constructs a new enumeration attribute definition object with the specified
56       * <code>Name</code>, default mode and default value.
57       *
58       * @param an    the attributes <code>Name</code>
59       * @param l the <code>List</code> of <code>String</code> enumeration tokens
60       * @param dm    the default mode for the attribute
61       * @param dv    the default value for the attribute
62       */
63      public EnumerationAttDefImpl( final Name an, final IList< String > l, final String dv, final String dm ) {
64          super( an, dv, dm );
65          this.enumerationNmtokens = l;
66      }
67  
68  }