KickJava   Java API By Example, From Geeks To Geeks.

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


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 "Name" tag
23  *
24  * This element contains the name of the containing Sheet
25  *
26  * @author Marc Johnson (marc_johnson27591@hotmail.com)
27  * @version CVS $Id: EPName.java 30932 2004-07-29 17:35:38Z vgritsenko $
28  */

29 public class EPName extends BaseElementProcessor {
30     private String JavaDoc _name;
31
32     /**
33      * constructor
34      */

35     public EPName() {
36         super(null);
37         _name = null;
38     }
39
40     /**
41      * @return the name of the spreadsheet (may be empty)
42      */

43     public String JavaDoc getName() {
44         if (_name == null) {
45             _name = getData();
46         }
47         return _name;
48     }
49
50     /**
51      * give the sheet its name
52      * @exception IOException
53      */

54     public void endProcessing() throws IOException JavaDoc {
55         getSheet().renameSheet(getName());
56     }
57 } // end public class EPName
58
Popular Tags