View Javadoc
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.commons.proxy2.exception;
19  
20  /**
21   * {@link org.apache.commons.proxy2.ObjectProvider} implementations should throw this exception type to indicate that
22   * there was a problem creating/finding the object.
23   * 
24   * @since 1.0
25   */
26  public class ObjectProviderException extends RuntimeException
27  {
28      /** Serialization version */
29      private static final long serialVersionUID = -1L;
30  
31      //******************************************************************************************************************
32      // Constructors
33      //******************************************************************************************************************
34  
35      /**
36       * Create a new ObjectProviderException instance.
37       */
38      public ObjectProviderException()
39      {
40      }
41  
42      /**
43       * Create a new ObjectProviderException instance.
44       * 
45       * @param message
46       */
47      public ObjectProviderException(String message)
48      {
49          super(message);
50      }
51  
52      /**
53       * Create a new ObjectProviderException instance using {@link String#format(String, Object...)} for the message.
54       * 
55       * @param message
56       * @param arguments
57       */
58      public ObjectProviderException(String message, Object... arguments)
59      {
60          super(String.format(message, arguments));
61      }
62  
63      /**
64       * Create a new ObjectProviderException instance.
65       * 
66       * @param cause
67       */
68      public ObjectProviderException(Throwable cause)
69      {
70          super(cause);
71      }
72  
73      /**
74       * Create a new ObjectProviderException instance.
75       * 
76       * @param message
77       * @param cause
78       */
79      public ObjectProviderException(String message, Throwable cause)
80      {
81          super(message, cause);
82      }
83  
84      /**
85       * Create a new ObjectProviderException instance using {@link String#format(String, Object...)} for the message.
86       * 
87       * @param cause
88       * @param message
89       * @param arguments
90       */
91      public ObjectProviderException(Throwable cause, String message, Object... arguments)
92      {
93          super(String.format(message, arguments), cause);
94      }
95  }