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, 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 4917 2014-02-25 15:21:56Z 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.6.2 |
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.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
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 | /** The listeners of the instance. */ |
76 | private List<Listener> listeners; |
77 | |
78 | /** Log level of the instance. */ |
79 | private Level logLevel; |
80 | |
81 | /** |
82 | * Gets the list of registered listeners. |
83 | * <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make |
84 | * to the returned list will be present inside the object. This is why there is no {@code set} method for the |
85 | * listeners property.</p> |
86 | * |
87 | * @return The list of registered listeners. |
88 | * |
89 | * @see #log(java.util.logging.Level, java.lang.String, java.lang.Throwable) |
90 | */ |
91 | public final List<Listener> getListeners() |
92 | { |
93 | if ( this.listeners == null ) |
94 | { |
95 | this.listeners = new LinkedList<Listener>(); |
96 | } |
97 | |
98 | return this.listeners; |
99 | } |
100 | |
101 | /** |
102 | * Gets the log level of the instance. |
103 | * |
104 | * @return The log level of the instance. |
105 | * |
106 | * @see #getDefaultLogLevel() |
107 | * @see #setLogLevel(java.util.logging.Level) |
108 | * @see #isLoggable(java.util.logging.Level) |
109 | */ |
110 | public final Level getLogLevel() |
111 | { |
112 | if ( this.logLevel == null ) |
113 | { |
114 | this.logLevel = getDefaultLogLevel(); |
115 | |
116 | if ( this.isLoggable( Level.CONFIG ) ) |
117 | { |
118 | this.log( Level.CONFIG, |
119 | this.getDefaultLogLevelInfo( this.getLocale(), this.logLevel.getLocalizedName() ), null ); |
120 | |
121 | } |
122 | } |
123 | |
124 | return this.logLevel; |
125 | } |
126 | |
127 | /** |
128 | * Sets the log level of the instance. |
129 | * |
130 | * @param value The new log level of the instance or {@code null}. |
131 | * |
132 | * @see #getLogLevel() |
133 | * @see #isLoggable(java.util.logging.Level) |
134 | */ |
135 | public final void setLogLevel( final Level value ) |
136 | { |
137 | this.logLevel = value; |
138 | } |
139 | |
140 | public final String getName() |
141 | { |
142 | return this.getCommandName(); |
143 | } |
144 | |
145 | public final String getAbbreviatedName() |
146 | { |
147 | return this.getAbbreviatedCommandName(); |
148 | } |
149 | |
150 | public final String getShortDescription( final Locale locale ) |
151 | { |
152 | return this.getShortDescriptionMessage( locale ); |
153 | } |
154 | |
155 | public final String getLongDescription( final Locale locale ) |
156 | { |
157 | return this.getLongDescriptionMessage( locale ); |
158 | } |
159 | |
160 | public final int execute( final CommandLine commandLine ) |
161 | { |
162 | if ( commandLine == null ) |
163 | { |
164 | throw new NullPointerException( "commandLine" ); |
165 | } |
166 | |
167 | int status; |
168 | |
169 | try |
170 | { |
171 | if ( this.isLoggable( Level.INFO ) ) |
172 | { |
173 | this.log( Level.INFO, this.getSeparator( this.getLocale() ), null ); |
174 | this.log( Level.INFO, this.getApplicationTitle( this.getLocale() ), null ); |
175 | this.log( Level.INFO, this.getSeparator( this.getLocale() ), null ); |
176 | this.log( Level.INFO, this.getCommandInfoMessage( this.getLocale(), this.getCommandName() ), null ); |
177 | } |
178 | |
179 | this.preExecuteCommand( commandLine ); |
180 | this.executeCommand( commandLine ); |
181 | status = STATUS_SUCCESS; |
182 | } |
183 | catch ( final Throwable t ) |
184 | { |
185 | this.log( Level.SEVERE, null, t ); |
186 | status = STATUS_FAILURE; |
187 | } |
188 | finally |
189 | { |
190 | try |
191 | { |
192 | this.postExecuteCommand( commandLine ); |
193 | } |
194 | catch ( final Throwable t ) |
195 | { |
196 | this.log( Level.SEVERE, null, t ); |
197 | status = STATUS_FAILURE; |
198 | } |
199 | } |
200 | |
201 | if ( this.isLoggable( Level.INFO ) ) |
202 | { |
203 | if ( status == STATUS_SUCCESS ) |
204 | { |
205 | this.log( Level.INFO, this.getCommandSuccessMessage( this.getLocale(), this.getCommandName() ), null ); |
206 | } |
207 | else if ( status == STATUS_FAILURE ) |
208 | { |
209 | this.log( Level.INFO, this.getCommandFailureMessage( this.getLocale(), this.getCommandName() ), null ); |
210 | } |
211 | |
212 | this.log( Level.INFO, this.getSeparator( this.getLocale() ), null ); |
213 | } |
214 | |
215 | return status; |
216 | } |
217 | |
218 | // SECTION-END |
219 | // SECTION-START[AbstractCommand] |
220 | /** Default log level. */ |
221 | private static volatile Level defaultLogLevel; |
222 | |
223 | /** |
224 | * Gets the default log level events are logged at. |
225 | * <p>The default log level is controlled by system property |
226 | * {@code org.jomc.cli.commands.AbstractCommand.defaultLogLevel} holding the log level to log events at by |
227 | * default. If that property is not set, the {@code WARNING} default is returned.</p> |
228 | * |
229 | * @return The log level events are logged at by default. |
230 | * |
231 | * @see #getLogLevel() |
232 | * @see Level#parse(java.lang.String) |
233 | */ |
234 | public static Level getDefaultLogLevel() |
235 | { |
236 | if ( defaultLogLevel == null ) |
237 | { |
238 | defaultLogLevel = Level.parse( |
239 | System.getProperty( "org.jomc.cli.command.AbstractJomcCommand.defaultLogLevel", |
240 | System.getProperty( "org.jomc.cli.commands.AbstractCommand.defaultLogLevel", |
241 | Level.WARNING.getName() ) ) ); |
242 | |
243 | } |
244 | |
245 | return defaultLogLevel; |
246 | } |
247 | |
248 | /** |
249 | * Sets the default log level events are logged at. |
250 | * |
251 | * @param value The new default level events are logged at or {@code null}. |
252 | * |
253 | * @see #getDefaultLogLevel() |
254 | */ |
255 | public static void setDefaultLogLevel( final Level value ) |
256 | { |
257 | defaultLogLevel = value; |
258 | } |
259 | |
260 | /** |
261 | * Checks if a message at a given level is provided to the listeners of the instance. |
262 | * |
263 | * @param level The level to test. |
264 | * |
265 | * @return {@code true}, if messages at {@code level} are provided to the listeners of the instance; |
266 | * {@code false}, if messages at {@code level} are not provided to the listeners of the instance. |
267 | * |
268 | * @throws NullPointerException if {@code level} is {@code null}. |
269 | * |
270 | * @see #getLogLevel() |
271 | * @see #setLogLevel(java.util.logging.Level) |
272 | */ |
273 | protected boolean isLoggable( final Level level ) |
274 | { |
275 | if ( level == null ) |
276 | { |
277 | throw new NullPointerException( "level" ); |
278 | } |
279 | |
280 | return level.intValue() >= this.getLogLevel().intValue(); |
281 | } |
282 | |
283 | /** |
284 | * Notifies registered listeners. |
285 | * |
286 | * @param level The level of the event. |
287 | * @param message The message of the event or {@code null}. |
288 | * @param throwable The throwable of the event {@code null}. |
289 | * |
290 | * @throws NullPointerException if {@code level} is {@code null}. |
291 | * |
292 | * @see #getListeners() |
293 | * @see #isLoggable(java.util.logging.Level) |
294 | */ |
295 | protected void log( final Level level, final String message, final Throwable throwable ) |
296 | { |
297 | if ( level == null ) |
298 | { |
299 | throw new NullPointerException( "level" ); |
300 | } |
301 | |
302 | if ( this.isLoggable( level ) ) |
303 | { |
304 | for ( Listener l : this.getListeners() ) |
305 | { |
306 | l.onLog( level, message, throwable ); |
307 | } |
308 | } |
309 | } |
310 | |
311 | /** |
312 | * Called by the {@code execute} method prior to the {@code executeCommand} method. |
313 | * |
314 | * @param commandLine The command line to execute. |
315 | * |
316 | * @throws NullPointerException if {@code commandLine} is {@code null}. |
317 | * @throws CommandExecutionException if executing the command fails. |
318 | * |
319 | * @see #execute(org.apache.commons.cli.CommandLine) |
320 | */ |
321 | protected void preExecuteCommand( final CommandLine commandLine ) throws CommandExecutionException |
322 | { |
323 | if ( commandLine == null ) |
324 | { |
325 | throw new NullPointerException( "commandLine" ); |
326 | } |
327 | } |
328 | |
329 | /** |
330 | * Called by the {@code execute} method prior to the {@code postExecuteCommand} method. |
331 | * |
332 | * @param commandLine The command line to execute. |
333 | * |
334 | * @throws CommandExecutionException if executing the command fails. |
335 | * |
336 | * @see #execute(org.apache.commons.cli.CommandLine) |
337 | */ |
338 | protected abstract void executeCommand( final CommandLine commandLine ) throws CommandExecutionException; |
339 | |
340 | /** |
341 | * Called by the {@code execute} method after the {@code preExecuteCommand}/{@code executeCommand} methods even if |
342 | * those methods threw an exception. |
343 | * |
344 | * @param commandLine The command line to execute. |
345 | * |
346 | * @throws NullPointerException if {@code commandLine} is {@code null}. |
347 | * @throws CommandExecutionException if executing the command fails. |
348 | * |
349 | * @see #execute(org.apache.commons.cli.CommandLine) |
350 | */ |
351 | protected void postExecuteCommand( final CommandLine commandLine ) throws CommandExecutionException |
352 | { |
353 | if ( commandLine == null ) |
354 | { |
355 | throw new NullPointerException( "commandLine" ); |
356 | } |
357 | } |
358 | |
359 | /** |
360 | * Gets a message of a given {@code Throwable} recursively. |
361 | * |
362 | * @param t The {@code Throwable} to get the message of or {@code null}. |
363 | * |
364 | * @return The message associated with {@code t} or {@code null}. |
365 | */ |
366 | protected static String getExceptionMessage( final Throwable t ) |
367 | { |
368 | return t != null |
369 | ? t.getMessage() != null && t.getMessage().trim().length() > 0 |
370 | ? t.getMessage() |
371 | : getExceptionMessage( t.getCause() ) |
372 | : null; |
373 | |
374 | } |
375 | |
376 | // SECTION-END |
377 | // SECTION-START[Constructors] |
378 | // <editor-fold defaultstate="collapsed" desc=" Generated Constructors "> |
379 | /** Creates a new {@code AbstractCommand} instance. */ |
380 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
381 | public AbstractCommand() |
382 | { |
383 | // SECTION-START[Default Constructor] |
384 | super(); |
385 | // SECTION-END |
386 | } |
387 | // </editor-fold> |
388 | // SECTION-END |
389 | // SECTION-START[Dependencies] |
390 | // <editor-fold defaultstate="collapsed" desc=" Generated Dependencies "> |
391 | /** |
392 | * Gets the {@code <Locale>} dependency. |
393 | * <p> |
394 | * This method returns the {@code <default>} object of the {@code <java.util.Locale>} specification at specification level 1.1. |
395 | * That specification does not apply to any scope. A new object is returned whenever requested and bound to this instance. |
396 | * </p> |
397 | * <dl> |
398 | * <dt><b>Final:</b></dt><dd>No</dd> |
399 | * </dl> |
400 | * @return The {@code <Locale>} dependency. |
401 | * @throws org.jomc.ObjectManagementException if getting the dependency instance fails. |
402 | */ |
403 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
404 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
405 | private java.util.Locale getLocale() |
406 | { |
407 | final java.util.Locale _d = (java.util.Locale) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getDependency( this, "Locale" ); |
408 | assert _d != null : "'Locale' dependency not found."; |
409 | return _d; |
410 | } |
411 | // </editor-fold> |
412 | // SECTION-END |
413 | // SECTION-START[Properties] |
414 | // <editor-fold defaultstate="collapsed" desc=" Generated Properties "> |
415 | /** |
416 | * Gets the value of the {@code <Abbreviated Command Name>} property. |
417 | * <p><dl> |
418 | * <dt><b>Final:</b></dt><dd>No</dd> |
419 | * </dl></p> |
420 | * @return Abbreviated name of the command. |
421 | * @throws org.jomc.ObjectManagementException if getting the property instance fails. |
422 | */ |
423 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
424 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
425 | private java.lang.String getAbbreviatedCommandName() |
426 | { |
427 | final java.lang.String _p = (java.lang.String) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getProperty( this, "Abbreviated Command Name" ); |
428 | assert _p != null : "'Abbreviated Command Name' property not found."; |
429 | return _p; |
430 | } |
431 | /** |
432 | * Gets the value of the {@code <Command Name>} property. |
433 | * <p><dl> |
434 | * <dt><b>Final:</b></dt><dd>No</dd> |
435 | * </dl></p> |
436 | * @return Name of the command. |
437 | * @throws org.jomc.ObjectManagementException if getting the property instance fails. |
438 | */ |
439 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
440 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
441 | private java.lang.String getCommandName() |
442 | { |
443 | final java.lang.String _p = (java.lang.String) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getProperty( this, "Command Name" ); |
444 | assert _p != null : "'Command Name' property not found."; |
445 | return _p; |
446 | } |
447 | // </editor-fold> |
448 | // SECTION-END |
449 | // SECTION-START[Messages] |
450 | // <editor-fold defaultstate="collapsed" desc=" Generated Messages "> |
451 | /** |
452 | * Gets the text of the {@code <Application Title>} message. |
453 | * <p><dl> |
454 | * <dt><b>Languages:</b></dt> |
455 | * <dd>English (default)</dd> |
456 | * <dt><b>Final:</b></dt><dd>No</dd> |
457 | * </dl></p> |
458 | * @param locale The locale of the message to return. |
459 | * @return The text of the {@code <Application Title>} message for {@code locale}. |
460 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
461 | */ |
462 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
463 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
464 | private String getApplicationTitle( final java.util.Locale locale ) |
465 | { |
466 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Application Title", locale ); |
467 | assert _m != null : "'Application Title' message not found."; |
468 | return _m; |
469 | } |
470 | /** |
471 | * Gets the text of the {@code <Command Failure Message>} message. |
472 | * <p><dl> |
473 | * <dt><b>Languages:</b></dt> |
474 | * <dd>English (default)</dd> |
475 | * <dd>Deutsch</dd> |
476 | * <dt><b>Final:</b></dt><dd>No</dd> |
477 | * </dl></p> |
478 | * @param locale The locale of the message to return. |
479 | * @param toolName Format argument. |
480 | * @return The text of the {@code <Command Failure Message>} message for {@code locale}. |
481 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
482 | */ |
483 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
484 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
485 | private String getCommandFailureMessage( final java.util.Locale locale, final java.lang.String toolName ) |
486 | { |
487 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Command Failure Message", locale, toolName ); |
488 | assert _m != null : "'Command Failure Message' message not found."; |
489 | return _m; |
490 | } |
491 | /** |
492 | * Gets the text of the {@code <Command Info Message>} message. |
493 | * <p><dl> |
494 | * <dt><b>Languages:</b></dt> |
495 | * <dd>English (default)</dd> |
496 | * <dd>Deutsch</dd> |
497 | * <dt><b>Final:</b></dt><dd>No</dd> |
498 | * </dl></p> |
499 | * @param locale The locale of the message to return. |
500 | * @param toolName Format argument. |
501 | * @return The text of the {@code <Command Info Message>} message for {@code locale}. |
502 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
503 | */ |
504 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
505 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
506 | private String getCommandInfoMessage( final java.util.Locale locale, final java.lang.String toolName ) |
507 | { |
508 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Command Info Message", locale, toolName ); |
509 | assert _m != null : "'Command Info Message' message not found."; |
510 | return _m; |
511 | } |
512 | /** |
513 | * Gets the text of the {@code <Command Success Message>} message. |
514 | * <p><dl> |
515 | * <dt><b>Languages:</b></dt> |
516 | * <dd>English (default)</dd> |
517 | * <dd>Deutsch</dd> |
518 | * <dt><b>Final:</b></dt><dd>No</dd> |
519 | * </dl></p> |
520 | * @param locale The locale of the message to return. |
521 | * @param toolName Format argument. |
522 | * @return The text of the {@code <Command Success Message>} message for {@code locale}. |
523 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
524 | */ |
525 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
526 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
527 | private String getCommandSuccessMessage( final java.util.Locale locale, final java.lang.String toolName ) |
528 | { |
529 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Command Success Message", locale, toolName ); |
530 | assert _m != null : "'Command Success Message' message not found."; |
531 | return _m; |
532 | } |
533 | /** |
534 | * Gets the text of the {@code <Default Log Level Info>} message. |
535 | * <p><dl> |
536 | * <dt><b>Languages:</b></dt> |
537 | * <dd>English (default)</dd> |
538 | * <dd>Deutsch</dd> |
539 | * <dt><b>Final:</b></dt><dd>No</dd> |
540 | * </dl></p> |
541 | * @param locale The locale of the message to return. |
542 | * @param defaultLogLevel Format argument. |
543 | * @return The text of the {@code <Default Log Level Info>} message for {@code locale}. |
544 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
545 | */ |
546 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
547 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
548 | private String getDefaultLogLevelInfo( final java.util.Locale locale, final java.lang.String defaultLogLevel ) |
549 | { |
550 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Default Log Level Info", locale, defaultLogLevel ); |
551 | assert _m != null : "'Default Log Level Info' message not found."; |
552 | return _m; |
553 | } |
554 | /** |
555 | * Gets the text of the {@code <Long Description Message>} message. |
556 | * <p><dl> |
557 | * <dt><b>Languages:</b></dt> |
558 | * <dd>English (default)</dd> |
559 | * <dt><b>Final:</b></dt><dd>No</dd> |
560 | * </dl></p> |
561 | * @param locale The locale of the message to return. |
562 | * @return The text of the {@code <Long Description Message>} message for {@code locale}. |
563 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
564 | */ |
565 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
566 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
567 | private String getLongDescriptionMessage( final java.util.Locale locale ) |
568 | { |
569 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Long Description Message", locale ); |
570 | assert _m != null : "'Long Description Message' message not found."; |
571 | return _m; |
572 | } |
573 | /** |
574 | * Gets the text of the {@code <Separator>} message. |
575 | * <p><dl> |
576 | * <dt><b>Languages:</b></dt> |
577 | * <dd>English (default)</dd> |
578 | * <dt><b>Final:</b></dt><dd>No</dd> |
579 | * </dl></p> |
580 | * @param locale The locale of the message to return. |
581 | * @return The text of the {@code <Separator>} message for {@code locale}. |
582 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
583 | */ |
584 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
585 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
586 | private String getSeparator( final java.util.Locale locale ) |
587 | { |
588 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Separator", locale ); |
589 | assert _m != null : "'Separator' message not found."; |
590 | return _m; |
591 | } |
592 | /** |
593 | * Gets the text of the {@code <Short Description Message>} message. |
594 | * <p><dl> |
595 | * <dt><b>Languages:</b></dt> |
596 | * <dd>English (default)</dd> |
597 | * <dt><b>Final:</b></dt><dd>No</dd> |
598 | * </dl></p> |
599 | * @param locale The locale of the message to return. |
600 | * @return The text of the {@code <Short Description Message>} message for {@code locale}. |
601 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
602 | */ |
603 | @SuppressWarnings({"unused", "PMD.UnnecessaryFullyQualifiedName"}) |
604 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
605 | private String getShortDescriptionMessage( final java.util.Locale locale ) |
606 | { |
607 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "Short Description Message", locale ); |
608 | assert _m != null : "'Short Description Message' message not found."; |
609 | return _m; |
610 | } |
611 | // </editor-fold> |
612 | // SECTION-END |
613 | // SECTION-START[Generated Command] |
614 | // <editor-fold defaultstate="collapsed" desc=" Generated Options "> |
615 | /** |
616 | * Gets the options of the command. |
617 | * <p><strong>Options:</strong> |
618 | * <table border="1" width="100%" cellpadding="3" cellspacing="0"> |
619 | * <tr class="TableSubHeadingColor"> |
620 | * <th align="left" scope="col" nowrap><b>Specification</b></th> |
621 | * <th align="left" scope="col" nowrap><b>Implementation</b></th> |
622 | * </tr> |
623 | * </table> |
624 | * </p> |
625 | * @return The options of the command. |
626 | */ |
627 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.6.2", comments = "See http://www.jomc.org/jomc/1.6/jomc-tools-1.6.2" ) |
628 | public org.apache.commons.cli.Options getOptions() |
629 | { |
630 | final org.apache.commons.cli.Options options = new org.apache.commons.cli.Options(); |
631 | return options; |
632 | } |
633 | // </editor-fold> |
634 | // SECTION-END |
635 | } |