Package org.faktorips.runtime
Class ValidationContext
java.lang.Object
org.faktorips.runtime.ValidationContext
- All Implemented Interfaces:
IValidationContext
Default implementation of
IValidationContext.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new validation context with the default locale (Locale.getDefault()) and aDefaultGenericAttributeValidationConfiguration.ValidationContext(Locale locale) Creates a new validation context with the specified locale and aDefaultGenericAttributeValidationConfiguration.ValidationContext(Locale locale, ClassLoader resourceClassLoader) Creates a new validation context with the specified locale, resourceClassLoaderand aDefaultGenericAttributeValidationConfiguration.ValidationContext(Locale locale, ClassLoader resourceClassLoader, IGenericAttributeValidationConfiguration genericAttributeValidationConfiguration) Creates a new validation context with the specified locale, resourceClassLoaderandIGenericAttributeValidationConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionReturns the configuration for generic attribute validation.Returns the Locale that is to use for the creation of validation messages.Returns the value for property with the specified name.voidSets the value of the specified property.
-
Constructor Details
-
ValidationContext
public ValidationContext(Locale locale, ClassLoader resourceClassLoader, IGenericAttributeValidationConfiguration genericAttributeValidationConfiguration) Creates a new validation context with the specified locale, resourceClassLoaderandIGenericAttributeValidationConfiguration.- Parameters:
locale- Setting the locale of this contextresourceClassLoader- setting theClassLoaderused to load resources- Throws:
NullPointerException- if one of the specified parameters isnull
-
ValidationContext
Creates a new validation context with the specified locale, resourceClassLoaderand aDefaultGenericAttributeValidationConfiguration.- Parameters:
locale- Setting the locale of this contextresourceClassLoader- setting theClassLoaderused to load resources- Throws:
NullPointerException- if one of the specified parameters isnull
-
ValidationContext
Creates a new validation context with the specified locale and aDefaultGenericAttributeValidationConfiguration.- Throws:
NullPointerException- if the specified locale isnull
-
ValidationContext
public ValidationContext()Creates a new validation context with the default locale (Locale.getDefault()) and aDefaultGenericAttributeValidationConfiguration.
-
-
Method Details
-
getLocale
Description copied from interface:IValidationContextReturns the Locale that is to use for the creation of validation messages.- Specified by:
getLocalein interfaceIValidationContext
-
getValue
Description copied from interface:IValidationContextReturns the value for property with the specified name.- Specified by:
getValuein interfaceIValidationContext
-
setValue
Sets the value of the specified property.- Parameters:
propertyName- the name of the propertyvalue- the value of the property
-
getResourceClassLoader
- Returns:
- Returns the resourceClassLoader.
-
getGenericAttributeValidationConfiguration
Returns the configuration for generic attribute validation.- Specified by:
getGenericAttributeValidationConfigurationin interfaceIValidationContext- Implementation Note:
- This implementation returns the configuration passed to the
constructor.
-