org.faktorips.runtime
Class ValidationContext

java.lang.Object
  extended by org.faktorips.runtime.ValidationContext
All Implemented Interfaces:
IValidationContext

public class ValidationContext
extends Object
implements IValidationContext

Default implementation of IValidationContext.

Author:
Peter Erzberger

Constructor Summary
ValidationContext()
          Creates a new validation context with the default locale (Locale .getDefault()).
ValidationContext(Locale locale)
          Creates a new validation context with the specified local.
ValidationContext(Locale locale, ClassLoader resourceClassLoader)
          Creates a new validation context with the specified local.
 
Method Summary
 Locale getLocale()
          Returns the Locale that is to use for the creation of validation messages.
 ClassLoader getResourceClassLoader()
           
 Object getValue(String propertyName)
          Returns the value for property with the specified name.
 void setValue(String propertyName, Object value)
          Sets the value of the specified property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationContext

public ValidationContext(Locale locale,
                         ClassLoader resourceClassLoader)
Creates a new validation context with the specified local.

Parameters:
locale - Setting the locale of this context
resourceClassLoader - setting the ClassLoader used to load resources
Throws:
NullPointerException - if one of the specified parameters is null

ValidationContext

public ValidationContext(Locale locale)
Creates a new validation context with the specified local.

Throws:
NullPointerException - if the specified parameter is null

ValidationContext

public ValidationContext()
Creates a new validation context with the default locale (Locale .getDefault()).

Method Detail

getLocale

public Locale getLocale()
Description copied from interface: IValidationContext
Returns the Locale that is to use for the creation of validation messages.

Specified by:
getLocale in interface IValidationContext

getValue

public Object getValue(String propertyName)
Description copied from interface: IValidationContext
Returns the value for property with the specified name.

Specified by:
getValue in interface IValidationContext

setValue

public void setValue(String propertyName,
                     Object value)
Sets the value of the specified property.

Parameters:
propertyName - the name of the property
value - the value of the property

getResourceClassLoader

public ClassLoader getResourceClassLoader()
Returns:
Returns the resourceClassLoader.


Copyright © 2015. All rights reserved.