All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dyuproject.protostuff.compiler.java_bean_model_schema.stg Maven / Gradle / Ivy

group java_bean_model_schema : java_bean_model_base;

message_block(message, module, options, nested) ::= <<




public static class 
       
        {

    
    
    
    
    
    
    
    
    
    
}

>>

setter(field, options) ::= <
>>
getter(field, options) ::= <<
isget
>>
pre_cast_val(field) ::= <<

(short)
(byte)
(char)
>>
post_set_cast_val(field) ::= ""
pre_get_cast_val(field) ::= ""
post_get_cast_val(field) ::= ""
set_val(field, options, accessor, value, nocast) ::= <<

 = 

()

>>
get_val(field, options, accessor, this, nocast) ::= <<

.

.()

>>
resolve_annotated_native_type(field, boxed, bytesUnboxed) ::= <<

byte[]byte[]Byte[]
shortShort
byteByte
charChar
boolBoolean

>>

message_constructor(message, options) ::= <<

public () {}

>>

message_impl_declaration(message, options) ::= <<

,

implements

 Schema\<\>
>>

message_default_instance(message, options) ::= <<

static final  DEFAULT_INSTANCE = new ();
static final Schema\<\> SCHEMA = new ();

public static  getDefaultInstance() { return DEFAULT_INSTANCE; }
public static Schema\<\> getSchema() { return SCHEMA; }

>>

field_id0_const() ::= "FIELD_NONE"
field_id_const(field, options) ::= "FIELD_"
field_id0_const_declare() ::= <<
public static final int FIELD_NONE = 0;
>>
field_id_const_declare(field, options) ::= <<
public static final int  = ;
>>

message_impl_schema(message, options) ::= <<

public  newMessage() {
    return new ();
}

public Class\<\> typeClass() {
    return .class;
}

public String messageName() {
    return .class.getSimpleName();
}

public String messageFullName() {
    return .class.getName();
}







>>

message_method_is_initialized_delegate(message, options) ::= <<
public boolean isInitialized( message) {
    return message.isInitialized();
}
>>
message_method_is_initialized_true(message, options) ::= <<
public boolean isInitialized( message) {
    return true;
}
>>
message_method_is_initialized(message, options) ::= <<











>>

get_message_field_schema_dependency(field, options) ::= ".getSchema()"

message_field_merge(message, options, name) ::= <<

public void mergeFrom(Input input,  ) throws IOException {
    for (int fieldIx = input.readFieldNumber(this); fieldIx != ; fieldIx = input.readFieldNumber(this)) {
        mergeFrom(input, , fieldIx);
    }
}

public void mergeFrom(Input input,  , int fieldIx) throws IOException {
    switch (fieldIx) {
        case :
            return;
        
        
        
        
        
        
        
        
        
        
        
        default:
            input.handleUnknownField(fieldIx, this);
    }
}

>>

field_merge_switch(field, options, name, accessor) ::= <<
case :
    
    
>>

singular_field_merge_switch(field, options, name, accessor) ::= <<

.;
break;

.;
break;


.;

.;


break;

>>

rf_ms_get_collection(field, options, name, accessor) ::= <<


.get()

.




>>
rf_ms_set_collection(field, options, name, accessor) ::= <<


.set(new ArrayList\<\>());

. = new ArrayList\<\>();


.()"))>;

>>
rf_ms_collection_type(field, options) ::= <<





>>

repeated_field_merge_switch(field, options, name, accessor) ::= <<


if ( == null)
    


.add(input.mergeObject(null, ));
break;


if ( == null)
    .()"))>;


.add(.valueOf(input.readEnum()));
break;


if ( == null)
    .()"))>;



.add(input.readByteArray());

.add(input.read());


break;

>>

message_field_write(message, options, name) ::= <<

private static int[] FIELDS_TO_WRITE = {  };

public int[] getWriteFields() { return FIELDS_TO_WRITE; }

public void writeTo(Output output,  ) throws IOException {
    int[] toWrite = getWriteFields();
    for (int i = 0; i \< toWrite.length; i++) {
        writeTo(output, , toWrite[i]);
    }
}

public void writeTo(Output output,  , int fieldIx) throws IOException {
    switch (fieldIx) {
        case :
            break;
        
        
        
        
        
        
        
        
        
        
        
        default:
            break;
    }
}

>>

field_write_switch(field, options, name, accessor) ::= <<
case :
    
    
    
    break;
>>

singular_field_write_switch(field, options, name, accessor) ::= <<


output.writeObject(, , , false);

output.writeEnum(, .number, false);


output.writeByteArray(, , false);

output.write(, , false);





    output.writeObject(, , , false);


    output.writeEnum(, .number, false);



    
    output.writeByteArray(, , false);
    
    output.write(, , false);
    


>>

rf_ws_get_collection(field, options, name, accessor) ::= <<


.get()

.




>>
rf_ws_collection_type(field, options) ::= <<





>>
rf_ws_collection_entry(field, options) ::= <<
Entry
>>
rf_ws_check_function_decl(field, options) ::= <<

public boolean ( ) {
    return false;
}

>>
rf_ws_check_function_call(field, options) ::= <<

 && ()

>>
rf_ws_entry_cast(field, options) ::= <<

()

>>

repeated_field_write_switch(field, options, name, accessor) ::= <<

if ( != null) {
    for (  : ) {
        if ( != null)
            output.writeObject(, , , true);
    }
}

if ( != null) {
    for (  : ) {
        if ( != null)
            output.writeEnum(, .number, true);
    }
}

if ( != null) {
    for (  : ) {
        if ( != null)
            
            output.writeByteArray(, , true);
            
            output.write(, , true);
            
    }
}

>>

singular_field_accessor_write_check(field, options) ::= <<




if (.() != DEFAULT_)

if (.() != null && .() != DEFAULT_)


if (.() != null && .() != DEFAULT_)


if (.() != null)




if (.() != 0)

if (.() != null)


if (.() != null)


>>

message_field_map(message, options) ::= <<

public String getFieldName(int number) {
    switch(number) {
        
        default: return null;
    }
}

public int getFieldNumber(String name) {
    final Integer number = fieldMap.get(name);
    return number == null ? 0 : number.intValue();
}

final java.util.Map\ fieldMap = new java.util.HashMap\(); {
    
}

public String getFieldName(int number) {
    return Integer.toString(number);
}

public int getFieldNumber(String name) {
    return Integer.parseInt(name);
}

>>

field_map_alias(field, options) ::= <<


f

>>

field_switch_case(field, options) ::= <<
case : return "";
>>

field_map(field, options, mapVar) ::= <<
.put("", );
>>

message_static_schema_ref(message, options) ::= <<
SCHEMA
>>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy