public abstract class AbstractAnnotationConfigSupport extends Object implements BeanClassLoaderAware, BeanFactoryAware, EnvironmentAware
AbstractAnnotationConfigSupport
class is an abstract base class encapsulating functionality
common to all Annotations and configuration classes used to configure Pivotal GemFire/Apache Geode objects
with Spring Data GemFire or Spring Data Geode.ClassLoader
,
Annotation
,
BeanClassLoaderAware
,
BeanFactory
,
BeanFactoryAware
,
ConfigurableBeanFactory
,
AbstractBeanDefinition
,
BeanDefinitionRegistry
,
EnvironmentAware
,
BeanFactoryAccessor
,
EnvironmentAccessor
,
AnnotationAttributes
,
Environment
,
AnnotationMetadata
,
MethodMetadata
,
EvaluationContext
Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractAnnotationConfigSupport.TypeResolver<T>
AbstractAnnotationConfigSupport.TypeResolver is a FunctionalInterface defining a contract to encapsulated the logic
to resolve a particular type . |
Modifier and Type | Field and Description |
---|---|
protected static Set<Integer> |
INFRASTRUCTURE_ROLES |
protected static String |
ORG_SPRINGFRAMEWORK_DATA_GEMFIRE_PACKAGE |
protected static String |
ORG_SPRINGFRAMEWORK_PACKAGE |
protected static String |
SPRING_DATA_GEMFIRE_PROPERTY_PREFIX |
Constructor and Description |
---|
AbstractAnnotationConfigSupport()
Constructs a new instance of
AbstractAnnotationConfigSupport . |
AbstractAnnotationConfigSupport(BeanFactory beanFactory)
Constructs a new instance of
AbstractAnnotationConfigSupport . |
Modifier and Type | Method and Description |
---|---|
protected List<String> |
arrayOfPropertyNamesFor(String propertyNamePrefix) |
protected List<String> |
arrayOfPropertyNamesFor(String propertyNamePrefix,
String propertyNameSuffix) |
protected String |
asArrayProperty(String propertyNamePrefix,
int index,
String propertyNameSuffix) |
protected String |
cacheClientProperty(String propertyNameSuffix) |
protected String |
cacheCompressionProperty(String propertyNameSuffix) |
protected String |
cacheOffHeapProperty(String propertyNameSuffix) |
protected String |
cachePeerProperty(String propertyNameSuffix) |
protected String |
cacheProperty(String propertyNameSuffix) |
protected String |
cacheServerProperty(String propertyNameSuffix) |
protected String |
clusterProperty(String propertyNameSuffix) |
protected String |
diskStoreProperty(String propertyNameSuffix) |
protected String |
entitiesProperty(String propertyNameSuffix) |
protected String |
gatewayReceiverProperty(String propertyNameSuffix) |
protected String |
gatewaySenderProperty(String propertyNameSuffix) |
protected AnnotationAttributes |
getAnnotationAttributes(Annotation annotation)
Returns the
AnnotationAttributes for the given Annotation . |
protected AnnotationAttributes |
getAnnotationAttributes(AnnotationMetadata importingClassMetadata)
Returns
AnnotationAttributes for the declared getAnnotationTypeName() . |
protected AnnotationAttributes |
getAnnotationAttributes(AnnotationMetadata importingClassMetadata,
String annotationName)
|
protected abstract Class<? extends Annotation> |
getAnnotationType()
Returns the cache application
Annotation type pertaining to this configuration. |
protected String |
getAnnotationTypeName()
Returns the fully-qualified
class name of the cache application
Annotation type. |
protected String |
getAnnotationTypeSimpleName()
Returns the simple
class name of the cache application
Annotation type. |
protected ClassLoader |
getBeanClassLoader()
Returns a reference to the
ClassLoader use by the Spring BeanFactory to load classes
for bean definitions. |
protected BeanFactory |
getBeanFactory()
Returns a reference to the Spring
BeanFactory in the current application context. |
protected Environment |
getEnvironment()
Returns a reference to the Spring
Environment . |
protected EvaluationContext |
getEvaluationContext()
Returns a reference to the
EvaluationContext used to evaluate SpEL expressions. |
protected org.slf4j.Logger |
getLog()
Returns a reference to the
Logger used by this class to log messages . |
protected static boolean |
hasValue(Number value)
Determines whether the given
Number has value. |
protected static boolean |
hasValue(Object value)
Determines whether the given
Object has value. |
protected static boolean |
hasValue(String value)
Determines whether the given
String has value. |
protected String |
httpServiceProperty(String propertyNameSuffix) |
protected boolean |
isAnnotationPresent(AnnotationMetadata importingClassMetadata)
Determines whether the given
type meta-data for a particular Class
is annotated with the declared getAnnotationTypeName() . |
protected boolean |
isAnnotationPresent(AnnotationMetadata importingClassMetadata,
String annotationName)
Determines whether the given
type meta-data for a particular Class
is annotated with the given Annotation defined by name . |
protected boolean |
isNotInfrastructureBean(BeanDefinition beanDefinition)
Null-safe method to determine whether the bean defined in the given
BeanDefinition
is a Spring container provided infrastructure bean. |
protected boolean |
isNotInfrastructureBean(Object bean)
Null-safe method to determine whether the given
bean is a Spring container provided
infrastructure bean. |
protected boolean |
isNotInfrastructureClass(BeanDefinition beanDefinition)
Null-safe method to determine whether the bean defined in the given
BeanDefinition
is a Spring container infrastructure bean based on the bean's class type . |
protected boolean |
isNotInfrastructureClass(String className)
Determines whether the given
class type name is considered a Spring container
infrastructure type. |
protected boolean |
isNotInfrastructureRole(BeanDefinition beanDefinition)
Null-safe method to determines whether the bean defined by the given
BeanDefinition
is a Spring container infrastructure bean based on the bean's role. |
protected boolean |
isUserLevelMethod(Method method)
Determines whether the given
Method was declared and defined by the user. |
protected String |
locatorProperty(String propertyNameSuffix) |
protected void |
logDebug(String message,
Object... args)
|
protected void |
logDebug(Supplier<String> message)
|
protected void |
logError(String message,
Object... args)
|
protected void |
logError(Supplier<String> message)
|
protected String |
loggingProperty(String propertyNameSuffix) |
protected void |
logInfo(String message,
Object... args)
|
protected void |
logInfo(Supplier<String> message)
|
protected void |
logWarning(String message,
Object... args)
|
protected void |
logWarning(Supplier<String> message)
|
protected String |
managementProperty(String propertyNameSuffix) |
protected String |
managerProperty(String propertyNameSuffix) |
protected String |
memcachedServiceProperty(String propertyNameSuffix) |
protected String |
namedCacheServerProperty(String name,
String propertyNameSuffix) |
protected String |
namedDiskStoreProperty(String name,
String propertyNameSuffix) |
protected String |
namedGatewaySenderProperty(String name,
String propertyNameSuffix) |
protected String |
namedPoolProperty(String name,
String propertyNameSuffix) |
protected EvaluationContext |
newEvaluationContext(BeanFactory beanFactory)
Constructs, configures and initializes a new instance of an
EvaluationContext . |
protected org.slf4j.Logger |
newLog()
Constructs a new instance of
Logger to log statements printed by Spring Data GemFire/Geode. |
protected String |
pdxProperty(String propertyNameSuffix) |
protected String |
poolProperty(String propertyNameSuffix) |
protected String |
propertyName(String propertyNameSuffix)
Returns the fully-qualified
property name . |
protected String |
redisServiceProperty(String propertyNameSuffix) |
protected AbstractBeanDefinition |
register(AbstractBeanDefinition beanDefinition)
Registers the
AbstractBeanDefinition with the BeanDefinitionRegistry using a generated bean name. |
protected AbstractBeanDefinition |
register(AbstractBeanDefinition beanDefinition,
BeanDefinitionRegistry registry)
Registers the
AbstractBeanDefinition with the BeanDefinitionRegistry using a generated bean name. |
protected <T> T |
requireProperty(String propertyName,
Class<T> type)
Resolves the value for the given property identified by
name from the Spring Environment
as an instance of the specified type . |
protected <A extends Annotation> |
resolveAnnotation(AnnotatedElement annotatedElement,
Class<A> annotationType)
|
protected Optional<Class<?>> |
resolveBeanClass(BeanDefinition beanDefinition,
BeanDefinitionRegistry registry)
Resolves the
type of the bean defined by the given BeanDefinition . |
protected Optional<Class<?>> |
resolveBeanClass(BeanDefinition beanDefinition,
ClassLoader classLoader)
Resolves the
type of the bean defined by the given BeanDefinition . |
protected Optional<Class<?>> |
resolveBeanClass(BeanDefinition beanDefinition,
ConfigurableBeanFactory beanFactory)
Resolves the
type of the bean defined by the given BeanDefinition . |
protected ClassLoader |
resolveBeanClassLoader()
|
protected ClassLoader |
resolveBeanClassLoader(BeanDefinitionRegistry registry)
Attempts to resolve the
ClassLoader used by the BeanDefinitionRegistry
to load Class definitions of the beans defined in the registry. |
protected Optional<String> |
resolveBeanClassName(BeanDefinition beanDefinition)
Resolves the class type name of the bean defined by the given
BeanDefinition . |
protected Boolean |
resolveProperty(String propertyName,
Boolean defaultValue)
|
protected <T> T |
resolveProperty(String propertyName,
Class<T> targetType)
Attempts to resolve the property with the given
name from the Spring Environment . |
protected <T> T |
resolveProperty(String propertyName,
Class<T> targetType,
T defaultValue)
Attempts to resolve the property with the given
name from the Spring Environment . |
protected Double |
resolveProperty(String propertyName,
Double defaultValue)
|
protected Float |
resolveProperty(String propertyName,
Float defaultValue)
|
protected Integer |
resolveProperty(String propertyName,
Integer defaultValue)
|
protected Long |
resolveProperty(String propertyName,
Long defaultValue)
|
protected String |
resolveProperty(String propertyName,
String defaultValue)
|
protected <T> Class<T> |
safeResolveType(AbstractAnnotationConfigSupport.TypeResolver<T> typeResolver)
Safely resolves a
type returned by the supplied AbstractAnnotationConfigSupport.TypeResolver where the type
resolution might result in a ClassNotFoundException , or possibly, NoClassDefFoundError . |
protected String |
securityProperty(String propertyNameSuffix) |
protected String |
serviceProperty(String propertyNameSuffix) |
void |
setBeanClassLoader(ClassLoader beanClassLoader) |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setEnvironment(Environment environment)
Sets a reference to the Spring
Environment . |
protected String |
sslProperty(String propertyNameSuffix) |
protected String |
statsProperty(String propertyNameSuffix) |
protected static final String ORG_SPRINGFRAMEWORK_DATA_GEMFIRE_PACKAGE
protected static final String ORG_SPRINGFRAMEWORK_PACKAGE
protected static final String SPRING_DATA_GEMFIRE_PROPERTY_PREFIX
public AbstractAnnotationConfigSupport()
AbstractAnnotationConfigSupport
.public AbstractAnnotationConfigSupport(BeanFactory beanFactory)
AbstractAnnotationConfigSupport
.beanFactory
- reference to the Spring BeanFactory
.BeanFactory
,
newEvaluationContext(BeanFactory)
protected static boolean hasValue(Number value)
protected static boolean hasValue(Object value)
protected static boolean hasValue(String value)
protected EvaluationContext newEvaluationContext(BeanFactory beanFactory)
EvaluationContext
.beanFactory
- reference to the Spring BeanFactory
.EvaluationContext
.BeanFactory
,
EvaluationContext
,
getBeanFactory()
protected org.slf4j.Logger newLog()
Logger
to log statements printed by Spring Data GemFire/Geode.Logger
.LogFactory.getLog(Class)
,
Log
protected boolean isAnnotationPresent(AnnotationMetadata importingClassMetadata)
type meta-data
for a particular Class
is annotated with the declared getAnnotationTypeName()
.importingClassMetadata
- type meta-data
for a particular Class
.Class
is annotated with
the declared getAnnotationTypeName()
.isAnnotationPresent(AnnotationMetadata, String)
,
getAnnotationTypeName()
,
AnnotationMetadata
protected boolean isAnnotationPresent(AnnotationMetadata importingClassMetadata, String annotationName)
type meta-data
for a particular Class
is annotated with the given Annotation
defined by name
.importingClassMetadata
- type meta-data
for a particular Class
.annotationName
- name
of the Annotation
of interests.Class
is annotated with
the given Annotation
defined by name
.AnnotationMetadata
protected AnnotationAttributes getAnnotationAttributes(Annotation annotation)
AnnotationAttributes
for the given Annotation
.annotation
- Annotation
to get the AnnotationAttributes
for.AnnotationAttributes
for the given Annotation
.AnnotationAttributes
,
Annotation
protected AnnotationAttributes getAnnotationAttributes(AnnotationMetadata importingClassMetadata)
AnnotationAttributes
for the declared getAnnotationTypeName()
.importingClassMetadata
- type meta-data
for a particular Class
.AnnotationAttributes
for the declared getAnnotationTypeName()
.AnnotationAttributes
,
AnnotationMetadata
,
getAnnotationAttributes(AnnotationMetadata, String)
,
getAnnotationTypeName()
protected AnnotationAttributes getAnnotationAttributes(AnnotationMetadata importingClassMetadata, String annotationName)
importingClassMetadata
- type meta-data
for a particular Class
.annotationName
- name
of the Annotation
of interests.AnnotationAttributes
for the given named
Annotation
.AnnotationAttributes
,
AnnotationMetadata
protected abstract Class<? extends Annotation> getAnnotationType()
Annotation
type pertaining to this configuration.Annotation
type used by this application.protected String getAnnotationTypeName()
class name
of the cache application
Annotation
type.class name
of the cache application
Annotation
type.Class.getName()
,
getAnnotationType()
protected String getAnnotationTypeSimpleName()
class name
of the cache application
Annotation
type.class name
of the cache application
Annotation
type.Class.getSimpleName()
,
getAnnotationType()
protected boolean isNotInfrastructureBean(Object bean)
bean
is a Spring container provided
infrastructure bean.bean
- Object
to evaluate.bean
is not a Spring container infrastructure bean.isNotInfrastructureClass(String)
protected boolean isNotInfrastructureBean(BeanDefinition beanDefinition)
BeanDefinition
is a Spring container provided infrastructure bean.beanDefinition
- BeanDefinition
to evaluate.BeanDefinition
is not a Spring container
infrastructure bean.BeanDefinition
,
isNotInfrastructureClass(BeanDefinition)
,
isNotInfrastructureRole(BeanDefinition)
protected boolean isNotInfrastructureClass(BeanDefinition beanDefinition)
BeanDefinition
is a Spring container infrastructure bean based on the bean's class type
.beanDefinition
- BeanDefinition
of the bean to evaluate.BeanDefinition
is not a Spring container
infrastructure bean.BeanDefinition
,
resolveBeanClassName(BeanDefinition)
,
isNotInfrastructureClass(String)
protected boolean isNotInfrastructureClass(String className)
class type name
is considered a Spring container
infrastructure type.
The class type name is considered a Spring container infrastructure type if the package name begins with
'org.springframework', excluding 'org.springframework.data.gemfire'.className
- String
containing the name of the class type to evaluate.class type name
is not considered a
Spring container infrastructure type.protected boolean isNotInfrastructureRole(BeanDefinition beanDefinition)
BeanDefinition
is a Spring container infrastructure bean based on the bean's role.beanDefinition
- BeanDefinition
of the bean to evaluate.BeanDefinition
is not a Spring container
infrastructure bean.BeanDefinition
protected boolean isUserLevelMethod(Method method)
Method
was declared and defined by the user.
A Method
is considered a user-level Method
if the Method
is not
an Object
class method, is a Bridge Method
or is not Method.isSynthetic()
nor a Groovy method.public void setBeanClassLoader(ClassLoader beanClassLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
protected ClassLoader getBeanClassLoader()
ClassLoader
use by the Spring BeanFactory
to load classes
for bean definitions.ClassLoader
used by the Spring BeanFactory
to load classes for bean definitions.setBeanClassLoader(ClassLoader)
protected ClassLoader resolveBeanClassLoader()
ClassLoader
or the
Thread Context ClassLoader
.Thread.getContextClassLoader()
,
getBeanClassLoader()
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
protected BeanFactory getBeanFactory()
BeanFactory
in the current application context.BeanFactory
.IllegalStateException
- if the Spring BeanFactory
was not properly configured.BeanFactory
public void setEnvironment(Environment environment)
Environment
.setEnvironment
in interface EnvironmentAware
environment
- Spring Environment
.EnvironmentAware.setEnvironment(Environment)
,
Environment
protected Environment getEnvironment()
Environment
.Environment
.Environment
protected EvaluationContext getEvaluationContext()
EvaluationContext
used to evaluate SpEL expressions.EvaluationContext
used to evaluate SpEL expressions.EvaluationContext
protected org.slf4j.Logger getLog()
Logger
used by this class to log messages
.protected void logDebug(String message, Object... args)
message
- String
containing the message to log.args
- array of arguments
used to format the message
.logDebug(Supplier)
protected void logDebug(Supplier<String> message)
message
- Supplier
containing the message
and arguments to log.Log.isDebugEnabled()
,
Log.debug(Object)
,
getLog()
protected void logInfo(String message, Object... args)
message
- String
containing the message to log.args
- array of arguments
used to format the message
.logInfo(Supplier)
protected void logInfo(Supplier<String> message)
message
- Supplier
containing the message
and arguments to log.Log.isInfoEnabled()
,
Log.info(Object)
,
getLog()
protected void logWarning(String message, Object... args)
message
- String
containing the message to log.args
- array of arguments
used to format the message
.logWarning(Supplier)
protected void logWarning(Supplier<String> message)
message
- Supplier
containing the message
and arguments to log.Log.isWarnEnabled()
,
Log.warn(Object)
,
getLog()
protected void logError(String message, Object... args)
message
- String
containing the message to log.args
- array of arguments
used to format the message
.logError(Supplier)
protected void logError(Supplier<String> message)
message
- Supplier
containing the message
and arguments to log.Log.isErrorEnabled()
,
Log.error(Object)
,
getLog()
protected AbstractBeanDefinition register(AbstractBeanDefinition beanDefinition)
AbstractBeanDefinition
with the BeanDefinitionRegistry
using a generated bean name.beanDefinition
- AbstractBeanDefinition
to register.AbstractBeanDefinition
.BeanFactory
,
AbstractBeanDefinition
,
BeanDefinitionRegistry
,
BeanDefinitionReaderUtils.registerWithGeneratedName(AbstractBeanDefinition, BeanDefinitionRegistry)
,
getBeanFactory()
protected AbstractBeanDefinition register(AbstractBeanDefinition beanDefinition, BeanDefinitionRegistry registry)
AbstractBeanDefinition
with the BeanDefinitionRegistry
using a generated bean name.beanDefinition
- AbstractBeanDefinition
to register.registry
- BeanDefinitionRegistry
used to register the AbstractBeanDefinition
.AbstractBeanDefinition
.AbstractBeanDefinition
,
BeanDefinitionRegistry
,
BeanDefinitionReaderUtils.registerWithGeneratedName(AbstractBeanDefinition, BeanDefinitionRegistry)
protected List<String> arrayOfPropertyNamesFor(String propertyNamePrefix, String propertyNameSuffix)
protected String asArrayProperty(String propertyNamePrefix, int index, String propertyNameSuffix)
protected String namedCacheServerProperty(String name, String propertyNameSuffix)
protected String namedDiskStoreProperty(String name, String propertyNameSuffix)
protected String namedGatewaySenderProperty(String name, String propertyNameSuffix)
protected String propertyName(String propertyNameSuffix)
property name
.
The fully qualified property name
consists of the property name
concatenated with the propertyNameSuffix
.propertyNameSuffix
- String
containing the property name suffix
concatenated with the base property name
.property name
.String
protected <T> T requireProperty(String propertyName, Class<T> type)
name
from the Spring Environment
as an instance of the specified type
.T
- Class
type of the propertyName property's
assigned value.propertyName
- String
containing the name of the required property to resolve.type
- Class
type of the property's assigned value.named
property.IllegalArgumentException
- if the property has not been assigned a value.
For String
values, this also means the value cannot be empty
.
For non-String
values, this means the value must not be null.resolveProperty(String, Class, Object)
protected <A extends Annotation> A resolveAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType)
A
- Subclass type
of the resolved Annotation
.annotatedElement
- AnnotatedElement
from which to resolve the Annotation
.annotationType
- type
of the Annotation
to resolve from the AnnotatedElement
.Annotation
.Annotation
,
AnnotatedElement
,
Class
protected Optional<Class<?>> resolveBeanClass(BeanDefinition beanDefinition, BeanDefinitionRegistry registry)
type
of the bean defined by the given BeanDefinition
.beanDefinition
- BeanDefinition
defining the bean from which the type
is resolved.registry
- BeanDefinitionRegistry
used to resolve the ClassLoader
used to resolve
the bean's type
.Optional
Class
specifying the resolved type of the bean.BeanDefinition
,
BeanDefinitionRegistry
,
resolveBeanClassLoader(BeanDefinitionRegistry)
,
resolveBeanClass(BeanDefinition, ClassLoader)
protected Optional<Class<?>> resolveBeanClass(BeanDefinition beanDefinition, ConfigurableBeanFactory beanFactory)
type
of the bean defined by the given BeanDefinition
.beanDefinition
- BeanDefinition
defining the bean from which the type
is resolved.beanFactory
- ConfigurableBeanFactory
used to resolve the ClassLoader
used to resolve
the bean's type
.Optional
Class
specifying the resolved type of the bean.BeanDefinition
,
ConfigurableBeanFactory
,
resolveBeanClass(BeanDefinition, ClassLoader)
protected Optional<Class<?>> resolveBeanClass(BeanDefinition beanDefinition, ClassLoader classLoader)
type
of the bean defined by the given BeanDefinition
.beanDefinition
- BeanDefinition
defining the bean from which the type
is resolved.classLoader
- ClassLoader
used to resolve the bean's type
.Optional
resolved type
of the bean.ClassLoader
,
BeanDefinition
,
AbstractBeanDefinition.resolveBeanClass(ClassLoader)
,
ClassUtils.forName(String, ClassLoader)
,
resolveBeanClassName(BeanDefinition)
protected ClassLoader resolveBeanClassLoader(BeanDefinitionRegistry registry)
ClassLoader
used by the BeanDefinitionRegistry
to load Class
definitions of the beans defined in the registry.registry
- BeanDefinitionRegistry
from which to resolve the ClassLoader
.ClassLoader
from the BeanDefinitionRegistry
or the current Thread's
context ClassLoader
.ConfigurableBeanFactory.getBeanClassLoader()
,
BeanDefinitionRegistry
,
Thread.currentThread()
,
Thread.getContextClassLoader()
protected Optional<String> resolveBeanClassName(BeanDefinition beanDefinition)
BeanDefinition
.beanDefinition
- BeanDefinition
defining the bean from which to resolve the class type name.Optional
String
containing the resolved class type name of the bean defined
by the given BeanDefinition
.BeanDefinition.getBeanClassName()
protected Boolean resolveProperty(String propertyName, Boolean defaultValue)
propertyName
- name
of the property to resolve.defaultValue
- default value to return if the property is not defined or not set.name
or default value if the property
is not defined or not set.resolveProperty(String, Class, Object)
protected Double resolveProperty(String propertyName, Double defaultValue)
propertyName
- name
of the property to resolve.defaultValue
- default value to return if the property is not defined or not set.name
or default value if the property
is not defined or not set.resolveProperty(String, Class, Object)
protected Float resolveProperty(String propertyName, Float defaultValue)
propertyName
- name
of the property to resolve.defaultValue
- default value to return if the property is not defined or not set.name
or default value if the property
is not defined or not set.resolveProperty(String, Class, Object)
protected Integer resolveProperty(String propertyName, Integer defaultValue)
propertyName
- name
of the property to resolve.defaultValue
- default value to return if the property is not defined or not set.name
or default value if the property
is not defined or not set.resolveProperty(String, Class, Object)
protected Long resolveProperty(String propertyName, Long defaultValue)
propertyName
- name
of the property to resolve.defaultValue
- default value to return if the property is not defined or not set.name
or default value if the property
is not defined or not set.resolveProperty(String, Class, Object)
protected String resolveProperty(String propertyName, String defaultValue)
propertyName
- name
of the property to resolve.defaultValue
- default value to return if the property is not defined or not set.name
or default value if the property
is not defined or not set.resolveProperty(String, Class, Object)
protected <T> T resolveProperty(String propertyName, Class<T> targetType)
name
from the Spring Environment
.T
- Class
type of the property value.propertyName
- name
of the property to resolve.targetType
- Class
type of the property's value.name
or null if the property
is not defined or not set.resolveProperty(String, Class, Object)
protected <T> T resolveProperty(String propertyName, Class<T> targetType, T defaultValue)
name
from the Spring Environment
.T
- Class
type of the property value.propertyName
- name
of the property to resolve.targetType
- Class
type of the property's value.defaultValue
- default value to return if the property is not defined or not set.name
or default value if the property
is not defined or not set.getEnvironment()
protected <T> Class<T> safeResolveType(AbstractAnnotationConfigSupport.TypeResolver<T> typeResolver)
type
returned by the supplied AbstractAnnotationConfigSupport.TypeResolver
where the type
resolution might result in a ClassNotFoundException
, or possibly, NoClassDefFoundError
.T
- Class
of the type being resolved.typeResolver
- AbstractAnnotationConfigSupport.TypeResolver
used to resolve a specific type
.type
or null if the type
returned by
the AbstractAnnotationConfigSupport.TypeResolver
could not be resolved.AbstractAnnotationConfigSupport.TypeResolver
,
Class
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.