1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.reactive.beans.factory.config;
18
19 /***
20 * Allows for configuration of individual bean property values from a configuration resource.
21 *
22 * @author Dan Washusen
23 * @version $Id: AbstractPlaceholder.java,v 1.1 2004/12/26 23:42:29 dan_washusen Exp $
24 * @since 16/12/2004
25 */
26 public abstract class AbstractPlaceholder
27 implements Placeholder {
28 protected Class type;
29 protected String key;
30
31 /***
32 * The constructor calls the {@link #determineType(String)} and {@link #determineKey(String)} methods to determine
33 * the placeholders type and the placeholders key respectivly.
34 * @param value The value to construct a placeholder out of
35 */
36 public AbstractPlaceholder(String value) {
37 this.key = determineKey(value);
38 this.type = determineType(value);
39 }
40
41 public String getKey() {
42 return key;
43 }
44
45 public Class getType() {
46 return type;
47 }
48
49 /***
50 * Determines the class that the placeholder will evaluate to.
51 * @param value The String representation of the placeholder
52 * @return The Class representation of the placeholders type
53 */
54 protected abstract Class determineType(String value);
55
56 /***
57 * Determines the key that the {@link PlaceholderMatcher} will use to evaluate the placeholder.
58 * @param value The String representation of the placeholder
59 * @return The key that the {@link PlaceholderMatcher} will use to evaluate the placeholder
60 */
61 protected abstract String determineKey(String value);
62 }