com.google.gwt.angular.client.Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of angulargwt Show documentation
Show all versions of angulargwt Show documentation
Fork of AngularGWT based on ltgt's maven-plugin
package com.google.gwt.angular.client;
import java.util.Iterator;
import elemental.json.JsonValue;
import elemental.util.ArrayOf;
public class Util {
/**
* Only safe to do with JavaScriptObjects.
*/
public static native T reinterpret_cast(Object o) /*-{
return o;
}-*/;
public static String toJson(Object o) {
JsonValue value = reinterpret_cast(o);
return value.toJson();
}
public static T make(Object factory) {
return ((Factory) factory).create();
}
public static Iterable iterable(final ArrayOf array) {
return new Iterable() {
public Iterator iterator() {
return new Iterator() {
int next = 0;
public boolean hasNext() {
return next < array.length();
}
public S next() {
return array.get(next++);
}
public void remove() {
}
};
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy