KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > contineo > core > text > parser > ZABWParser


1 package org.contineo.core.text.parser;
2
3 import java.io.File JavaDoc;
4 import org.apache.log4j.Level;
5 import org.apache.log4j.Logger;
6 import org.contineo.core.LoggingManager;
7 import org.contineo.core.ZipBean;
8 import org.contineo.core.config.SettingConfigurator;
9
10 /**
11  * Created on 10.12.2004
12  */

13 public class ZABWParser implements Parser {
14
15     private StringBuffer JavaDoc content = new StringBuffer JavaDoc();
16
17     /**
18      * @uml.property name="logger"
19      * @uml.associationEnd
20      */

21     private Logger logger;
22     
23     /**
24      *
25      */

26     public ZABWParser(File JavaDoc file) {
27         logger = LoggingManager.getLogger(this.getClass());
28         init(file);
29     }
30     
31     protected void init(File JavaDoc file) {
32         try {
33             String JavaDoc filename = file.getName();
34             SettingConfigurator conf = new SettingConfigurator();
35             ZipBean.unzip(file.getAbsolutePath(),conf.getValue("userdir") + "unjar/", filename);
36             File JavaDoc xmlfile = new File JavaDoc(conf.getValue("userdir") + "unjar/" + filename);
37             XMLParser parser = new XMLParser(xmlfile);
38             content = parser.getContent();
39         } catch (Exception JavaDoc e) {
40             if (logger.isEnabledFor(Level.ERROR))
41                 logger.error(e.getMessage());
42         }
43     }
44
45     /* (non-Javadoc)
46      * @see org.contineo.core.text.parser.Parser#getVersion()
47      */

48     public String JavaDoc getVersion() {
49         return "";
50     }
51
52     /* (non-Javadoc)
53      * @see org.contineo.core.text.parser.Parser#getContent()
54      */

55     /**
56      * @return Returns the content.
57      * @uml.property name="content"
58      */

59     public StringBuffer JavaDoc getContent() {
60         return content;
61     }
62
63     /* (non-Javadoc)
64      * @see org.contineo.core.text.parser.Parser#getAuthor()
65      */

66     public String JavaDoc getAuthor() {
67         return "";
68     }
69
70     /* (non-Javadoc)
71      * @see org.contineo.core.text.parser.Parser#getSourceDate()
72      */

73     public String JavaDoc getSourceDate() {
74         return "";
75     }
76
77     /* (non-Javadoc)
78      * @see org.contineo.core.text.parser.Parser#getKeywords()
79      */

80     public String JavaDoc getKeywords() {
81         return "";
82     }
83
84     /* (non-Javadoc)
85      * @see org.contineo.core.text.parser.Parser#getTitle()
86      */

87     public String JavaDoc getTitle() {
88         return "";
89     }
90
91 }
92
Popular Tags