Package org.faktorips.runtime
Class ValidationContext
- java.lang.Object
-
- org.faktorips.runtime.ValidationContext
-
- All Implemented Interfaces:
IValidationContext
public class ValidationContext extends java.lang.Object implements IValidationContext
Default implementation ofIValidationContext.
-
-
Constructor Summary
Constructors Constructor Description ValidationContext()Creates a new validation context with the default locale (Locale.getDefault()) and aDefaultGenericAttributeValidationConfiguration.ValidationContext(java.util.Locale locale)Creates a new validation context with the specified locale and aDefaultGenericAttributeValidationConfiguration.ValidationContext(java.util.Locale locale, java.lang.ClassLoader resourceClassLoader)Creates a new validation context with the specified locale, resourceClassLoaderand aDefaultGenericAttributeValidationConfiguration.ValidationContext(java.util.Locale locale, java.lang.ClassLoader resourceClassLoader, IGenericAttributeValidationConfiguration genericAttributeValidationConfiguration)Creates a new validation context with the specified locale, resourceClassLoaderandIGenericAttributeValidationConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IGenericAttributeValidationConfigurationgetGenericAttributeValidationConfiguration()Returns the configuration for generic attribute validation.java.util.LocalegetLocale()Returns the Locale that is to use for the creation of validation messages.java.lang.ClassLoadergetResourceClassLoader()java.lang.ObjectgetValue(java.lang.String propertyName)Returns the value for property with the specified name.voidsetValue(java.lang.String propertyName, java.lang.Object value)Sets the value of the specified property.
-
-
-
Constructor Detail
-
ValidationContext
public ValidationContext(java.util.Locale locale, java.lang.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:
java.lang.NullPointerException- if one of the specified parameters isnull
-
ValidationContext
public ValidationContext(java.util.Locale locale, java.lang.ClassLoader resourceClassLoader)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:
java.lang.NullPointerException- if one of the specified parameters isnull
-
ValidationContext
public ValidationContext(java.util.Locale locale)
Creates a new validation context with the specified locale and aDefaultGenericAttributeValidationConfiguration.- Throws:
java.lang.NullPointerException- if the specified locale isnull
-
ValidationContext
public ValidationContext()
Creates a new validation context with the default locale (Locale.getDefault()) and aDefaultGenericAttributeValidationConfiguration.
-
-
Method Detail
-
getLocale
public java.util.Locale getLocale()
Description copied from interface:IValidationContextReturns the Locale that is to use for the creation of validation messages.- Specified by:
getLocalein interfaceIValidationContext
-
getValue
public java.lang.Object getValue(java.lang.String propertyName)
Description copied from interface:IValidationContextReturns the value for property with the specified name.- Specified by:
getValuein interfaceIValidationContext
-
setValue
public void setValue(java.lang.String propertyName, java.lang.Object value)Sets the value of the specified property.- Parameters:
propertyName- the name of the propertyvalue- the value of the property
-
getResourceClassLoader
public java.lang.ClassLoader getResourceClassLoader()
- Returns:
- Returns the resourceClassLoader.
-
getGenericAttributeValidationConfiguration
public IGenericAttributeValidationConfiguration getGenericAttributeValidationConfiguration()
Returns the configuration for generic attribute validation.- Specified by:
getGenericAttributeValidationConfigurationin interfaceIValidationContext- Implementation Note:
- This implementation returns the configuration passed to the
constructor.
-
-