| 1 | // SECTION-START[License Header] |
| 2 | // <editor-fold defaultstate="collapsed" desc=" Generated License "> |
| 3 | /* |
| 4 | * Copyright (c) 2010 The JOMC Project |
| 5 | * Copyright (c) 2005 Christian Schulte <schulte2005@users.sourceforge.net> |
| 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 BY THE JOMC PROJECT AND CONTRIBUTORS "AS IS" |
| 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JOMC PROJECT OR |
| 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 30 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | * |
| 32 | * $Id: ConcurrentModificationException.java 2244 2010-06-29 07:58:09Z schulte2005 $ |
| 33 | * |
| 34 | */ |
| 35 | // </editor-fold> |
| 36 | // SECTION-END |
| 37 | package org.jomc.sequences; |
| 38 | |
| 39 | // SECTION-START[Documentation] |
| 40 | // <editor-fold defaultstate="collapsed" desc=" Generated Documentation "> |
| 41 | /** |
| 42 | * Gets thrown whenever a sequence is edited or removed using outdated data. |
| 43 | * <p><b>Dependencies</b><ul> |
| 44 | * <li>"{@link #getLocale Locale}"<blockquote> |
| 45 | * Dependency on {@code 'java.util.Locale'} {@code (java.util.Locale)} at specification level 1.1 bound to an instance.</blockquote></li> |
| 46 | * </ul></p> |
| 47 | * <p><b>Messages</b><ul> |
| 48 | * <li>"{@link #getConcurrentlyModifiedMessage concurrentlyModifiedMessage}"<table> |
| 49 | * <tr><td valign="top">English:</td><td valign="top"><pre>The sequence got concurrently modified.</pre></td></tr> |
| 50 | * <tr><td valign="top">Deutsch:</td><td valign="top"><pre>Die Sequenz wurde zwischenzeitlich geändert.</pre></td></tr> |
| 51 | * </table> |
| 52 | * </ul></p> |
| 53 | * |
| 54 | * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a> 1.0 |
| 55 | * @version $Id: ConcurrentModificationException.java 2244 2010-06-29 07:58:09Z schulte2005 $ |
| 56 | */ |
| 57 | // </editor-fold> |
| 58 | // SECTION-END |
| 59 | // SECTION-START[Annotations] |
| 60 | // <editor-fold defaultstate="collapsed" desc=" Generated Annotations "> |
| 61 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.0", comments = "See http://jomc.sourceforge.net/jomc/1.0/jomc-tools" ) |
| 62 | // </editor-fold> |
| 63 | // SECTION-END |
| 64 | public class ConcurrentModificationException extends SequencesException |
| 65 | { |
| 66 | // SECTION-START[ConcurrentModificationException] |
| 67 | |
| 68 | /** Serial version UID for backwards compatibility with 1.0.x classes. */ |
| 69 | private static final long serialVersionUID = -3756736032000979967L; |
| 70 | |
| 71 | /** |
| 72 | * Most recent revision of the correspondent reported. |
| 73 | * @serial |
| 74 | */ |
| 75 | private final Sequence mostRecentRevision; |
| 76 | |
| 77 | /** |
| 78 | * Creates a new {@code ConcurrentModificationException} instance taking the most recent revision of the sequence to |
| 79 | * report. |
| 80 | * |
| 81 | * @param sequence The most recent revision of the sequence to report. |
| 82 | */ |
| 83 | public ConcurrentModificationException( final Sequence sequence ) |
| 84 | { |
| 85 | super(); |
| 86 | this.mostRecentRevision = sequence; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Gets the most recent revision of the sequence. |
| 91 | * |
| 92 | * @return The most recent revision of the sequence. |
| 93 | */ |
| 94 | public Sequence getMostRecentRevision() |
| 95 | { |
| 96 | return this.mostRecentRevision; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Gets the message of the exception. |
| 101 | * |
| 102 | * @return The message of the exception. |
| 103 | */ |
| 104 | @Override |
| 105 | public String getMessage() |
| 106 | { |
| 107 | return this.getConcurrentlyModifiedMessage( this.getLocale() ); |
| 108 | } |
| 109 | |
| 110 | // SECTION-END |
| 111 | // SECTION-START[Dependencies] |
| 112 | // <editor-fold defaultstate="collapsed" desc=" Generated Dependencies "> |
| 113 | |
| 114 | /** |
| 115 | * Gets the {@code Locale} dependency. |
| 116 | * <p>This method returns the {@code 'default'} object of the {@code 'java.util.Locale'} {@code (java.util.Locale)} specification at specification level 1.1.</p> |
| 117 | * <p>That specification does not apply to any scope. A new object is returned whenever requested and bound to this instance.</p> |
| 118 | * @return The {@code Locale} dependency. |
| 119 | * @throws org.jomc.ObjectManagementException if getting the dependency instance fails. |
| 120 | */ |
| 121 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.0", comments = "See http://jomc.sourceforge.net/jomc/1.0/jomc-tools" ) |
| 122 | private java.util.Locale getLocale() |
| 123 | { |
| 124 | final java.util.Locale _d = (java.util.Locale) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getDependency( this, "Locale" ); |
| 125 | assert _d != null : "'Locale' dependency not found."; |
| 126 | return _d; |
| 127 | } |
| 128 | // </editor-fold> |
| 129 | // SECTION-END |
| 130 | // SECTION-START[Properties] |
| 131 | // SECTION-END |
| 132 | // SECTION-START[Messages] |
| 133 | // <editor-fold defaultstate="collapsed" desc=" Generated Messages "> |
| 134 | |
| 135 | /** |
| 136 | * Gets the text of the {@code concurrentlyModifiedMessage} message. |
| 137 | * <p><b>Templates</b><br/><table> |
| 138 | * <tr><td valign="top">English:</td><td valign="top"><pre>The sequence got concurrently modified.</pre></td></tr> |
| 139 | * <tr><td valign="top">Deutsch:</td><td valign="top"><pre>Die Sequenz wurde zwischenzeitlich geändert.</pre></td></tr> |
| 140 | * </table></p> |
| 141 | * @param locale The locale of the message to return. |
| 142 | * @return The text of the {@code concurrentlyModifiedMessage} message. |
| 143 | * |
| 144 | * @throws org.jomc.ObjectManagementException if getting the message instance fails. |
| 145 | */ |
| 146 | @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.0", comments = "See http://jomc.sourceforge.net/jomc/1.0/jomc-tools" ) |
| 147 | private String getConcurrentlyModifiedMessage( final java.util.Locale locale ) |
| 148 | { |
| 149 | final String _m = org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getMessage( this, "concurrentlyModifiedMessage", locale ); |
| 150 | assert _m != null : "'concurrentlyModifiedMessage' message not found."; |
| 151 | return _m; |
| 152 | } |
| 153 | // </editor-fold> |
| 154 | // SECTION-END |
| 155 | } |