mil.dod.th.ose.shared/src/mil/dod/th/ose/shared/protoconverter/JaxbConverter.java
private static void processField(final Object jaxbObject, final Builder protoBuilder, 
            final Class<? extends Message> messageClass, final FieldDescriptor fieldDesc) 
                    throws ObjectConverterException
    {
        final String protoFieldName = fieldDesc.getName();

        //if the field name is '_base' it is required and a type that is extended
        //by it's jaxb class
        if ("_base".equals(protoFieldName))
        {
            //retrieve the field type and build that proto message and set the field
            final Class<? extends Message> fieldType = findClass(protoFieldName.replace(UNDERSCORE, ""), messageClass);
            protoBuilder.setField(fieldDesc, buildProto(jaxbObject, fieldType));
            return;
        }
          // Don't check the isSet method for fields that belong to the UUID class. UUID is a java.util type and not 
          // an XSD generated class therefore the isSet method won't exist for fields in that class.
        else if (!(UUID.class.getSimpleName().toLowerCase().equals(protoFieldName)
                || "leastSignificantBits".equals(protoFieldName)
                || "mostSignificantBits".equals(protoFieldName)))
        {
            final boolean isSet = ConverterUtilities.isSet(jaxbObject, protoFieldName);
    
            if (!isSet)
            {
                return;
            }
        }

        final Object value = ConverterUtilities.getValue(jaxbObject, protoFieldName, fieldDesc.getType());

        if (value == null)
        {
            return;
        }

        if (fieldDesc.isRepeated())
        {
            // Raw type since the type of values in the list could vary depending on the object being converted.
            @SuppressWarnings("rawtypes")
            final List list = (List)value;
            for (Object item : list)
            {
                protoBuilder.addRepeatedField(fieldDesc,
                        checkValueForMessage(fieldDesc, item, protoFieldName, messageClass));
            }
        }
        else
        { 
            // pass parent object
            protoBuilder.setField(fieldDesc, checkValueForMessage(fieldDesc, value, protoFieldName, messageClass));
        }
    }
/**
     * Process the given field and add the value to the message builder.
     * @param jaxbObject
     *      the jaxb object containing the field's value
     * @param protoBuilder
     *      the message to add the given field's value to
     * @param messageClass
     *      the message class of the builder
     * @param fieldDesc
     *      the field to process
     * @throws ObjectConverterException
     *      if the field cannot be set 
     */
Process the given field and add the value to the message builder.
Process the given field and add the value to the message builder .
private static void processField(final Object jaxbObject, final Builder protoBuilder, 
            final Class<? extends Message> messageClass, final FieldDescriptor fieldDesc) 
                    throws ObjectConverterException
    {
        final String protoFieldName = fieldDesc.getName();
        if ("_base".equals(protoFieldName))
        {
            final Class<? extends Message> fieldType = findClass(protoFieldName.replace(UNDERSCORE, ""), messageClass);
            protoBuilder.setField(fieldDesc, buildProto(jaxbObject, fieldType));
            return;
        }
        else if (!(UUID.class.getSimpleName().toLowerCase().equals(protoFieldName)
                || "leastSignificantBits".equals(protoFieldName)
                || "mostSignificantBits".equals(protoFieldName)))
        {
            final boolean isSet = ConverterUtilities.isSet(jaxbObject, protoFieldName);
            if (!isSet)
            {
                return;
            }
        }
        final Object value = ConverterUtilities.getValue(jaxbObject, protoFieldName, fieldDesc.getType());
        if (value == null)
        {
            return;
        }
        if (fieldDesc.isRepeated())
        {
            @SuppressWarnings("rawtypes")
            final List list = (List)value;
            for (Object item : list)
            {
                protoBuilder.addRepeatedField(fieldDesc,
                        checkValueForMessage(fieldDesc, item, protoFieldName, messageClass));
            }
        }
        else
        { 
            protoBuilder.setField(fieldDesc, checkValueForMessage(fieldDesc, value, protoFieldName, messageClass));
        }
    }
private static void processField ( final Object jaxbObject , final Builder protoBuilder , final Class < ? extends Message > messageClass , final FieldDescriptor fieldDesc ) throws ObjectConverterException { final String protoFieldName = fieldDesc . getName ( ) ; if ( "_base" . equals ( protoFieldName ) ) { final Class < ? extends Message > fieldType = findClass ( protoFieldName . replace ( UNDERSCORE , "" ) , messageClass ) ; protoBuilder . setField ( fieldDesc , buildProto ( jaxbObject , fieldType ) ) ; return ; } else if ( ! ( UUID . class . getSimpleName ( ) . toLowerCase ( ) . equals ( protoFieldName ) || "leastSignificantBits" . equals ( protoFieldName ) || "mostSignificantBits" . equals ( protoFieldName ) ) ) { final boolean isSet = ConverterUtilities . isSet ( jaxbObject , protoFieldName ) ; if ( ! isSet ) { return ; } } final Object value = ConverterUtilities . getValue ( jaxbObject , protoFieldName , fieldDesc . getType ( ) ) ; if ( value == null ) { return ; } if ( fieldDesc . isRepeated ( ) ) { @ SuppressWarnings ( "rawtypes" ) final List list = ( List ) value ; for ( Object item : list ) { protoBuilder . addRepeatedField ( fieldDesc , checkValueForMessage ( fieldDesc , item , protoFieldName , messageClass ) ) ; } } else { protoBuilder . setField ( fieldDesc , checkValueForMessage ( fieldDesc , value , protoFieldName , messageClass ) ) ; } }
Process the given field and add the value to the message builder.
Process the given field and add the value to the message builder .
//if the field name is '_base' it is required and a type that is extended //by it's jaxb class //retrieve the field type and build that proto message and set the field // Don't check the isSet method for fields that belong to the UUID class. UUID is a java.util type and not  // an XSD generated class therefore the isSet method won't exist for fields in that class. // Raw type since the type of values in the list could vary depending on the object being converted. // pass parent object