KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > service > cmr > repository > NoTransformerException


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.service.cmr.repository;
18
19 import java.text.MessageFormat JavaDoc;
20
21 import org.alfresco.error.AlfrescoRuntimeException;
22
23 /**
24  * Thrown when a transformation request cannot be honoured due to
25  * no transformers being present for the requested transformation.
26  *
27  * @author Derek Hulley
28  */

29 public class NoTransformerException extends AlfrescoRuntimeException
30 {
31     private static final long serialVersionUID = 3689067335554183222L;
32
33     private static final MessageFormat JavaDoc MSG =
34         new MessageFormat JavaDoc("No transformation exists between mimetypes {0} and {1}");
35
36     private String JavaDoc sourceMimetype;
37     private String JavaDoc targetMimetype;
38     
39     /**
40      * @param sourceMimetype the attempted source mimetype
41      * @param targetMimetype the attempted target mimetype
42      */

43     public NoTransformerException(String JavaDoc sourceMimetype, String JavaDoc targetMimetype)
44     {
45         super(MSG.format(new Object JavaDoc[] {sourceMimetype, targetMimetype}));
46         this.sourceMimetype = sourceMimetype;
47         this.targetMimetype = targetMimetype;
48     }
49
50     public String JavaDoc getSourceMimetype()
51     {
52         return sourceMimetype;
53     }
54     
55     public String JavaDoc getTargetMimetype()
56     {
57         return targetMimetype;
58     }
59 }
60
Popular Tags