|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.boot.bind.PropertiesConfigurationFactory<T>
public class PropertiesConfigurationFactory<T>
Validate some Properties (or optionally PropertySources) by binding
them to an object of a specified type and then optionally running a Validator
over it.
| Constructor Summary | |
|---|---|
PropertiesConfigurationFactory(Class<?> type)
Create a new factory for an object of the given type. |
|
PropertiesConfigurationFactory(T target)
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
void |
bindPropertiesToTarget()
|
protected void |
customizeBinder(org.springframework.validation.DataBinder dataBinder)
|
T |
getObject()
|
Class<?> |
getObjectType()
|
boolean |
isSingleton()
|
void |
setConversionService(org.springframework.core.convert.ConversionService conversionService)
|
void |
setExceptionIfInvalid(boolean exceptionIfInvalid)
|
void |
setIgnoreInvalidFields(boolean ignoreInvalidFields)
Set whether to ignore invalid fields, that is, whether to ignore bind parameters that have corresponding fields in the target object which are not accessible (for example because of null values in the nested path). |
void |
setIgnoreUnknownFields(boolean ignoreUnknownFields)
Set whether to ignore unknown fields, that is, whether to ignore bind parameters that do not have corresponding fields in the target object. |
void |
setMessageSource(org.springframework.context.MessageSource messageSource)
|
void |
setProperties(Properties properties)
|
void |
setPropertySources(org.springframework.core.env.PropertySources propertySources)
|
void |
setTargetName(String targetName)
|
void |
setValidator(org.springframework.validation.Validator validator)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertiesConfigurationFactory(T target)
target - the target object to bind tooPropertiesConfigurationFactory(Class)public PropertiesConfigurationFactory(Class<?> type)
PropertiesConfigurationFactory(Class)| Method Detail |
|---|
public void setIgnoreUnknownFields(boolean ignoreUnknownFields)
Default is "true". Turn this off to enforce that all bind parameters must have a matching field in the target object.
ignoreUnknownFields - if unknown fields should be ignoredpublic void setIgnoreInvalidFields(boolean ignoreInvalidFields)
Default is "false". Turn this on to ignore bind parameters for nested objects in non-existing parts of the target object graph.
ignoreInvalidFields - if invalid fields should be ignoredpublic void setTargetName(String targetName)
targetName - the target name to setpublic void setMessageSource(org.springframework.context.MessageSource messageSource)
setMessageSource in interface org.springframework.context.MessageSourceAwaremessageSource - the messageSource to setpublic void setProperties(Properties properties)
properties - the properties to setpublic void setPropertySources(org.springframework.core.env.PropertySources propertySources)
propertySources - the propertySources to setpublic void setConversionService(org.springframework.core.convert.ConversionService conversionService)
conversionService - the conversionService to setpublic void setValidator(org.springframework.validation.Validator validator)
validator - the validator to setpublic void setExceptionIfInvalid(boolean exceptionIfInvalid)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<T>public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<T>
public T getObject()
throws Exception
getObject in interface org.springframework.beans.factory.FactoryBean<T>Exception
public void bindPropertiesToTarget()
throws org.springframework.validation.BindException
org.springframework.validation.BindExceptionprotected void customizeBinder(org.springframework.validation.DataBinder dataBinder)
dataBinder - the data binder that will be used to bind and validate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||