KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > htmlparser > tags > ParagraphTag


1 // HTMLParser Library - A java-based parser for HTML
2
// http://htmlparser.org
3
// Copyright (C) 2006 Somik Raha
4
//
5
// Revision Control Information
6
//
7
// $URL: https://svn.sourceforge.net/svnroot/htmlparser/trunk/parser/src/main/java/org/htmlparser/tags/ParagraphTag.java $
8
// $Author: derrickoswald $
9
// $Date: 2006-09-16 10:44:17 -0400 (Sat, 16 Sep 2006) $
10
// $Revision: 4 $
11
//
12
// This library is free software; you can redistribute it and/or
13
// modify it under the terms of the Common Public License; either
14
// version 1.0 of the License, or (at your option) any later version.
15
//
16
// This library is distributed in the hope that it will be useful,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
// Common Public License for more details.
20
//
21
// You should have received a copy of the Common Public License
22
// along with this library; if not, the license is available from
23
// the Open Source Initiative (OSI) website:
24
// http://opensource.org/licenses/cpl1.0.php
25

26 package org.htmlparser.tags;
27
28 /**
29  * A paragraph (p) tag.
30  */

31 public class ParagraphTag extends CompositeTag
32 {
33     /**
34      * The set of names handled by this tag.
35      */

36     private static final String JavaDoc[] mIds = new String JavaDoc[] {"P"};
37
38     /**
39      * The set of tag names that indicate the end of this tag.
40      */

41     private static final String JavaDoc[] mEnders = new String JavaDoc[] {"ADDRESS", "BLOCKQUOTE", "CENTER", "DD", "DIR", "DIV", "DL", "DT", "FIELDSET", "FORM", "H1", "H2", "H3", "H4", "H5", "H6", "HR", "ISINDEX", "LI", "MENU", "NOFRAMES", "OL", "P", "PARAM", "PRE", "UL"};
42     
43     /**
44      * The set of end tag names that indicate the end of this tag.
45      */

46     private static final String JavaDoc[] mEndTagEnders = new String JavaDoc[] {"BODY", "HTML"};
47
48     /**
49      * Create a new p tag.
50      */

51     public ParagraphTag ()
52     {
53     }
54
55     /**
56      * Return the set of names handled by this tag.
57      * @return The names to be matched that create tags of this type.
58      */

59     public String JavaDoc[] getIds ()
60     {
61         return (mIds);
62     }
63     
64     /**
65      * Return the set of tag names that cause this tag to finish.
66      * @return The names of following tags that stop further scanning.
67      */

68     public String JavaDoc[] getEnders ()
69     {
70         return (mEnders);
71     }
72
73     /**
74      * Return the set of end tag names that cause this tag to finish.
75      * @return The names of following end tags that stop further scanning.
76      */

77     public String JavaDoc[] getEndTagEnders ()
78     {
79         return (mEndTagEnders);
80     }
81 }
82
Popular Tags