KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmanage > core > management > data > DefaultDataFormat


1 /**
2 * Copyright (c) 2004-2005 jManage.org
3 *
4 * This is a free software; you can redistribute it and/or
5 * modify it under the terms of the license at
6 * http://www.jmanage.org.
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */

14 package org.jmanage.core.management.data;
15
16 import org.jmanage.util.StringUtils;
17
18 /**
19  * This is the default DataFormat for types that do not have a specific
20  * DataFormat defined.
21  *
22  * <p>
23  * Date: Dec 9, 2005
24  * @author Rakesh Kalra
25  */

26 public class DefaultDataFormat implements DataFormat {
27
28     public String JavaDoc format(Object JavaDoc data) {
29         String JavaDoc output = data.toString();
30         if(DataFormatUtil.isEscapeHtml()){
31             // todo: do we need this? We are now using <pre> tag.
32
output = StringUtils.htmlEscape(output);
33         }
34         return output;
35     }
36 }
37
Popular Tags