mil.dod.th.ose.jaxb.proto.converter/src/mil/dod/th/ose/jaxbprotoconverter/ProtoFileGenerator.java
private String buildFieldString(final ProtoField field, final int index)
    {
        final StringBuilder fieldBuilder = new StringBuilder("  ");
        
        final String packString = appendRule(field, fieldBuilder);
        
        switch (field.getType())
        {
            case Bytes:
                fieldBuilder.append("bytes");
                break;
            case Int32:
                fieldBuilder.append("int32");
                break;
            case Int64:
                fieldBuilder.append("int64");
                break;
            case Reference:
                fieldBuilder.append(getFieldReferenceType(field));
                break;
            case Enum:
                final ProtoElement element = field.getTypeRef();
                fieldBuilder.append(element.getType().getSimpleName().replace(ProtoEnum.ENUM, PACKAGE_SEPARATOR 
                        + element.getName()));
                break;
            case String:
                fieldBuilder.append("string");
                break;
            case UInt32:
                fieldBuilder.append("uint32");
                break;
            case UInt64:
                fieldBuilder.append("uint64");
                break;
            case Double:
                fieldBuilder.append("double");
                break;
            case Float:
                fieldBuilder.append("float");
                break;
            case Boolean:
                fieldBuilder.append("bool");
                break;
            default:
                throw new IllegalStateException("Invalid field type: " + field.getType()); 
        }
        
        fieldBuilder.append(String.format(" %s = %d%s;%n", field.getName(), index, packString));

        return fieldBuilder.toString();
    }
/**
     * This method is responsible for taking a specified {@link ProtoField} and creating the string representation of
     * that field.
     * 
     * @param field
     *      The {@link ProtoField} to be converted to its string representation.
     * @param index
     *      The index value to be printed for the field.
     * @return
     *      The string representation of the field.
     */
This method is responsible for taking a specified  ProtoField and creating the string representation of
that field.

@param field
The  ProtoField to be converted to its string representation.
@param index
The index value to be printed for the field.
@return
The string representation of the field.
This method is responsible for taking a specified ProtoField and creating the string representation of that field . @param field The ProtoField to be converted to its string representation . @param index The index value to be printed for the field . @return The string representation of the field .
private String buildFieldString(final ProtoField field, final int index)
    {
        final StringBuilder fieldBuilder = new StringBuilder("  ");
        final String packString = appendRule(field, fieldBuilder);
        switch (field.getType())
        {
            case Bytes:
                fieldBuilder.append("bytes");
                break;
            case Int32:
                fieldBuilder.append("int32");
                break;
            case Int64:
                fieldBuilder.append("int64");
                break;
            case Reference:
                fieldBuilder.append(getFieldReferenceType(field));
                break;
            case Enum:
                final ProtoElement element = field.getTypeRef();
                fieldBuilder.append(element.getType().getSimpleName().replace(ProtoEnum.ENUM, PACKAGE_SEPARATOR 
                        + element.getName()));
                break;
            case String:
                fieldBuilder.append("string");
                break;
            case UInt32:
                fieldBuilder.append("uint32");
                break;
            case UInt64:
                fieldBuilder.append("uint64");
                break;
            case Double:
                fieldBuilder.append("double");
                break;
            case Float:
                fieldBuilder.append("float");
                break;
            case Boolean:
                fieldBuilder.append("bool");
                break;
            default:
                throw new IllegalStateException("Invalid field type: " + field.getType()); 
        }
        fieldBuilder.append(String.format(" %s = %d%s;%n", field.getName(), index, packString));
        return fieldBuilder.toString();
    }
private String buildFieldString ( final ProtoField field , final int index ) { final StringBuilder fieldBuilder = new StringBuilder ( "  " ) ; final String packString = appendRule ( field , fieldBuilder ) ; switch ( field . getType ( ) ) { case Bytes : fieldBuilder . append ( "bytes" ) ; break ; case Int32 : fieldBuilder . append ( "int32" ) ; break ; case Int64 : fieldBuilder . append ( "int64" ) ; break ; case Reference : fieldBuilder . append ( getFieldReferenceType ( field ) ) ; break ; case Enum : final ProtoElement element = field . getTypeRef ( ) ; fieldBuilder . append ( element . getType ( ) . getSimpleName ( ) . replace ( ProtoEnum . ENUM , PACKAGE_SEPARATOR + element . getName ( ) ) ) ; break ; case String : fieldBuilder . append ( "string" ) ; break ; case UInt32 : fieldBuilder . append ( "uint32" ) ; break ; case UInt64 : fieldBuilder . append ( "uint64" ) ; break ; case Double : fieldBuilder . append ( "double" ) ; break ; case Float : fieldBuilder . append ( "float" ) ; break ; case Boolean : fieldBuilder . append ( "bool" ) ; break ; default : throw new IllegalStateException ( "Invalid field type: " + field . getType ( ) ) ; } fieldBuilder . append ( String . format ( " %s = %d%s;%n" , field . getName ( ) , index , packString ) ) ; return fieldBuilder . toString ( ) ; }
This method is responsible for taking a specified {@link ProtoField} and creating the string representation of
 that field.
This method is responsible for taking a specified { @link ProtoField } and creating the string representation of that field .