01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: package org.apache.cocoon.util.location;
18:
19: /**
20: * Extension of {@link Locatable} for exceptions.
21: * <p>
22: * In order to dump location information in the stacktrace, the <code>getMessage()</code> method of
23: * a {@link Locatable} exception should return a concatenation of the raw message (given in the
24: * constructor) and the exception's location, e.g. "<code>foo failed (file.xml:12:3)</code>". However,
25: * {@link Locatable}-aware classes will want to handle the raw message (i.e. "<code>foo failed</code>")
26: * and location separately. This interface gives access to the raw message.
27: * <p>
28: * <strong>Note:</strong> care should be taken for locatable exceptions to use only immutable and
29: * serializable implementations of {@link Location}
30: * @see org.apache.cocoon.util.location.LocationImpl#get(Location)
31: *
32: * @since 2.1.8
33: * @version $Id: LocatableException.java 446917 2006-09-16 19:10:40Z vgritsenko $
34: */
35: public interface LocatableException extends Locatable {
36:
37: /**
38: * Get the raw message of the exception (the one used in the constructor)
39: *
40: * @return the raw message
41: */
42: public String getRawMessage();
43: }
|