com.google.gwt.core.shared.GWT.isProdMode()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(136)

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

GWT.isProdMode介绍

[英]Returns true when running in production mode. Returns false when running either in development mode, or when running in a plain JVM.
[中]在生产模式下运行时返回true。在开发模式下运行或在普通JVM中运行时返回false

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Returns <code>true</code> when running in production mode. Returns
 * <code>false</code> when running either in development mode, or when running
 * in a plain JVM.
 */
public static boolean isProdMode() {
 return com.google.gwt.core.shared.GWT.isProdMode();
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Returns <code>true</code> when running in production mode. Returns
 * <code>false</code> when running either in development mode, or when running
 * in a plain JVM.
 */
public static boolean isProdMode() {
 return com.google.gwt.core.shared.GWT.isProdMode();
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Returns <code>true</code> when running in production mode. Returns
 * <code>false</code> when running either in development mode, or when running
 * in a plain JVM.
 */
public static boolean isProdMode() {
 return com.google.gwt.core.shared.GWT.isProdMode();
}

代码示例来源:origin: com.google.web.bindery/requestfactory-server

/**
 * Returns <code>true</code> when running in production mode. Returns
 * <code>false</code> when running either in development mode, or when running
 * in a plain JVM.
 */
public static boolean isProdMode() {
 return com.google.gwt.core.shared.GWT.isProdMode();
}

代码示例来源:origin: net.wetheinter/gwt-reflect

public static Object arrayGet(Object array, int index) {
 if (GWT.isProdMode())
  return jsniGet(array, index);
 else
  return Array.get(array, index);
}

代码示例来源:origin: net.wetheinter/gwt-reflect

/**
 * In jvms, we defer to java.lang.reflect.Array;
 * In gwt, java.lang.reflect.Array defers to here,
 * where the compiler will call into the c.g.g.jjs.instrinc.c.g.g.lang super source.
 *
 * @param array - Any array[] instance; java or js
 * @return - The number of elements in the [].
 */
public static int arrayLength(Object array) {
 if (GWT.isProdMode())
  return jsniLength(array);
 else
  return Array.getLength(array);
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * In jvms, we defer to java.lang.reflect.Array; In Gwt, we just return the
 * .length property.
 *
 * @param array
 * - Any array[] instance; java or js
 * @return - The number of elements in the [].
 */
public static int arrayLength(final Object array) {
 if (GWT.isProdMode()) {
  return jsniLength(array);
 } else {
  return Array.getLength(array);
 }
}

代码示例来源:origin: ekuefler/gwt-supereventbus

/**
 * Creates a new event bus. In dev mode, any exceptions that occur while dispatching events will
 * be logged with {@link GWT#log}. In prod mode, exceptions are silently ignored unless a handler
 * is added via {@link #addExceptionHandler}.
 */
public EventBus() {
 if (!GWT.isProdMode()) {
  addExceptionHandler(new ExceptionHandler() {
   @Override
   public void handleException(EventBusException e) {
    GWT.log("Got exception when handling event \"" + e.getEvent() + "\"", e.getCause());
   }
  });
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Retrieve an object from a given array using the most efficient solution for
 * a given platform. In Gwt, this does a direct int index access on the
 * supplied array object; in a JRE, it uses {@link Array#get(Object, int)}.
 * <p>
 * Note that JREs will throw {@link IndexOutOfBoundsException}, while Gwt will
 * not.
 *
 * @param array
 * -> The array to load from
 * @param index
 * -> The index to load from.
 * @return The object at the specified index.
 */
public static Object arrayGet(final Object array, final int index) {
 if (GWT.isProdMode()) {
  return jsniGet(array, index);
 } else {
  return Array.get(array, index);
 }
}

代码示例来源:origin: net.wetheinter/gwt-reflect

@SuppressWarnings("unchecked")
public static Iterable<Class<?>> extractClasses(ClassLoader loader) {
 try {
  Object classes = GwtReflect.fieldGet(ClassLoader.class, "classes", loader);
  if (GWT.isProdMode()) {
   // we have a js object of classes
   JavaScriptObject all = (JavaScriptObject)classes;
   return fillArray(new ArrayList<Class<?>>(), all);
  } else {
   // standard jvm.  Hope this works (should be a Vector<Class>)!
   return (Collection<Class<?>>)classes;
  }
 } catch (Exception e) {
  throw e instanceof RuntimeException ? (RuntimeException)e : new RuntimeException(e);
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

public static Package getPackage(final String name) {
 if (GWT.isProdMode()) {
  return Package.getPackage(name);
 } else {
  return GwtReflectJre.getPackage(name);
 }
}

代码示例来源:origin: net.wetheinter/gwt-reflect

public static Package getPackage(String name) {
 if (GWT.isProdMode()) {
  return Package.getPackage(name);
 } else {
  return GwtReflectJre.getPackage(name);
 }
}

代码示例来源:origin: net.wetheinter/gwt-user

public static String joinClasses(final String separator, final Class<?> ... vals) {
 if (GWT.isProdMode()) {
  return joinClassesJs(separator, vals);

代码示例来源:origin: net.wetheinter/gwt-user

if (GWT.isProdMode()) {
 return nativeEscape(unescaped);

代码示例来源:origin: net.wetheinter/gwt-user

final Object classes = GwtReflect.fieldGet(ClassLoader.class, "classes",
 loader);
if (GWT.isProdMode()) {

相关文章