View Javadoc
1   // SECTION-START[License Header]
2   // <editor-fold defaultstate="collapsed" desc=" Generated License ">
3   /*
4    * Java Object Management and Configuration
5    * Copyright (C) Christian Schulte <cs@schulte.it>, 2005-206
6    * All rights reserved.
7    *
8    * Redistribution and use in source and binary forms, with or without
9    * modification, are permitted provided that the following conditions
10   * are met:
11   *
12   *   o Redistributions of source code must retain the above copyright
13   *     notice, this list of conditions and the following disclaimer.
14   *
15   *   o Redistributions in binary form must reproduce the above copyright
16   *     notice, this list of conditions and the following disclaimer in
17   *     the documentation and/or other materials provided with the
18   *     distribution.
19   *
20   * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22   * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23   * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
24   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30   *
31   * $JOMC: AbstractCommand.java 5061 2015-05-31 13:20:40Z schulte $
32   *
33   */
34  // </editor-fold>
35  // SECTION-END
36  package org.jomc.cli.commands;
37  
38  import java.util.LinkedList;
39  import java.util.List;
40  import java.util.Locale;
41  import java.util.logging.Level;
42  import org.apache.commons.cli.CommandLine;
43  
44  // SECTION-START[Documentation]
45  // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
46  /**
47   * JOMC ⁑ CLI ⁑ command implementation.
48   *
49   * <dl>
50   *   <dt><b>Identifier:</b></dt><dd>JOMC ⁑ CLI ⁑ Command</dd>
51   *   <dt><b>Name:</b></dt><dd>JOMC ⁑ CLI ⁑ Command</dd>
52   *   <dt><b>Specifications:</b></dt>
53   *     <dd>JOMC ⁑ CLI ⁑ Command @ 1.0</dd>
54   *   <dt><b>Abstract:</b></dt><dd>Yes</dd>
55   *   <dt><b>Final:</b></dt><dd>No</dd>
56   *   <dt><b>Stateless:</b></dt><dd>No</dd>
57   * </dl>
58   *
59   * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 1.0
60   * @version 1.9
61   */
62  // </editor-fold>
63  // SECTION-END
64  // SECTION-START[Annotations]
65  // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
66  @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
67  // </editor-fold>
68  // SECTION-END
69  public abstract class AbstractCommand
70      implements
71      org.jomc.cli.Command
72  {
73      // SECTION-START[Command]
74  
75      /**
76       * The listeners of the instance.
77       */
78      private List<Listener> listeners;
79  
80      /**
81       * Log level of the instance.
82       */
83      private Level logLevel;
84  
85      /**
86       * Gets the list of registered listeners.
87       * <p>
88       * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make
89       * to the returned list will be present inside the object. This is why there is no {@code set} method for the
90       * listeners property.
91       * </p>
92       *
93       * @return The list of registered listeners.
94       *
95       * @see #log(java.util.logging.Level, java.lang.String, java.lang.Throwable)
96       */
97      public final List<Listener> getListeners()
98      {
99          if ( this.listeners == null )
100         {
101             this.listeners = new LinkedList<Listener>();
102         }
103 
104         return this.listeners;
105     }
106 
107     /**
108      * Gets the log level of the instance.
109      *
110      * @return The log level of the instance.
111      *
112      * @see #getDefaultLogLevel()
113      * @see #setLogLevel(java.util.logging.Level)
114      * @see #isLoggable(java.util.logging.Level)
115      */
116     public final Level getLogLevel()
117     {
118         if ( this.logLevel == null )
119         {
120             this.logLevel = getDefaultLogLevel();
121 
122             if ( this.isLoggable( Level.CONFIG ) )
123             {
124                 this.log( Level.CONFIG,
125                           this.getDefaultLogLevelInfo( this.getLocale(), this.logLevel.getLocalizedName() ), null );
126 
127             }
128         }
129 
130         return this.logLevel;
131     }
132 
133     /**
134      * Sets the log level of the instance.
135      *
136      * @param value The new log level of the instance or {@code null}.
137      *
138      * @see #getLogLevel()
139      * @see #isLoggable(java.util.logging.Level)
140      */
141     public final void setLogLevel( final Level value )
142     {
143         this.logLevel = value;
144     }
145 
146     public final String getName()
147     {
148         return this.getCommandName();
149     }
150 
151     public final String getAbbreviatedName()
152     {
153         return this.getAbbreviatedCommandName();
154     }
155 
156     public final String getShortDescription( final Locale locale )
157     {
158         return this.getShortDescriptionMessage( locale );
159     }
160 
161     public final String getLongDescription( final Locale locale )
162     {
163         return this.getLongDescriptionMessage( locale );
164     }
165 
166     public final int execute( final CommandLine commandLine )
167     {
168         if ( commandLine == null )
169         {
170             throw new NullPointerException( "commandLine" );
171         }
172 
173         int status;
174 
175         try
176         {
177             if ( this.isLoggable( Level.INFO ) )
178             {
179                 this.log( Level.INFO, this.getSeparator( this.getLocale() ), null );
180                 this.log( Level.INFO, this.getApplicationTitle( this.getLocale() ), null );
181                 this.log( Level.INFO, this.getSeparator( this.getLocale() ), null );
182                 this.log( Level.INFO, this.getCommandInfoMessage( this.getLocale(), this.getCommandName() ), null );
183             }
184 
185             this.preExecuteCommand( commandLine );
186             this.executeCommand( commandLine );
187             status = STATUS_SUCCESS;
188         }
189         catch ( final Throwable t )
190         {
191             this.log( Level.SEVERE, null, t );
192             status = STATUS_FAILURE;
193         }
194         finally
195         {
196             try
197             {
198                 this.postExecuteCommand( commandLine );
199             }
200             catch ( final Throwable t )
201             {
202                 this.log( Level.SEVERE, null, t );
203                 status = STATUS_FAILURE;
204             }
205         }
206 
207         if ( this.isLoggable( Level.INFO ) )
208         {
209             if ( status == STATUS_SUCCESS )
210             {
211                 this.log( Level.INFO, this.getCommandSuccessMessage( this.getLocale(), this.getCommandName() ), null );
212             }
213             else if ( status == STATUS_FAILURE )
214             {
215                 this.log( Level.INFO, this.getCommandFailureMessage( this.getLocale(), this.getCommandName() ), null );
216             }
217 
218             this.log( Level.INFO, this.getSeparator( this.getLocale() ), null );
219         }
220 
221         return status;
222     }
223 
224     // SECTION-END
225     // SECTION-START[AbstractCommand]
226     /**
227      * Default log level.
228      */
229     private static volatile Level defaultLogLevel;
230 
231     /**
232      * Gets the default log level events are logged at.
233      * <p>
234      * The default log level is controlled by system property
235      * {@code org.jomc.cli.commands.AbstractCommand.defaultLogLevel} holding the log level to log events at by
236      * default. If that property is not set, the {@code WARNING} default is returned.
237      * </p>
238      *
239      * @return The log level events are logged at by default.
240      *
241      * @see #getLogLevel()
242      * @see Level#parse(java.lang.String)
243      */
244     public static Level getDefaultLogLevel()
245     {
246         if ( defaultLogLevel == null )
247         {
248             defaultLogLevel = Level.parse(
249                 System.getProperty( "org.jomc.cli.command.AbstractJomcCommand.defaultLogLevel",
250                                     System.getProperty( "org.jomc.cli.commands.AbstractCommand.defaultLogLevel",
251                                                         Level.WARNING.getName() ) ) );
252 
253         }
254 
255         return defaultLogLevel;
256     }
257 
258     /**
259      * Sets the default log level events are logged at.
260      *
261      * @param value The new default level events are logged at or {@code null}.
262      *
263      * @see #getDefaultLogLevel()
264      */
265     public static void setDefaultLogLevel( final Level value )
266     {
267         defaultLogLevel = value;
268     }
269 
270     /**
271      * Checks if a message at a given level is provided to the listeners of the instance.
272      *
273      * @param level The level to test.
274      *
275      * @return {@code true}, if messages at {@code level} are provided to the listeners of the instance;
276      * {@code false}, if messages at {@code level} are not provided to the listeners of the instance.
277      *
278      * @throws NullPointerException if {@code level} is {@code null}.
279      *
280      * @see #getLogLevel()
281      * @see #setLogLevel(java.util.logging.Level)
282      */
283     protected boolean isLoggable( final Level level )
284     {
285         if ( level == null )
286         {
287             throw new NullPointerException( "level" );
288         }
289 
290         return level.intValue() >= this.getLogLevel().intValue();
291     }
292 
293     /**
294      * Notifies registered listeners.
295      *
296      * @param level The level of the event.
297      * @param message The message of the event or {@code null}.
298      * @param throwable The throwable of the event {@code null}.
299      *
300      * @throws NullPointerException if {@code level} is {@code null}.
301      *
302      * @see #getListeners()
303      * @see #isLoggable(java.util.logging.Level)
304      */
305     protected void log( final Level level, final String message, final Throwable throwable )
306     {
307         if ( level == null )
308         {
309             throw new NullPointerException( "level" );
310         }
311 
312         if ( this.isLoggable( level ) )
313         {
314             for ( final Listener l : this.getListeners() )
315             {
316                 l.onLog( level, message, throwable );
317             }
318         }
319     }
320 
321     /**
322      * Called by the {@code execute} method prior to the {@code executeCommand} method.
323      *
324      * @param commandLine The command line to execute.
325      *
326      * @throws NullPointerException if {@code commandLine} is {@code null}.
327      * @throws CommandExecutionException if executing the command fails.
328      *
329      * @see #execute(org.apache.commons.cli.CommandLine)
330      */
331     protected void preExecuteCommand( final CommandLine commandLine ) throws CommandExecutionException
332     {
333         if ( commandLine == null )
334         {
335             throw new NullPointerException( "commandLine" );
336         }
337     }
338 
339     /**
340      * Called by the {@code execute} method prior to the {@code postExecuteCommand} method.
341      *
342      * @param commandLine The command line to execute.
343      *
344      * @throws CommandExecutionException if executing the command fails.
345      *
346      * @see #execute(org.apache.commons.cli.CommandLine)
347      */
348     protected abstract void executeCommand( final CommandLine commandLine ) throws CommandExecutionException;
349 
350     /**
351      * Called by the {@code execute} method after the {@code preExecuteCommand}/{@code executeCommand} methods even if
352      * those methods threw an exception.
353      *
354      * @param commandLine The command line to execute.
355      *
356      * @throws NullPointerException if {@code commandLine} is {@code null}.
357      * @throws CommandExecutionException if executing the command fails.
358      *
359      * @see #execute(org.apache.commons.cli.CommandLine)
360      */
361     protected void postExecuteCommand( final CommandLine commandLine ) throws CommandExecutionException
362     {
363         if ( commandLine == null )
364         {
365             throw new NullPointerException( "commandLine" );
366         }
367     }
368 
369     /**
370      * Gets a message of a given {@code Throwable} recursively.
371      *
372      * @param t The {@code Throwable} to get the message of or {@code null}.
373      *
374      * @return The message associated with {@code t} or {@code null}.
375      */
376     protected static String getExceptionMessage( final Throwable t )
377     {
378         return t != null
379                    ? t.getMessage() != null && t.getMessage().trim().length() > 0
380                          ? t.getMessage()
381                          : getExceptionMessage( t.getCause() )
382                    : null;
383 
384     }
385 
386     // SECTION-END
387     // SECTION-START[Constructors]
388     // <editor-fold defaultstate="collapsed" desc=" Generated Constructors ">
389     /** Creates a new {@code AbstractCommand} instance. */
390     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
391     public AbstractCommand()
392     {
393         // SECTION-START[Default Constructor]
394         super();
395         // SECTION-END
396     }
397     // </editor-fold>
398     // SECTION-END
399     // SECTION-START[Dependencies]
400     // <editor-fold defaultstate="collapsed" desc=" Generated Dependencies ">
401     /**
402      * Gets the {@code <Locale>} dependency.
403      * <p>
404      *   This method returns the {@code <default>} object of the {@code <java.util.Locale>} specification at specification level 1.1.
405      *   That specification does not apply to any scope. A new object is returned whenever requested and bound to this instance.
406      * </p>
407      * <dl>
408      *   <dt><b>Final:</b></dt><dd>No</dd>
409      * </dl>
410      * @return The {@code <Locale>} dependency.
411      * @throws org.jomc.ObjectManagementException if getting the dependency instance fails.
412      */
413     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
414     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
415     private java.util.Locale getLocale()
416     {
417         final java.util.Locale _d = (java.util.Locale) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getDependency( this, "Locale" );
418         assert _d != null : "'Locale' dependency not found.";
419         return _d;
420     }
421     // </editor-fold>
422     // SECTION-END
423     // SECTION-START[Properties]
424     // <editor-fold defaultstate="collapsed" desc=" Generated Properties ">
425     /**
426      * Gets the value of the {@code <Abbreviated Command Name>} property.
427      * <p><dl>
428      *   <dt><b>Final:</b></dt><dd>No</dd>
429      * </dl></p>
430      * @return Abbreviated name of the command.
431      * @throws org.jomc.ObjectManagementException if getting the property instance fails.
432      */
433     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
434     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
435     private java.lang.String getAbbreviatedCommandName()
436     {
437         final java.lang.String _p = (java.lang.String) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getProperty( this, "Abbreviated Command Name" );
438         assert _p != null : "'Abbreviated Command Name' property not found.";
439         return _p;
440     }
441     /**
442      * Gets the value of the {@code <Command Name>} property.
443      * <p><dl>
444      *   <dt><b>Final:</b></dt><dd>No</dd>
445      * </dl></p>
446      * @return Name of the command.
447      * @throws org.jomc.ObjectManagementException if getting the property instance fails.
448      */
449     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
450     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
451     private java.lang.String getCommandName()
452     {
453         final java.lang.String _p = (java.lang.String) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getProperty( this, "Command Name" );
454         assert _p != null : "'Command Name' property not found.";
455         return _p;
456     }
457     // </editor-fold>
458     // SECTION-END
459     // SECTION-START[Messages]
460     // <editor-fold defaultstate="collapsed" desc=" Generated Messages ">
461     /**
462      * Gets the text of the {@code <Application Title>} message.
463      * <p><dl>
464      *   <dt><b>Languages:</b></dt>
465      *     <dd>English (default)</dd>
466      *   <dt><b>Final:</b></dt><dd>No</dd>
467      * </dl></p>
468      * @param locale The locale of the message to return.
469      * @return The text of the {@code <Application Title>} message for {@code locale}.
470      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
471      */
472     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
473     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
474     private String getApplicationTitle( final java.util.Locale locale )
475     {
476         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Application Title", locale );
477         assert _m != null : "'Application Title' message not found.";
478         return _m;
479     }
480     /**
481      * Gets the text of the {@code <Command Failure Message>} message.
482      * <p><dl>
483      *   <dt><b>Languages:</b></dt>
484      *     <dd>English (default)</dd>
485      *     <dd>Deutsch</dd>
486      *   <dt><b>Final:</b></dt><dd>No</dd>
487      * </dl></p>
488      * @param locale The locale of the message to return.
489      * @param toolName Format argument.
490      * @return The text of the {@code <Command Failure Message>} message for {@code locale}.
491      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
492      */
493     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
494     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
495     private String getCommandFailureMessage( final java.util.Locale locale, final java.lang.String toolName )
496     {
497         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Command Failure Message", locale, toolName );
498         assert _m != null : "'Command Failure Message' message not found.";
499         return _m;
500     }
501     /**
502      * Gets the text of the {@code <Command Info Message>} message.
503      * <p><dl>
504      *   <dt><b>Languages:</b></dt>
505      *     <dd>English (default)</dd>
506      *     <dd>Deutsch</dd>
507      *   <dt><b>Final:</b></dt><dd>No</dd>
508      * </dl></p>
509      * @param locale The locale of the message to return.
510      * @param toolName Format argument.
511      * @return The text of the {@code <Command Info Message>} message for {@code locale}.
512      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
513      */
514     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
515     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
516     private String getCommandInfoMessage( final java.util.Locale locale, final java.lang.String toolName )
517     {
518         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Command Info Message", locale, toolName );
519         assert _m != null : "'Command Info Message' message not found.";
520         return _m;
521     }
522     /**
523      * Gets the text of the {@code <Command Success Message>} message.
524      * <p><dl>
525      *   <dt><b>Languages:</b></dt>
526      *     <dd>English (default)</dd>
527      *     <dd>Deutsch</dd>
528      *   <dt><b>Final:</b></dt><dd>No</dd>
529      * </dl></p>
530      * @param locale The locale of the message to return.
531      * @param toolName Format argument.
532      * @return The text of the {@code <Command Success Message>} message for {@code locale}.
533      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
534      */
535     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
536     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
537     private String getCommandSuccessMessage( final java.util.Locale locale, final java.lang.String toolName )
538     {
539         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Command Success Message", locale, toolName );
540         assert _m != null : "'Command Success Message' message not found.";
541         return _m;
542     }
543     /**
544      * Gets the text of the {@code <Default Log Level Info>} message.
545      * <p><dl>
546      *   <dt><b>Languages:</b></dt>
547      *     <dd>English (default)</dd>
548      *     <dd>Deutsch</dd>
549      *   <dt><b>Final:</b></dt><dd>No</dd>
550      * </dl></p>
551      * @param locale The locale of the message to return.
552      * @param defaultLogLevel Format argument.
553      * @return The text of the {@code <Default Log Level Info>} message for {@code locale}.
554      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
555      */
556     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
557     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
558     private String getDefaultLogLevelInfo( final java.util.Locale locale, final java.lang.String defaultLogLevel )
559     {
560         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Default Log Level Info", locale, defaultLogLevel );
561         assert _m != null : "'Default Log Level Info' message not found.";
562         return _m;
563     }
564     /**
565      * Gets the text of the {@code <Long Description Message>} message.
566      * <p><dl>
567      *   <dt><b>Languages:</b></dt>
568      *     <dd>English (default)</dd>
569      *   <dt><b>Final:</b></dt><dd>No</dd>
570      * </dl></p>
571      * @param locale The locale of the message to return.
572      * @return The text of the {@code <Long Description Message>} message for {@code locale}.
573      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
574      */
575     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
576     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
577     private String getLongDescriptionMessage( final java.util.Locale locale )
578     {
579         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Long Description Message", locale );
580         assert _m != null : "'Long Description Message' message not found.";
581         return _m;
582     }
583     /**
584      * Gets the text of the {@code <Separator>} message.
585      * <p><dl>
586      *   <dt><b>Languages:</b></dt>
587      *     <dd>English (default)</dd>
588      *   <dt><b>Final:</b></dt><dd>No</dd>
589      * </dl></p>
590      * @param locale The locale of the message to return.
591      * @return The text of the {@code <Separator>} message for {@code locale}.
592      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
593      */
594     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
595     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
596     private String getSeparator( final java.util.Locale locale )
597     {
598         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Separator", locale );
599         assert _m != null : "'Separator' message not found.";
600         return _m;
601     }
602     /**
603      * Gets the text of the {@code <Short Description Message>} message.
604      * <p><dl>
605      *   <dt><b>Languages:</b></dt>
606      *     <dd>English (default)</dd>
607      *   <dt><b>Final:</b></dt><dd>No</dd>
608      * </dl></p>
609      * @param locale The locale of the message to return.
610      * @return The text of the {@code <Short Description Message>} message for {@code locale}.
611      * @throws org.jomc.ObjectManagementException if getting the message instance fails.
612      */
613     @SuppressWarnings({"unchecked", "unused", "PMD.UnnecessaryFullyQualifiedName"})
614     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
615     private String getShortDescriptionMessage( final java.util.Locale locale )
616     {
617         final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Short Description Message", locale );
618         assert _m != null : "'Short Description Message' message not found.";
619         return _m;
620     }
621     // </editor-fold>
622     // SECTION-END
623     // SECTION-START[Generated Command]
624     // <editor-fold defaultstate="collapsed" desc=" Generated Options ">
625     /**
626      * Gets the options of the command.
627      * <p><strong>Options:</strong>
628      *   <table border="1" width="100%" cellpadding="3" cellspacing="0">
629      *     <tr class="TableSubHeadingColor">
630      *       <th align="left" scope="col" nowrap><b>Specification</b></th>
631      *       <th align="left" scope="col" nowrap><b>Implementation</b></th>
632      *     </tr>
633      *   </table>
634      * </p>
635      * @return The options of the command.
636      */
637     @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.9", comments = "See http://www.jomc.org/jomc/1.9/jomc-tools-1.9" )
638     public org.apache.commons.cli.Options getOptions()
639     {
640         final org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();
641         return options;
642     }
643     // </editor-fold>
644     // SECTION-END
645 
646 }