1 | /* |
2 | * jDTAUS Core API |
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.core.container; |
22 | |
23 | import java.util.Locale; |
24 | |
25 | /** |
26 | * Gets thrown for type collisions of inherited dependencies. |
27 | * |
28 | * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> |
29 | * @version $JDTAUS: IllegalDependencyTypeException.java 8743 2012-10-07 03:06:20Z schulte $ |
30 | */ |
31 | public class IllegalDependencyTypeException extends IllegalStateException |
32 | { |
33 | //--Constants--------------------------------------------------------------- |
34 | |
35 | /** Serial version UID for backwards compatibility with 1.5.x classes. */ |
36 | private static final long serialVersionUID = 1616079465342123026L; |
37 | |
38 | //---------------------------------------------------------------Constants-- |
39 | //--Constructors------------------------------------------------------------ |
40 | |
41 | /** |
42 | * Creates a new instance of {@code IllegalDependencyTypeException} taking |
43 | * information about the dependency with illegal type. |
44 | * |
45 | * @param implementationIdentifier the identifier of the implementation with |
46 | * a dependency of illegal type. |
47 | * @param name the name of the dependency with illegal type. |
48 | * @param type the illegal type of the dependency with name {@code name}. |
49 | * @param expectedType the expected type of the dependency with name |
50 | * {@code name}. |
51 | */ |
52 | public IllegalDependencyTypeException( final String implementationIdentifier, |
53 | final String name, final String type, |
54 | final String expectedType ) |
55 | { |
56 | super( IllegalDependencyTypeExceptionBundle.getInstance(). |
57 | getIllegalDependencyTypeMessage( Locale.getDefault(), |
58 | implementationIdentifier, name, |
59 | type, expectedType ) ); |
60 | |
61 | this.implementationIdentifier = implementationIdentifier; |
62 | this.name = name; |
63 | this.type = type; |
64 | this.expectedType = expectedType; |
65 | } |
66 | |
67 | //------------------------------------------------------------Constructors-- |
68 | //--IllegalDependencyTypeException------------------------------------------ |
69 | |
70 | /** |
71 | * The identifier of the implementation with a dependency of illegal type. |
72 | * @serial |
73 | */ |
74 | private final String implementationIdentifier; |
75 | |
76 | /** |
77 | * The name of the dependency with illegal type. |
78 | * @serial |
79 | */ |
80 | private final String name; |
81 | |
82 | /** |
83 | * The illegal type. |
84 | * @serial |
85 | */ |
86 | private final String type; |
87 | |
88 | /** |
89 | * The expected type. |
90 | * @serial |
91 | */ |
92 | private final String expectedType; |
93 | |
94 | /** |
95 | * Gets the identifier of the implementation with a dependency of illegal |
96 | * type. |
97 | * |
98 | * @return the identifier of the implementation with a dependency of illegal |
99 | * type. |
100 | */ |
101 | public String getImplementationIdentifier() |
102 | { |
103 | return this.implementationIdentifier; |
104 | } |
105 | |
106 | /** |
107 | * Gets the name of the dependency with illegal type. |
108 | * |
109 | * @return the name of the dependency with illegal type. |
110 | */ |
111 | public String getName() |
112 | { |
113 | return this.name; |
114 | } |
115 | |
116 | /** |
117 | * Gets the illegal type of the dependency. |
118 | * |
119 | * @return the illegal type of the dependency. |
120 | */ |
121 | public String getType() |
122 | { |
123 | return this.type; |
124 | } |
125 | |
126 | /** |
127 | * Gets the expected type of the dependency. |
128 | * |
129 | * @return the expected type of the dependency. |
130 | */ |
131 | public String getExpectedType() |
132 | { |
133 | return this.expectedType; |
134 | } |
135 | |
136 | //------------------------------------------IllegalDependencyTypeException-- |
137 | } |