KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hdf > model > HDFObjectModel


1
2 /* ====================================================================
3    Copyright 2002-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16 ==================================================================== */

17         
18 package org.apache.poi.hdf.model;
19
20 import org.apache.poi.hdf.event.HDFLowLevelParsingListener;
21 import org.apache.poi.hdf.model.util.BTreeSet;
22
23 import org.apache.poi.hdf.model.hdftypes.ChpxNode;
24 import org.apache.poi.hdf.model.hdftypes.PapxNode;
25 import org.apache.poi.hdf.model.hdftypes.SepxNode;
26 import org.apache.poi.hdf.model.hdftypes.TextPiece;
27 import org.apache.poi.hdf.model.hdftypes.DocumentProperties;
28 import org.apache.poi.hdf.model.hdftypes.FontTable;
29 import org.apache.poi.hdf.model.hdftypes.ListTables;
30 import org.apache.poi.hdf.model.hdftypes.StyleSheet;
31
32
33 public class HDFObjectModel implements HDFLowLevelParsingListener
34 {
35
36     /** "WordDocument" from the POIFS */
37     private byte[] _mainDocument;
38
39     /** The DOP*/
40     private DocumentProperties _dop;
41     /**the StyleSheet*/
42     private StyleSheet _styleSheet;
43     /**list info */
44     private ListTables _listTables;
45     /** Font info */
46     private FontTable _fonts;
47
48     /** text offset in main stream */
49     int _fcMin;
50
51     /** text pieces */
52     BTreeSet _text = new BTreeSet();
53     /** document sections */
54     BTreeSet _sections = new BTreeSet();
55     /** document paragraphs */
56     BTreeSet _paragraphs = new BTreeSet();
57     /** document character runs */
58     BTreeSet _characterRuns = new BTreeSet();
59
60     public HDFObjectModel()
61     {
62     }
63     public void mainDocument(byte[] mainDocument)
64     {
65       _mainDocument = mainDocument;
66     }
67     public void tableStream(byte[] tableStream)
68     {
69     }
70     public void miscellaneous(int fcMin, int ccpText, int ccpFtn, int fcPlcfhdd, int lcbPlcfhdd)
71     {
72       _fcMin = fcMin;
73     }
74     public void document(DocumentProperties dop)
75     {
76       _dop = dop;
77     }
78     public void bodySection(SepxNode sepx)
79     {
80       _sections.add(sepx);
81     }
82     public void hdrSection(SepxNode sepx)
83     {
84       _sections.add(sepx);
85     }
86     public void endSections()
87     {
88     }
89     public void paragraph(PapxNode papx)
90     {
91       _paragraphs.add(papx);
92     }
93     public void characterRun(ChpxNode chpx)
94     {
95       _characterRuns.add(chpx);
96     }
97     public void text(TextPiece t)
98     {
99       _text.add(t);
100     }
101     public void fonts(FontTable fontTbl)
102     {
103       _fonts = fontTbl;
104     }
105     public void lists(ListTables listTbl)
106     {
107       _listTables = listTbl;
108     }
109     public void styleSheet(StyleSheet stsh)
110     {
111       _styleSheet = stsh;
112     }
113 }
114
Popular Tags