| 1 |
+ |
/* |
| 2 |
+ |
* i-scream central monitoring system |
| 3 |
+ |
* Copyright (C) 2000-2002 i-scream |
| 4 |
+ |
* |
| 5 |
+ |
* This program is free software; you can redistribute it and/or |
| 6 |
+ |
* modify it under the terms of the GNU General Public License |
| 7 |
+ |
* as published by the Free Software Foundation; either version 2 |
| 8 |
+ |
* of the License, or (at your option) any later version. |
| 9 |
+ |
* |
| 10 |
+ |
* This program is distributed in the hope that it will be useful, |
| 11 |
+ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
+ |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
+ |
* GNU General Public License for more details. |
| 14 |
+ |
* |
| 15 |
+ |
* You should have received a copy of the GNU General Public License |
| 16 |
+ |
* along with this program; if not, write to the Free Software |
| 17 |
+ |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 |
+ |
*/ |
| 19 |
+ |
|
| 20 |
|
//---PACKAGE DECLARATION--- |
| 21 |
|
|
| 22 |
|
//---IMPORTS--- |
| 24 |
|
|
| 25 |
|
/** |
| 26 |
|
* Formats data into valid XML |
| 27 |
< |
* By calling either addElement() or addNest() you can use this |
| 28 |
< |
* class to create valid xml. When all elements have been added |
| 29 |
< |
* calling returnXML() will return a string containing the xml. |
| 27 |
> |
* By calling either addElement() or addNest() you can use |
| 28 |
> |
* this class to create valid xml. When all elements have |
| 29 |
> |
* been added calling returnXML() will return a string |
| 30 |
> |
* containing the xml. |
| 31 |
|
* |
| 32 |
|
* |
| 33 |
|
* @author $Author$ |
| 80 |
|
xmlData = new String(); |
| 81 |
|
hostInfo = null; |
| 82 |
|
} |
| 63 |
– |
|
| 64 |
– |
/** |
| 65 |
– |
* Public Constructor for the class |
| 66 |
– |
* Takes a second parameter containing the root attributes. |
| 67 |
– |
*/ |
| 68 |
– |
public XMLFormatter(String rootInfo, String rootAttributes){ |
| 69 |
– |
myStack = new Stack(); |
| 70 |
– |
xmlData = new String(); |
| 71 |
– |
xmlData = "<"+rootInfo+" "+rootAttributes+">"; |
| 72 |
– |
hostInfo = rootInfo; |
| 73 |
– |
} |
| 83 |
|
|
| 84 |
|
//---PUBLIC METHODS--- |
| 85 |
|
|