1 | /* |
2 | * jDTAUS Banking Messages |
3 | * Copyright (C) 2005 Christian Schulte |
4 | * <cs@schulte.it> |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Lesser General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2.1 of the License, or any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Lesser General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this library; if not, write to the Free Software |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
19 | * |
20 | */ |
21 | package org.jdtaus.banking.messages; |
22 | |
23 | import java.util.Date; |
24 | import java.util.Locale; |
25 | import org.jdtaus.core.container.ContainerFactory; |
26 | import org.jdtaus.core.text.Message; |
27 | |
28 | /** |
29 | * Message stating that the {@code BundesbankBankleitzahlenVerzeichnis} is |
30 | * outdated. |
31 | * |
32 | * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> |
33 | * @version $JDTAUS: OutdatedBankleitzahlenVerzeichnisMessage.java 8865 2014-01-10 17:13:42Z schulte $ |
34 | */ |
35 | public final class OutdatedBankleitzahlenVerzeichnisMessage extends Message |
36 | { |
37 | |
38 | /** Serial version UID for backwards compatibility with 1.0.x classes. */ |
39 | private static final long serialVersionUID = -196759846361567335L; |
40 | |
41 | /** |
42 | * Date of expiration of the directory. |
43 | * @serial |
44 | */ |
45 | private final Date dateOfExpiration; |
46 | |
47 | /** |
48 | * Creates a new {@code OutdatedDirectoryMessage} instance taking the date of expiration. |
49 | * |
50 | * @param dateOfExpiration the date of expiration of the directory. |
51 | * |
52 | * @throws NullPointerException if {@code dateOfExpiration} is {@code null}. |
53 | */ |
54 | public OutdatedBankleitzahlenVerzeichnisMessage( final Date dateOfExpiration ) |
55 | { |
56 | if ( dateOfExpiration == null ) |
57 | { |
58 | throw new NullPointerException( "dateOfExpiration" ); |
59 | } |
60 | |
61 | this.dateOfExpiration = (Date) dateOfExpiration.clone(); |
62 | } |
63 | |
64 | /** |
65 | * {@inheritDoc} |
66 | * |
67 | * @return The date of expiration of the {@code BankleitzahlenVerzeichnis}. |
68 | * <ul> |
69 | * <li>[0]: the date of expiration of the directory.</li> |
70 | * </ul> |
71 | */ |
72 | public Object[] getFormatArguments( final Locale locale ) |
73 | { |
74 | return new Object[] |
75 | { |
76 | this.dateOfExpiration |
77 | }; |
78 | } |
79 | |
80 | /** |
81 | * {@inheritDoc} |
82 | * |
83 | * @return The corresponding text from the message's {@code ResourceBundle} |
84 | * <blockquote><pre> |
85 | * The directory of bankcodes expired at {0,date,long}. |
86 | * </pre></blockquote> |
87 | */ |
88 | public String getText( final Locale locale ) |
89 | { |
90 | return this.getOutdatedDirectoryMessage( locale, this.dateOfExpiration ); |
91 | } |
92 | |
93 | //--Messages---------------------------------------------------------------- |
94 | |
95 | // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:jdtausMessages |
96 | // This section is managed by jdtaus-container-mojo. |
97 | |
98 | /** |
99 | * Gets the text of message <code>outdatedDirectory</code>. |
100 | * <blockquote><pre>Das Bankleitzahlenverzeichnis ist am {0,date,long} abgelaufen.</pre></blockquote> |
101 | * <blockquote><pre>The directory of bankcodes expired at {0,date,long}.</pre></blockquote> |
102 | * |
103 | * @param locale The locale of the message instance to return. |
104 | * @param expirationDate format parameter. |
105 | * |
106 | * @return the text of message <code>outdatedDirectory</code>. |
107 | */ |
108 | private String getOutdatedDirectoryMessage( final Locale locale, |
109 | final java.util.Date expirationDate ) |
110 | { |
111 | return ContainerFactory.getContainer(). |
112 | getMessage( this, "outdatedDirectory", locale, |
113 | new Object[] |
114 | { |
115 | expirationDate |
116 | }); |
117 | |
118 | } |
119 | |
120 | // </editor-fold>//GEN-END:jdtausMessages |
121 | |
122 | //----------------------------------------------------------------Messages-- |
123 | } |