KickJava   Java API By Example, From Geeks To Geeks.

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


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/ProcessingInstructionTag.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 import org.htmlparser.nodes.TagNode;
29
30 /**
31  * The XML processing instructions like <?xml ... ?> can be identified by this class.
32  */

33 public class ProcessingInstructionTag
34     extends
35         TagNode
36 {
37     /**
38      * The set of names handled by this tag.
39      */

40     private static final String JavaDoc[] mIds = new String JavaDoc[] {"?"};
41
42     /**
43      * Create a new processing instruction tag.
44      */

45     public ProcessingInstructionTag ()
46     {
47     }
48
49     /**
50      * Return the set of names handled by this tag.
51      * @return The names to be matched that create tags of this type.
52      */

53     public String JavaDoc[] getIds ()
54     {
55         return (mIds);
56     }
57
58     /**
59      * Returns a string representation of this processing instruction suitable for debugging.
60      * @return A string representing this tag.
61      */

62     public String JavaDoc toString()
63     {
64         String JavaDoc guts = toHtml();
65         guts = guts.substring (1, guts.length () - 2);
66         return "Processing Instruction : "+guts+"; begins at : "+getStartPosition ()+"; ends at : "+getEndPosition ();
67     }
68 }
69
Popular Tags