001    package net.sf.jolene.dom;
002    
003    /**
004     * A radio button in an html document.
005     *
006     * @author Dan Howard
007     * @since Oct 13, 2005 8:25:11 PM
008     */
009    public final class Radio extends HTMLElement {
010    
011        /**
012         * Default constructor.
013         */
014        public Radio() {
015            setAttribute("type", "radio");
016        }
017    
018    
019        /**
020         * Construct a radio button with the specified name.
021         *
022         * @param name name of the radio button.
023         */
024        public Radio(String name) {
025            this();
026            setName(name);
027        }
028    
029        /**
030         * Returns a clone of the radio button object.
031         *
032         * @return Radio object.
033         */
034        @Override
035        public Radio clone() {
036            return (Radio) super.clone();
037        }
038    
039        /**
040         * Set the name of the radio button.
041         *
042         * @param name name of the radio button.
043         */
044        @Override
045        public void setName(String name) {
046            super.setName(name);
047            setAttribute("name", name);
048        }
049    
050    
051        /**
052         * Set the value of the radio button.
053         *
054         * @param value name of the radio button.
055         */
056        @Override
057        public void setValue(String value) {
058            super.setValue(value);
059            setAttribute("value", value);
060        }
061    }