001    /*
002     * Created on Feb 8, 2004
003    */
004    package net.sf.jolene.dom;
005    
006    
007    /**
008     * An input field in a html document. Usually used for entry fields, hidden fields or buttons.
009     * Use CheckBox and Radio for checkboxes and radio buttons.
010     *
011     * @author Dan Howard
012     */
013    public final class Input extends HTMLElement {
014    
015        /**
016         * Default constructor.
017         */
018        public Input() {
019        }
020    
021        /**
022         * Construct an input object with the specified name.
023         *
024         * @param name name of the input.
025         */
026        public Input(String name) {
027            setName(name);
028        }
029    
030        /**
031         * Returns a clone of the input object.
032         *
033         * @return Input object.
034         */
035        @Override
036        public Input clone() {
037            return (Input) super.clone();
038        }
039    
040        /**
041         * Sets the name of the input object.
042         *
043         * @param name name of the input.
044         */
045        @Override
046        public void setName(String name) {
047            super.setName(name);
048            setAttribute("name", name);
049        }
050    
051    
052        /**
053         * Sets the value of the input object.
054         *
055         * @param value value of the input.
056         */
057        @Override
058        public void setValue(String value) {
059            super.setValue(value);
060            setAttribute("value", value);
061        }
062    }