EMMA Coverage Report (generated Fri Jun 19 09:16:10 CEST 2009)
[all classes][org.ktc.rbutils.api]

COVERAGE SUMMARY FOR SOURCE FILE [StringTools.java]

nameclass, %method, %block, %line, %
StringTools.java100% (1/1)50%  (1/2)55%  (11/20)50%  (3/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StringTools100% (1/1)50%  (1/2)55%  (11/20)50%  (3/6)
StringTools (): void 0%   (0/1)0%   (0/6)0%   (0/2)
escapeHtml (String): String 100% (1/1)79%  (11/14)75%  (3/4)

1/*
2 * Copyright  2005-2006 The RbUtils Project
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 
18// $Id: StringTools.java,v 1.1 2006/08/24 21:31:48 redfish Exp $
19 
20package org.ktc.rbutils.api;
21 
22import org.apache.commons.lang.StringEscapeUtils;
23import org.apache.commons.lang.StringUtils;
24 
25/**
26 * Provides String utilities for escaping characters.
27 * @since RbUtils 0.4
28 * @version $Revision: 1.1 $
29 * @author redfish
30 */
31public class StringTools extends StringEscapeUtils {
32    /** The html space character. */
33    public static final String HTML_NBSP = " ";
34 
35    /**
36     * Dummy constructor. This must not be instanciated.
37     */
38    protected StringTools() {
39        // prevents calls from subclass
40        throw new UnsupportedOperationException();
41    }
42 
43    /**
44     * Escapes characteres as super class except if the argument is null or the empty String; in
45     * this case, {@link #HTML_NBSP} is returned.
46     * <p>
47     * {@inheritDoc}
48     */
49    public static String escapeHtml(final String aValue) {
50        final String escapedString;
51        if (aValue == null || StringUtils.EMPTY.equals(aValue)) {
52            escapedString = HTML_NBSP;
53        }
54        else {
55            escapedString = StringEscapeUtils.escapeHtml(aValue);
56        }
57        return escapedString;
58    }
59 
60}

[all classes][org.ktc.rbutils.api]
EMMA 2.0.5312 (C) Vladimir Roubtsov