KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > elementprocessor > impl > poi > hssf > elements > EPContent


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

16
17 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
18
19 import java.io.IOException JavaDoc;
20
21 /**
22  * No-op implementation of ElementProcessor to handle the "Content"
23  * tag
24  *
25  * This element has no attributes and holds its parent element's
26  * content.
27  *
28  * @author Marc Johnson (marc_johnson27591@hotmail.com)
29  * @version CVS $Id: EPContent.java 30932 2004-07-29 17:35:38Z vgritsenko $
30  */

31 public class EPContent extends BaseElementProcessor {
32     private String JavaDoc _content;
33
34     /**
35      * constructor
36      */

37     public EPContent() {
38         super(null);
39         _content = null;
40     }
41
42     /**
43      * @return content
44      */

45     public String JavaDoc getContent() {
46         if (_content == null) {
47             try {
48                 _content = getData();
49             } catch (NullPointerException JavaDoc ignored) {
50                 //ignore npe
51
}
52         }
53         return _content;
54     }
55
56     /**
57      * end processing -- pass their content up to their cell
58      * @exception IOException
59      */

60     public void endProcessing() throws IOException JavaDoc {
61         String JavaDoc thecontent = getContent();
62         if (thecontent != null && !thecontent.trim().equals(""))
63             getCell().setContent(getContent());
64     }
65 } // end public class EPContent
66
Popular Tags