mil.dod.th.ose.jaxb.proto.converter/src/mil/dod/th/ose/jaxbprotoconverter/ProtoFileGenerator.java
private void printMessageContents(final PrintStream outStream, final ProtoMessage message) 
            throws JaxbProtoConvertException
    {
        final XsdType xsdType = message.getXsdType();
        final ProtoMessage baseMessage = message.getBaseMessage();
        if (baseMessage != null && xsdType.isComplexRestriction())
        {
            printMessageContents(outStream, baseMessage);
        }
        else if (baseMessage != null && !xsdType.isComplexRestriction())
        {
            outStream.format("  required %s _base = %d;%n", baseMessage.getName(), BASE_MESSAGE_INDEX);
        }
        
        final ProtoEnum nestedEnum = message.getEnumeration();
        if (nestedEnum != null)
        {
            printEnum(outStream, nestedEnum);
        }
        
        if (message.getFields().isEmpty() 
                && nestedEnum == null 
                && xsdType.getBaseType() == null)
        {
            throw new JaxbProtoConvertException(String.format("Message %s of type %s is empty, this should not occur", 
                    message.getName(), message.getClass().getName()));
        }
        printAllFields(message, xsdType, outStream);
    }
/**
     * Method that prints the contents of a {@link ProtoMessage}.
     * 
     * @param outStream
     *      The output stream the {@link ProtoMessage} contents will be written to.
     * @param message
     *      The {@link ProtoMessage} whose contents will be written to the {@link PrintStream}.
     * @throws JaxbProtoConvertException
     *      If the proto message is empty.
     */
Method that prints the contents of a  ProtoMessage.

@param outStream
The output stream the  ProtoMessage contents will be written to.
@param message
The  ProtoMessage whose contents will be written to the  PrintStream.
@throws JaxbProtoConvertException
If the proto message is empty.
Method that prints the contents of a ProtoMessage . @param outStream The output stream the ProtoMessage contents will be written to . @param message The ProtoMessage whose contents will be written to the PrintStream . @throws JaxbProtoConvertException If the proto message is empty .
private void printMessageContents(final PrintStream outStream, final ProtoMessage message) 
            throws JaxbProtoConvertException
    {
        final XsdType xsdType = message.getXsdType();
        final ProtoMessage baseMessage = message.getBaseMessage();
        if (baseMessage != null && xsdType.isComplexRestriction())
        {
            printMessageContents(outStream, baseMessage);
        }
        else if (baseMessage != null && !xsdType.isComplexRestriction())
        {
            outStream.format("  required %s _base = %d;%n", baseMessage.getName(), BASE_MESSAGE_INDEX);
        }
        final ProtoEnum nestedEnum = message.getEnumeration();
        if (nestedEnum != null)
        {
            printEnum(outStream, nestedEnum);
        }
        if (message.getFields().isEmpty() 
                && nestedEnum == null 
                && xsdType.getBaseType() == null)
        {
            throw new JaxbProtoConvertException(String.format("Message %s of type %s is empty, this should not occur", 
                    message.getName(), message.getClass().getName()));
        }
        printAllFields(message, xsdType, outStream);
    }
private void printMessageContents ( final PrintStream outStream , final ProtoMessage message ) throws JaxbProtoConvertException { final XsdType xsdType = message . getXsdType ( ) ; final ProtoMessage baseMessage = message . getBaseMessage ( ) ; if ( baseMessage != null && xsdType . isComplexRestriction ( ) ) { printMessageContents ( outStream , baseMessage ) ; } else if ( baseMessage != null && ! xsdType . isComplexRestriction ( ) ) { outStream . format ( "  required %s _base = %d;%n" , baseMessage . getName ( ) , BASE_MESSAGE_INDEX ) ; } final ProtoEnum nestedEnum = message . getEnumeration ( ) ; if ( nestedEnum != null ) { printEnum ( outStream , nestedEnum ) ; } if ( message . getFields ( ) . isEmpty ( ) && nestedEnum == null && xsdType . getBaseType ( ) == null ) { throw new JaxbProtoConvertException ( String . format ( "Message %s of type %s is empty, this should not occur" , message . getName ( ) , message . getClass ( ) . getName ( ) ) ) ; } printAllFields ( message , xsdType , outStream ) ; }
Method that prints the contents of a {@link ProtoMessage}.
Method that prints the contents of a { @link ProtoMessage } .