com.gargoylesoftware.htmlunit.html
Class HtmlFileInput
java.lang.Object
com.gargoylesoftware.htmlunit.html.DomNode
com.gargoylesoftware.htmlunit.html.DomNamespaceNode
com.gargoylesoftware.htmlunit.html.DomElement
com.gargoylesoftware.htmlunit.html.HtmlElement
com.gargoylesoftware.htmlunit.html.StyledElement
com.gargoylesoftware.htmlunit.html.ClickableElement
com.gargoylesoftware.htmlunit.html.FocusableElement
com.gargoylesoftware.htmlunit.html.HtmlInput
com.gargoylesoftware.htmlunit.html.HtmlFileInput
- All Implemented Interfaces:
- DisabledElement, SubmittableElement, Serializable, Cloneable
public class HtmlFileInput
- extends HtmlInput
Wrapper for the HTML element "input".
- Version:
- $Revision: 2132 $
- Author:
- Mike Bowler, Christian Sell, Daniel Gredler, Ahmed Ashour, Marc Guillemot
- See Also:
- Serialized Form
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE |
Constructor Summary |
HtmlFileInput(HtmlPage page,
Map attributes)
Deprecated. You should not directly construct HtmlFileInput. |
Method Summary |
String |
getContentType()
Gets the content type that should be send together with the uploaded file. |
KeyValuePair[] |
getSubmitKeyValuePairs()
Return an array of KeyValuePairs that are the values that will be sent
back to the server whenever the current form is submitted. |
void |
reset()
Return the value of this element to the default value or checked state (usually what it was at
the time the page was loaded, unless it has been modified via JavaScript). This method does nothing for file input elements. |
void |
setContentType(String contentType)
Sets the content type value that should be send together with the uploaded file. |
void |
setDefaultValue(String defaultValue)
Sets the default value to use when this element gets reset, if applicable. Also sets the value attribute when emulating Netscape browsers. Overridden so that this does not set the value attribute when emulating
Netscape browsers. |
Methods inherited from class com.gargoylesoftware.htmlunit.html.HtmlInput |
asText, click, getAcceptAttribute, getAccessKeyAttribute, getAlignAttribute, getAltAttribute, getCheckedAttribute, getDefaultValue, getDisabledAttribute, getMaxLengthAttribute, getNameAttribute, getOnBlurAttribute, getOnChangeAttribute, getOnFocusAttribute, getOnSelectAttribute, getReadOnlyAttribute, getSizeAttribute, getSrcAttribute, getTabIndexAttribute, getTypeAttribute, getUseMapAttribute, getValueAttribute, isChecked, isDefaultChecked, isDisabled, setChecked, setDefaultChecked, setDefaultValue, setValueAttribute |
Methods inherited from class com.gargoylesoftware.htmlunit.html.ClickableElement |
click, click, click, dblClick, dblClick, doClickAction, getLangAttribute, getOnClickAttribute, getOnDblClickAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getTextDirectionAttribute, getXmlLangAttribute, isStateUpdateFirst |
Methods inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
addHtmlAttributeChangeListener, appendChildIfNoneExists, assertNotEmpty, blur, cloneDomNode, cloneNode, fireEvent, fireEvent, fireHtmlAttributeAdded, fireHtmlAttributeRemoved, fireHtmlAttributeReplaced, focus, getAttribute, getAttributeEntriesIterator, getAttributeNS, getAttributeValue, getChildElementsIterator, getEnclosingElement, getEnclosingForm, getEnclosingFormOrDie, getEventHandler, getHtmlElementById, getHtmlElementsByAttribute, getHtmlElementsByTagName, getHtmlElementsByTagNames, getId, getNodeName, getNodeType, getOneHtmlElementByAttribute, getTabIndex, getTagName, hasAttribute, hasAttributeNS, hasAttributes, hasHtmlElementWithId, isAttributeDefined, isEmptyXmlTagExpanded, isSubmittableByEnter, keyDown, keyDown, mouseDown, mouseDown, mouseMove, mouseMove, mouseOut, mouseOut, mouseOver, mouseOver, mouseUp, mouseUp, notImplemented, preventDefault, printOpeningTagContentAsXml, printXml, removeAttribute, removeAttributeNS, removeChild, removeEventHandler, removeHtmlAttributeChangeListener, rightClick, rightClick, setAttribute, setAttributeNS, setAttributeValue, setAttributeValue, setEventHandler, setEventHandler, setId, toString, type, type, type, type |
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asXml, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLog, getNativePage, getNextDomSibling, getNextSibling, getNodeValue, getPage, getParentDomNode, getParentNode, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, insertBefore, isAncestorOf, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removePropertyChangeListener, replace, setNextSibling, setNodeValue, setParentNode, setPreviousSibling, setReadyState, setScriptObject |
HtmlFileInput
public HtmlFileInput(HtmlPage page,
Map attributes)
- Deprecated. You should not directly construct HtmlFileInput.
- Create an instance
- Parameters:
page
- The page that contains this elementattributes
- the initial attributes
getSubmitKeyValuePairs
public KeyValuePair[] getSubmitKeyValuePairs()
- Return an array of KeyValuePairs that are the values that will be sent
back to the server whenever the current form is submitted. Some of the
values may be KeyDataPairs indicating that a File will be uploaded
THIS METHOD IS INTENDED FOR THE USE OF THE FRAMEWORK ONLY AND SHOULD NOT
BE USED BY CONSUMERS OF HTMLUNIT. USE AT YOUR OWN RISK.
- Specified by:
getSubmitKeyValuePairs
in interface SubmittableElement
- Overrides:
getSubmitKeyValuePairs
in class HtmlInput
- Returns:
- See above
reset
public void reset()
- Return the value of this element to the default value or checked state (usually what it was at
the time the page was loaded, unless it has been modified via JavaScript). This method does nothing for file input elements.
- Specified by:
reset
in interface SubmittableElement
- Overrides:
reset
in class HtmlInput
- See Also:
SubmittableElement.reset()
setDefaultValue
public void setDefaultValue(String defaultValue)
- Sets the default value to use when this element gets reset, if applicable. Also sets the value attribute when emulating Netscape browsers. Overridden so that this does not set the value attribute when emulating
Netscape browsers.
- Specified by:
setDefaultValue
in interface SubmittableElement
- Overrides:
setDefaultValue
in class HtmlInput
- Parameters:
defaultValue
- The default value to use when this element gets reset, if applicable.- See Also:
HtmlInput.setDefaultValue(String)
setContentType
public void setContentType(String contentType)
- Sets the content type value that should be send together with the uploaded file.
If content type is not explicitly set, HtmlUnit will try to guess it from the file content.
- Parameters:
contentType
- the content type, null
resets it
getContentType
public String getContentType()
- Gets the content type that should be send together with the uploaded file.
- Returns:
- the content type,
null
if this has not been explicitly set
and should be guessed from file content.
Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.