1/* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
2 *
3 * This program and the accompanying materials are made available under
4 * the terms of the Common Public License v1.0 which accompanies this distribution,
5 * and is available at http://www.eclipse.org/legal/cpl-v10.html
6 *
7 * $Id: HyperRef.java,v 1.1.1.1 2004/05/09 16:57:41 vlad_r Exp $
8 */
9package com.vladium.emma.report.html.doc;
10
11// ----------------------------------------------------------------------------
12/**
13 * @author Vlad Roubtsov, (C) 2003
14 */
15public class HyperRef extends IElement.Factory.ElementImpl
16{
17    // public: ................................................................
18
19    public HyperRef (final String href, final String text, final boolean nbsp)
20    {
21        super (Tag.A, AttributeSet.create ());
22
23        if ((href == null) || (href.length () == 0))
24            throw new IllegalArgumentException ("null or empty input: href");
25
26        if ((text == null) || (text.length () == 0))
27            throw new IllegalArgumentException ("null or empty input: text");
28
29        getAttributes ().set (Attribute.HREF, href);
30
31        // TODO: does href need to be URL-encoded?
32        setText (text, nbsp);
33    }
34
35    // protected: .............................................................
36
37    // package: ...............................................................
38
39    // private: ...............................................................
40
41} // end of class
42// ----------------------------------------------------------------------------