InjectionPoint.java
01 /*
02  * Copyright 2008-2017 the original author or authors.
03  *
04  * Licensed under the Apache License, Version 2.0 (the "License");
05  * you may not use this file except in compliance with the License.
06  * You may obtain a copy of the License at
07  *
08  *     http://www.apache.org/licenses/LICENSE-2.0
09  *
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 package org.codehaus.griffon.runtime.core.configuration;
17 
18 import javax.annotation.Nonnull;
19 
20 import static griffon.util.GriffonNameUtils.requireNonBlank;
21 
22 /**
23  @author Andres Almiray
24  @since 2.11.0
25  */
26 public abstract class InjectionPoint {
27     private final String configuration;
28     private final String key;
29     private final String format;
30 
31     public InjectionPoint(@Nonnull String configuration, @Nonnull String key, @Nonnull String format) {
32         this.configuration = configuration;
33         this.key = requireNonBlank(key, "Argument 'key' must not be blank");
34         this.format = format;
35     }
36 
37     @Nonnull
38     public String getConfiguration() {
39         return configuration;
40     }
41 
42     @Nonnull
43     public String getKey() {
44         return key;
45     }
46 
47     @Nonnull
48     public String getFormat() {
49         return format;
50     }
51 
52     public abstract void setValue(@Nonnull Object instance, Object value);
53 
54     @Nonnull
55     public abstract Class<?> getType();
56 }