Class DumpParameterListExample


  • public class DumpParameterListExample
    extends Object
    This class is an executable main that loads an XTCE database file and dumps the parameters to STDOUT.

    The following is an example based on this demonstration class file. The class main() requires a command line argument to point to the database file instead of the "myfile.xml" used in the example code below.

     
     try {
    
    
         XTCEDatabase db = new XTCEDatabase( new File( "myfile.xml" ),
                                             false,  // skip XSD validation
                                             true,   // apply the XIncludes
                                             true ); // ReadOnly
    
         List<XTCEParameter> parameters = db.getTelemetryParameters();
    
         for ( XTCEParameter parameter : parameters ) {
    
             List<XTCEAlias> aliases = parameter.getAliasSet();
    
             StringBuilder builder = new StringBuilder();
             for ( XTCEAlias alias : aliases ) {
                 builder.append( alias.getFullAliasName() );
                 builder.append( " " );
             }
    
             System.out.println( parameter.getName() +
                                 " " +
                                 builder.toString() );
    
         }
    
     } catch ( Exception ex ) {
    
         System.out.println( "Exception: " + ex.getLocalizedMessage() );
         ex.printStackTrace();
    
     }
     
     
    Author:
    David Overeem
    • Constructor Detail

      • DumpParameterListExample

        public DumpParameterListExample()
    • Method Detail

      • main

        public static void main​(String[] args)
        The main executable function
        Parameters:
        args - the command line arguments. One argument is expected, which is the name of an XTCE database file to load.