package jp.sourceforge.cfneo.at4ie2.api.browser.impl.ie;

import watij.elements.HtmlElement;
import jp.sourceforge.cfneo.at4ie2.BTRuntimeError;
import jp.sourceforge.cfneo.at4ie2.api.browser.HtmlDataComponent;

public class BTHtmlDataComponent implements HtmlDataComponent {

	HtmlElement htmlElement;

	BTHtmlDataComponent(HtmlElement htmlElement) {
		this.htmlElement = htmlElement;
	}

	@Override
	public String getValue() {
		try {
			return this.htmlElement.value();
		} catch (Exception e) {
			throw new BTRuntimeError(e);
		}
	}
	@Override
	public String getId() {
		try {
			return this.htmlElement.id();
		} catch (Exception e) {
			throw new BTRuntimeError(e);
		}
	}
	@Override
	public String getName() {
		try {
			return this.htmlElement.name();
		} catch (Exception e) {
			throw new BTRuntimeError(e);
		}
	}
	@Override
	public boolean exists() {
		try {
			return this.htmlElement.exists();
		} catch (Exception e) {
			throw new BTRuntimeError(e);
		}
	}

}
