KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > snip > name > NoneFormatter


1 package org.snipsnap.snip.name;
2
3 /*
4  * This file is part of "SnipSnap Wiki/Weblog".
5  *
6  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
7  * All Rights Reserved.
8  *
9  * Please visit http://snipsnap.org/ for updates and contact.
10  *
11  * --LICENSE NOTICE--
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  * --LICENSE NOTICE--
26  */

27
28
29 /**
30  * Formatter that does nothing
31  *
32  * @author stephan
33  * @version $Id: NoneFormatter.java 950 2003-08-27 09:22:47Z stephan $
34  */

35
36 public class NoneFormatter implements NameFormatter {
37   private NameFormatter parent;
38
39   public void setParent(NameFormatter parent) {
40     this.parent = parent;
41   }
42
43   public String JavaDoc format(String JavaDoc name) {
44     if (parent != null) {
45       return parent.format(name);
46     } else {
47       return name;
48     }
49   }
50 }
51
Popular Tags