/ org.htmlparser / src / org / htmlparser / tags / BodyTag.java
BodyTag.java
 1  // HTMLParser Library $Name: v1_6_20060319 $ - A java-based parser for HTML
 2  // http://sourceforge.org/projects/htmlparser
 3  // Copyright (C) 2004 Somik Raha
 4  //
 5  // Revision Control Information
 6  //
 7  // $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/BodyTag.java,v $
 8  // $Author: derrickoswald $
 9  // $Date: 2006/03/19 21:26:32 $
10  // $Revision: 1.23 $
11  //
12  // This library is free software; you can redistribute it and/or
13  // modify it under the terms of the GNU Lesser General Public
14  // License as published by the Free Software Foundation; either
15  // version 2.1 of the License, or (at your option) any later version.
16  //
17  // This library is distributed in the hope that it will be useful,
18  // but WITHOUT ANY WARRANTY; without even the implied warranty of
19  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  // Lesser General Public License for more details.
21  //
22  // You should have received a copy of the GNU Lesser General Public
23  // License along with this library; if not, write to the Free Software
24  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  //
26  
27  package org.htmlparser.tags;
28  
29  /**
30   * A Body Tag.
31   * Primarily a container for child tags.
32   */
33  public class BodyTag extends CompositeTag
34  {
35      /**
36       * The set of names handled by this tag.
37       */
38      private static final String[] mIds = new String[] {"BODY"};
39  
40      /**
41       * The set of end tag names that indicate the end of this tag.
42       */
43      private static final String[] mEndTagEnders = new String[] {"HTML"};
44  
45      /**
46       * Create a new body tag.
47       */
48      public BodyTag ()
49      {
50      }
51  
52      /**
53       * Return the set of names handled by this tag.
54       * @return The names to be matched that create tags of this type.
55       */
56      public String[] getIds ()
57      {
58          return (mIds);
59      }
60  
61      /**
62       * Return the set of tag names that cause this tag to finish.
63       * @return The names of following tags that stop further scanning.
64       */
65      public String[] getEnders ()
66      {
67          return (mIds);
68      }
69  
70      /**
71       * Return the set of end tag names that cause this tag to finish.
72       * @return The names of following end tags that stop further scanning.
73       */
74      public String[] getEndTagEnders ()
75      {
76          return (mEndTagEnders);
77      }
78  
79      /**
80       * Returns the textual contents of this <code>BODY</code> tag.
81       * Equivalent to <code>toPlainTextString()</code>.
82       * @return The 'browser' text in this tag.
83       */
84      public String getBody()
85      {
86          return toPlainTextString();
87      }
88  }