
com.dyuproject.protostuff.compiler.gwt_overlay_emulation_mode.stg Maven / Gradle / Ivy
group gwt_overlay_emulation_mode : gwt_overlay;
//#enum begin
enum_block(eg, module, options, nested) ::= <<
public static class extends JavaScriptObject {
}
>>
enum_method_get_number(eg, options) ::= <<
public final native int getNumber() /*-{
return this[0];
return this;
}-*/;
>>
//#message begin
message_block(message, module, options, nested) ::= <<
public static class extends JavaScriptObject {
}
>>
message_builder_class(message, options) ::= <<
public static class Builder extends {
protected Builder() {}
public final build() {
return ()this;
}
public static native Builder create() /*-{
return {
};
}-*/;
}
>>
message_static_method_new_builder(message, options) ::= <<
public static final Builder newBuilder() {
return Builder.create();
}
>>
message_static_method_get_protocol_buffer_name(message, options) ::= <<
/**
* Returns the name of this protocol buffer.
*/
public static native String getProtocolBufferName(JavaScriptObject instance) /*-{
return instance._protoMessageName;
}-*/;
>>
message_static_method_create(message, options) ::= <<
/**
* Creates a new instance
*
* @return new instance
*/
public static native create() /*-{
return {
"_protoMessageName": ""
};
}-*/;
>>
field_getters_and_setters(field, options) ::= <<
//
public final native getArray() /*-{
return @::getArray(Lcom/google/gwt/core/client/JavaScriptObject;Ljava/lang/String;)(this, "");
return this[""];
return this[""];
}-*/;
public final java.util.List\<\> getList() {
array = getArray();
if (array == null)
return null;
int len = array.length();
if (len == 0)
return java.util.Collections.emptyList();
java.util.List\<\> list = new java.util.ArrayList\<\>();
for (int i=0; i \< len; i++)
list.add(array.get(i));
return list;
}
public final native setArray( ) /*-{
this[""] = ;
return this;
}-*/;
public final native clearArray() /*-{
return (this[""] = []);
}-*/;
public final get(int index) {
array = getArray();
return array == null ? null : array.get(index);
}
public final int getCount() {
array = getArray();
return array == null ? 0 : array.length();
}
public final void add( ) {
array = getArray();
if(array == null)
array = clearArray();
array.push();
}
public final native get() /*-{
}-*/;
public final native set( ) /*-{
this[""] = ;
return this;
}-*/;
public final native void clear() /*-{
delete this[""];
}-*/;
public final native boolean has() /*-{
return this[""] != null;
}-*/;
>>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy