public abstract class AbstractResourceInjector extends Object implements ResourceInjector
Modifier and Type | Field and Description |
---|---|
protected static String |
ERROR_CLASS_NULL |
protected static String |
ERROR_FIELD_NULL |
protected static String |
ERROR_FULLY_QUALIFIED_FIELD_NAME_BLANK |
protected static String |
ERROR_FULLY_QUALIFIED_NAME_BLANK |
protected static String |
ERROR_INSTANCE_NULL |
protected static String |
ERROR_METHOD_NULL |
protected static String |
ERROR_TYPE_NULL |
protected static String |
ERROR_VALUE_NULL |
Constructor and Description |
---|
AbstractResourceInjector() |
Modifier and Type | Method and Description |
---|---|
protected Object |
convertValue(Class<?> type,
Object value,
String format) |
protected boolean |
doResourceInjection(Class<?> klass,
Object instance) |
void |
injectResources(Object instance) |
protected PropertyEditor |
resolvePropertyEditor(Class<?> type,
String format) |
protected abstract Object |
resolveResource(String key,
String[] args) |
protected abstract Object |
resolveResource(String key,
String[] args,
String defaultValue) |
protected void |
setFieldValue(Object instance,
Field field,
Object value,
String fqFieldName) |
protected void |
setPropertyValue(Object instance,
Method method,
Object value,
String fqName) |
protected static final String ERROR_INSTANCE_NULL
protected static final String ERROR_METHOD_NULL
protected static final String ERROR_FIELD_NULL
protected static final String ERROR_CLASS_NULL
protected static final String ERROR_TYPE_NULL
protected static final String ERROR_VALUE_NULL
protected static final String ERROR_FULLY_QUALIFIED_NAME_BLANK
protected static final String ERROR_FULLY_QUALIFIED_FIELD_NAME_BLANK
public void injectResources(@Nonnull Object instance)
injectResources
in interface ResourceInjector
protected boolean doResourceInjection(@Nonnull Class<?> klass, @Nonnull Object instance)
@Nullable protected abstract Object resolveResource(@Nonnull String key, @Nonnull String[] args)
@Nullable protected abstract Object resolveResource(@Nonnull String key, @Nonnull String[] args, @Nonnull String defaultValue)
@Nonnull protected Object convertValue(@Nonnull Class<?> type, @Nonnull Object value, @Nullable String format)
@Nullable protected PropertyEditor resolvePropertyEditor(@Nonnull Class<?> type, @Nullable String format)
protected void setPropertyValue(@Nonnull Object instance, @Nonnull Method method, @Nullable Object value, @Nonnull String fqName)