mil.dod.th.ose.jaxb.proto.converter/src/mil/dod/th/ose/jaxbprotoconverter/ProtoFileGenerator.java
private void printAllFields(final ProtoMessage message, final XsdType xsdType, final PrintStream outStream) 
            throws JaxbProtoConvertException
    {
        for (String fieldName: xsdType.getFieldsMap().keySet())
        {
            //TD: May want to update converter to have generated proto files use the prtoobuf deprecated flag for
            //deprecated fields instead of not generating them. Also need to determine if the deprecated prefix and 
            //handling of deprecated fields is needed since renaming a field by prefixing it with "_DEPRECATED_" 
            //technically is an API breaking change.
            if (fieldName.contains("_DEPRECATED_"))
            {
                continue;
            }
            final ProtoField field = message.getFields().get(fieldName);
            final XsdField xsdField = xsdType.getFieldsMap().get(fieldName);
            //Check if the field index is the same as the index reserved for base messages. If it is then 
            //increment it by 1.
            final int fieldIndex = xsdField.getIndex() >= BASE_MESSAGE_INDEX 
                    ? xsdField.getIndex() + 1 : xsdField.getIndex();
            final String fieldString = buildFieldString(field, fieldIndex);
            try
            {
                printField(outStream, fieldString, xsdField.isIndexOverridden());
            }
            catch (final Exception e)
            {
                throw new JaxbProtoConvertException("Unable to print field " + field.getName() + " for message " 
                        + message.getName(), e);
            }            
        }   
    }
/**
     * Prints all fields for the specified message.
     * 
     * @param message
     *      The message to containing the fields to be printed.
     * @param xsdType
     *      The XSD type that represents the message.
     * @param outStream
     *      Print stream the message should be printed to.
     * @throws JaxbProtoConvertException
     *      Thrown if a field cannot be printed.
     */
Prints all fields for the specified message.

@param message
The message to containing the fields to be printed.
@param xsdType
The XSD type that represents the message.
@param outStream
Print stream the message should be printed to.
@throws JaxbProtoConvertException
Thrown if a field cannot be printed.
Prints all fields for the specified message . @param message The message to containing the fields to be printed . @param xsdType The XSD type that represents the message . @param outStream Print stream the message should be printed to . @throws JaxbProtoConvertException Thrown if a field cannot be printed .
private void printAllFields(final ProtoMessage message, final XsdType xsdType, final PrintStream outStream) 
            throws JaxbProtoConvertException
    {
        for (String fieldName: xsdType.getFieldsMap().keySet())
        {
            if (fieldName.contains("_DEPRECATED_"))
            {
                continue;
            }
            final ProtoField field = message.getFields().get(fieldName);
            final XsdField xsdField = xsdType.getFieldsMap().get(fieldName);
            final int fieldIndex = xsdField.getIndex() >= BASE_MESSAGE_INDEX 
                    ? xsdField.getIndex() + 1 : xsdField.getIndex();
            final String fieldString = buildFieldString(field, fieldIndex);
            try
            {
                printField(outStream, fieldString, xsdField.isIndexOverridden());
            }
            catch (final Exception e)
            {
                throw new JaxbProtoConvertException("Unable to print field " + field.getName() + " for message " 
                        + message.getName(), e);
            }            
        }   
    }
private void printAllFields ( final ProtoMessage message , final XsdType xsdType , final PrintStream outStream ) throws JaxbProtoConvertException { for ( String fieldName : xsdType . getFieldsMap ( ) . keySet ( ) ) { if ( fieldName . contains ( "_DEPRECATED_" ) ) { continue ; } final ProtoField field = message . getFields ( ) . get ( fieldName ) ; final XsdField xsdField = xsdType . getFieldsMap ( ) . get ( fieldName ) ; final int fieldIndex = xsdField . getIndex ( ) >= BASE_MESSAGE_INDEX ? xsdField . getIndex ( ) + 1 : xsdField . getIndex ( ) ; final String fieldString = buildFieldString ( field , fieldIndex ) ; try { printField ( outStream , fieldString , xsdField . isIndexOverridden ( ) ) ; } catch ( final Exception e ) { throw new JaxbProtoConvertException ( "Unable to print field " + field . getName ( ) + " for message " + message . getName ( ) , e ) ; } } }
Prints all fields for the specified message.
Prints all fields for the specified message .
//TD: May want to update converter to have generated proto files use the prtoobuf deprecated flag for //deprecated fields instead of not generating them. Also need to determine if the deprecated prefix and  //handling of deprecated fields is needed since renaming a field by prefixing it with "_DEPRECATED_"  //technically is an API breaking change. //Check if the field index is the same as the index reserved for base messages. If it is then  //increment it by 1.