1 | /*
|
---|
2 | * Copyright 2004-2005 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 | package org.apache.tools.ant;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Used to report attempts to set an unsupported element
|
---|
21 | * When the attempt to set the element is made,
|
---|
22 | * the code does not not know the name of the task/type
|
---|
23 | * based on a mapping from the classname to the task/type.
|
---|
24 | * However one class may be used by a lot of task/types.
|
---|
25 | * This exception may be caught by code that does know
|
---|
26 | * the task/type and it will reset the message to the
|
---|
27 | * correct message.
|
---|
28 | * This will be done once (in the case of a recursive
|
---|
29 | * call to handlechildren).
|
---|
30 | *
|
---|
31 | * @since Ant 1.6.3
|
---|
32 | */
|
---|
33 | public class UnsupportedElementException extends BuildException {
|
---|
34 |
|
---|
35 | private String element;
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * Constructs an unsupported element exception.
|
---|
39 | * @param msg The string containing the message.
|
---|
40 | * @param element The name of the incorrect element.
|
---|
41 | */
|
---|
42 | public UnsupportedElementException(String msg, String element) {
|
---|
43 | super(msg);
|
---|
44 | this.element = element;
|
---|
45 | }
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Get the element that is wrong.
|
---|
49 | *
|
---|
50 | * @return the element name.
|
---|
51 | */
|
---|
52 | public String getElement() {
|
---|
53 | return element;
|
---|
54 | }
|
---|
55 | }
|
---|