KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > UnsupportedElementException


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */

18 package org.apache.tools.ant;
19
20 /**
21  * Used to report attempts to set an unsupported element
22  * When the attempt to set the element is made,
23  * the code does not not know the name of the task/type
24  * based on a mapping from the classname to the task/type.
25  * However one class may be used by a lot of task/types.
26  * This exception may be caught by code that does know
27  * the task/type and it will reset the message to the
28  * correct message.
29  * This will be done once (in the case of a recursive
30  * call to handlechildren).
31  *
32  * @since Ant 1.6.3
33  */

34 public class UnsupportedElementException extends BuildException {
35
36     private String JavaDoc element;
37
38     /**
39      * Constructs an unsupported element exception.
40      * @param msg The string containing the message.
41      * @param element The name of the incorrect element.
42      */

43     public UnsupportedElementException(String JavaDoc msg, String JavaDoc element) {
44         super(msg);
45         this.element = element;
46     }
47
48     /**
49      * Get the element that is wrong.
50      *
51      * @return the element name.
52      */

53     public String JavaDoc getElement() {
54         return element;
55     }
56 }
57
Popular Tags