com.gargoylesoftware.htmlunit.javascript.host.Window.getPrototype()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 JavaScript  
字(7.3k)|赞(0)|评价(0)|浏览(257)

本文整理了Java中com.gargoylesoftware.htmlunit.javascript.host.Window.getPrototype()方法的一些代码示例,展示了Window.getPrototype()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.getPrototype()方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.javascript.host.Window
类名称:Window
方法名:getPrototype

Window.getPrototype介绍

[英]Returns the prototype object corresponding to the specified HtmlUnit class inside the window scope.
[中]

代码示例

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

@SuppressWarnings("unchecked")
private static Scriptable staticGetPrototype(final Window window,
    final Class<? extends SimpleScriptable> javaScriptClass) {
  final Scriptable prototype = window.getPrototype(javaScriptClass);
  if (prototype == null && javaScriptClass != SimpleScriptable.class) {
    return staticGetPrototype(window, (Class<? extends SimpleScriptable>) javaScriptClass.getSuperclass());
  }
  return prototype;
}

代码示例来源:origin: org.jvnet.hudson/htmlunit

@SuppressWarnings("unchecked")
private static Scriptable staticGetPrototype(final Window window,
    final Class< ? extends SimpleScriptable> javaScriptClass) {
  final Scriptable prototype = window.getPrototype(javaScriptClass);
  if (prototype == null && javaScriptClass != SimpleScriptable.class) {
    return staticGetPrototype(window, (Class< ? extends SimpleScriptable>) javaScriptClass.getSuperclass());
  }
  return prototype;
}

代码示例来源:origin: net.disy.htmlunit/htmlunit

