io.protostuff.generator.java.message.stg Maven / Gradle / Ivy
delimiters "<", ">"
import "io/protostuff/generator/core.stg"
import "io/protostuff/generator/java/generator.stg"
import "io/protostuff/generator/java/enum.stg"
import "io/protostuff/generator/java/schema.stg"
import "io/protostuff/generator/java/oneof.stg"
import "io/protostuff/generator/java/builder.stg"
import "io/protostuff/generator/java/message-base.stg"
message(message) ::= <<
package ;
>>
message_body(message) ::= <<
public static final class
implements io.protostuff.Message\<\>{
private static final DEFAULT_INSTANCE = newBuilder().build();
private boolean __merge_lock = false;
private () {
}
private (Builder builder) {
__merge_lock = true;
}
public static Builder newBuilder() {
return new Builder();
}
public static getDefaultInstance() {
return DEFAULT_INSTANCE;
}
public static io.protostuff.Schema\<\> getSchema()
{
return Schema.INSTANCE;
}
@Override
public io.protostuff.Schema\<\> cachedSchema() {
return Schema.INSTANCE;
}
}
>>
message_bit_field(name) ::= <<
private int ;
>>
field_accessors(field) ::= <<
public () {
if ( == .) {
return .valueOf((int) );
}
return ;
}
public int () {
if ( == .) {
return (int) ;
}
return 0;
}
public () {
if ( == .) {
return () ;
}
return ;
}
public boolean () {
return == .;
}
public () {
return ;
}
public int () {
return .size();
}
public ( key) {
return .get(key);
}
public () {
return new io.protostuff.ListAdapter\<>(, ::valueOf);
}
public (int index) {
return .valueOf(.get(index));
}
public java.util.List\ () {
return ;
}
public int (int index) {
return .get(index);
}
public int () {
return .size();
}
public () {
return ;
}
public int () {
return .size();
}
public (int index) {
return .get(index);
}
public () {
return .valueOf();
}
public int () {
return ;
}
public boolean () {
return ( & ) == ;
}
public () {
return ;
}
public boolean () {
return ( & ) == ;
}
>>
field_toString_part(field) ::= <<
if (!.isEmpty()) {
if (()) {
parts.add();
}
>>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy