1 package ch.qos.logback.core.joran.util.beans;
2
3 import java.lang.reflect.Method;
4 import java.util.Collections;
5 import java.util.Map;
6
7
8
9
10
11
12
13
14
15
16 public class BeanDescription {
17
18 private final Class<?> clazz;
19
20 private final Map<String, Method> propertyNameToGetter;
21
22 private final Map<String, Method> propertyNameToSetter;
23
24 private final Map<String, Method> propertyNameToAdder;
25
26
27
28
29
30
31
32
33
34
35
36 protected BeanDescription(Class<?> clazz, Map<String, Method> propertyNameToGetter,
37 Map<String, Method> propertyNameToSetter, Map<String, Method> propertyNameToAdder) {
38 this.clazz = clazz;
39 this.propertyNameToGetter = Collections.unmodifiableMap(propertyNameToGetter);
40 this.propertyNameToSetter = Collections.unmodifiableMap(propertyNameToSetter);
41 this.propertyNameToAdder = Collections.unmodifiableMap(propertyNameToAdder);
42 }
43
44 public Class<?> getClazz() {
45 return clazz;
46 }
47
48 public Map<String, Method> getPropertyNameToGetter() {
49 return propertyNameToGetter;
50 }
51
52 public Map<String, Method> getPropertyNameToSetter() {
53 return propertyNameToSetter;
54 }
55
56 public Method getGetter(String propertyName) {
57 return propertyNameToGetter.get(propertyName);
58 }
59
60 public Method getSetter(String propertyName) {
61 return propertyNameToSetter.get(propertyName);
62 }
63
64 public Map<String, Method> getPropertyNameToAdder() {
65 return propertyNameToAdder;
66 }
67
68 public Method getAdder(String propertyName) {
69 return propertyNameToAdder.get(propertyName);
70 }
71
72 }