@SuppressWarnings("unchecked")
private static Scriptable staticGetPrototype(final Window window,
    final Class< ? extends SimpleScriptable> javaScriptClass) {
  final Scriptable prototype = window.getPrototype(javaScriptClass);
  if (prototype == null && javaScriptClass != SimpleScriptable.class) {
    return staticGetPrototype(window, (Class< ? extends SimpleScriptable>) javaScriptClass.getSuperclass());
  }
  return prototype;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Gets the prototype object for the given host class.
 * @param javaScriptClass the host class
 * @return the prototype
 */
@SuppressWarnings("unchecked")
public Scriptable getPrototype(final Class<? extends SimpleScriptable> javaScriptClass) {
  final Scriptable prototype = getWindow().getPrototype(javaScriptClass);
  if (prototype == null && javaScriptClass != SimpleScriptable.class) {
    return getPrototype((Class<? extends SimpleScriptable>) javaScriptClass.getSuperclass());
  }
  return prototype;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Constructor.
 * @param window the parent scope
 * @param store the storage itself
 */
public Storage(final Window window, final Map<String, String> store) {
  store_ = store;
  setParentScope(window);
  setPrototype(window.getPrototype(Storage.class));
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Facility constructor.
 * @param window the owning window
 */
public Crypto(final Window window) {
  setParentScope(window);
  setPrototype(window.getPrototype(Crypto.class));
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Facility constructor.
 * @param window the owning window
 */
public Promise(final Window window) {
  setParentScope(window);
  setPrototype(window.getPrototype(Promise.class));
}

代码示例来源:origin: HtmlUnit/htmlunit

/**
 * Facility constructor.
 * @param window the owning window
 */
public Crypto(final Window window) {
  setParentScope(window);
  setPrototype(window.getPrototype(Crypto.class));
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Returns the current selection.
 * @return the current selection
 */
public Selection getSelectionImpl() {
  if (selection_ == null) {
    selection_ = new Selection();
    selection_.setParentScope(this);
    selection_.setPrototype(getPrototype(selection_.getClass()));
  }
  return selection_;
}

代码示例来源:origin: org.jenkins-ci/htmlunit

/**
 * Returns the JavaScript property "clipboardData".
 * @return the ClipboardData
 */
public ClipboardData jsxGet_clipboardData() {
  final ClipboardData clipboardData = new ClipboardData();
  clipboardData.setParentScope(this);
  clipboardData.setPrototype(getPrototype(clipboardData.getClass()));
  return clipboardData;
}

代码示例来源:origin: org.jvnet.hudson/htmlunit

/**
 * Returns the JavaScript property "clipboardData".
 * @return the ClipboardData
 */
public ClipboardData jsxGet_clipboardData() {
  final ClipboardData clipboardData = new ClipboardData();
  clipboardData.setParentScope(this);
  clipboardData.setPrototype(getPrototype(clipboardData.getClass()));
  return clipboardData;
}

代码示例来源:origin: org.jenkins-ci/htmlunit

/**
 * Returns the current selection.
 * @return the current selection
 */
public Selection getSelection() {
  if (selection_ == null) {
    selection_ = new Selection();
    selection_.setParentScope(this);
    selection_.setPrototype(getPrototype(selection_.getClass()));
  }
  return selection_;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Returns the {@code external} property.
 * @return the {@code external} property
 */
@JsxGetter
public External getExternal() {
  final External external = new External();
  external.setParentScope(this);
  external.setPrototype(getPrototype(external.getClass()));
  return external;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Returns the {@code styleMedia} property.
 * @return the {@code styleMedia} property
 */
@JsxGetter({CHROME, IE})
public StyleMedia getStyleMedia() {
  final StyleMedia styleMedia = new StyleMedia();
  styleMedia.setParentScope(this);
  styleMedia.setPrototype(getPrototype(styleMedia.getClass()));
  return styleMedia;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Returns the {@code speechSynthesis} property.
 * @return the {@code speechSynthesis} property
 */
@JsxGetter(CHROME)
public SpeechSynthesis getSpeechSynthesis() {
  final SpeechSynthesis speechSynthesis = new SpeechSynthesis();
  speechSynthesis.setParentScope(this);
  speechSynthesis.setPrototype(getPrototype(speechSynthesis.getClass()));
  return speechSynthesis;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Returns the JavaScript property {@code clipboardData}.
 * @return the {@link DataTransfer}
 */
@JsxGetter(IE)
public DataTransfer getClipboardData() {
  final DataTransfer dataTransfer = new DataTransfer();
  dataTransfer.setParentScope(this);
  dataTransfer.setPrototype(getPrototype(dataTransfer.getClass()));
  return dataTransfer;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Returns the {@code performance} property.
 * @return the {@code performance} property
 */
@JsxGetter
public Performance getPerformance() {
  final Performance performance = new Performance();
  performance.setParentScope(this);
  performance.setPrototype(getPrototype(performance.getClass()));
  return performance;
}

代码示例来源:origin: net.sourceforge.htmlunit/htmlunit

/**
 * Returns a new MediaQueryList object representing the parsed results of the specified media query string.
 *
 * @param mediaQueryString the media query
 * @return a new MediaQueryList object
 */
@JsxFunction
public MediaQueryList matchMedia(final String mediaQueryString) {
  final MediaQueryList mediaQueryList = new MediaQueryList(mediaQueryString);
  mediaQueryList.setParentScope(this);
  mediaQueryList.setPrototype(getPrototype(mediaQueryList.getClass()));
  return mediaQueryList;
}

代码示例来源:origin: HtmlUnit/htmlunit

/**
 * Returns the {@code performance} property.
 * @return the {@code performance} property
 */
@JsxGetter
public Performance getPerformance() {
  final Performance performance = new Performance();
  performance.setParentScope(this);
  performance.setPrototype(getPrototype(performance.getClass()));
  return performance;
}

代码示例来源:origin: org.jenkins-ci/htmlunit

/**
 * Creates a popup window.
 * @see <a href="http://msdn.microsoft.com/en-us/library/ms536392.aspx">MSDN documentation</a>
 * @return the created popup
 */
public Popup jsxFunction_createPopup() {
  final Popup popup = new Popup();
  popup.setParentScope(this);
  popup.setPrototype(getPrototype(Popup.class));
  popup.init(this);
  return popup;
}

相关文章

微信公众号