mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/utils/AssetCommandUtil.java
public static Message.Builder createMessageBuilderFromCommandType(final Class<?> clazz) throws 
            NoSuchMethodException, 
            SecurityException, ClassNotFoundException, IllegalAccessException, 
            IllegalArgumentException, InvocationTargetException
    {
        //Call the static new builder method to instantiate the command.
        final Method newBuilderMethod = clazz.getDeclaredMethod("newBuilder");
        final Message.Builder builder = (Message.Builder)newBuilderMethod.invoke(null);
        
        //Build and set a base command for the command message builder that was instantiated.
        final BaseTypesGen.Command baseCommand = BaseTypesGen.Command.newBuilder().build();
        final Method setBaseCommand = builder.getClass().getDeclaredMethod("setBase", BaseTypesGen.Command.class);
        setBaseCommand.invoke(builder, baseCommand);
        
        return builder;
    }
/**
     * Function to create a Message.Builder instance for the given class.
     * @param clazz
     *          the class of the Message.Builder that is to be created
     * @return
     *          the Message.Builder for the given {@link CommandTypeEnum}
     * @throws NoSuchMethodException
     *          if the "newBuilder" method on the Message.Builder cannot be found
     * @throws SecurityException
     *          if the rights to access methods on the Message.Builder for the given type do not exist
     * @throws ClassNotFoundException
     *          if the class based on the given {@link CommandTypeEnum} cannot be found
     * @throws IllegalAccessException
     *          if the rights to access methods on the Message.Builder for the given type do not exist
     * @throws IllegalArgumentException
     *          if an invalid argument is passed when creating the Message.Builder instance
     * @throws InvocationTargetException
     *          if the Message.Builder instance cannot be created
     */
Function to create a Message.Builder instance for the given class.
Function to create a Message . Builder instance for the given class .
public static Message.Builder createMessageBuilderFromCommandType(final Class<?> clazz) throws 
            NoSuchMethodException, 
            SecurityException, ClassNotFoundException, IllegalAccessException, 
            IllegalArgumentException, InvocationTargetException
    {
        final Method newBuilderMethod = clazz.getDeclaredMethod("newBuilder");
        final Message.Builder builder = (Message.Builder)newBuilderMethod.invoke(null);
        final BaseTypesGen.Command baseCommand = BaseTypesGen.Command.newBuilder().build();
        final Method setBaseCommand = builder.getClass().getDeclaredMethod("setBase", BaseTypesGen.Command.class);
        setBaseCommand.invoke(builder, baseCommand);
        return builder;
    }
public static Message . Builder createMessageBuilderFromCommandType ( final Class < ? > clazz ) throws NoSuchMethodException , SecurityException , ClassNotFoundException , IllegalAccessException , IllegalArgumentException , InvocationTargetException { final Method newBuilderMethod = clazz . getDeclaredMethod ( "newBuilder" ) ; final Message . Builder builder = ( Message . Builder ) newBuilderMethod . invoke ( null ) ; final BaseTypesGen . Command baseCommand = BaseTypesGen . Command . newBuilder ( ) . build ( ) ; final Method setBaseCommand = builder . getClass ( ) . getDeclaredMethod ( "setBase" , BaseTypesGen . Command . class ) ; setBaseCommand . invoke ( builder , baseCommand ) ; return builder ; }
Function to create a Message.Builder instance for the given class.
Function to create a Message . Builder instance for the given class .
//Call the static new builder method to instantiate the command. //Build and set a base command for the command message builder that was instantiated.