Skip to content

sebthom.de

Menu
  • Home
  • About me
  • Imprint
    • Datenschutzerklärung
  • Guestbook
Menu

OVal 1.40 released

Posted on Monday September 28th, 2009Tuesday December 18th, 2012 by sebthom

I am happy to announce the immediate availability of Version 1.40 OVal the Object Validation Framework for Java. This release fixes some minor issues and provides the following two new features:

1. Enabling/disabling constraints based on the object state:
Using the newly introduced when attribute for constraints it is possible to specify under which circumstances the constraint will be considered during object validation. The when attribute holds a formula in one of the supported scripting languages. If the formula returns true, the constraint will be activated for the current validation cycle otherwise it is ignored. In the following example the alias attribute must have a value only when the name attribute is not set.

public class User {
   private String name;

   @NotNull(when = "groovy:_this.name == null")
   private String alias;

   // . . .
}

2. Fine grain control over how constraints are applied on arrays, maps, collections and their elements
The newly introduced attribute appliesTo allows you to specify if and how a constraint declared for a map, a collection or an array is applied to their elements as well or exclusively. See the following example how this works:

public class BusinessObject {

   // the ids field may be null, but if it is not null 
   // none of it's items must be null
   @NotNull(appliesTo = { ConstraintTarget.VALUES })
   private String[] ids;

   // only the field itself must not be null,
   // the list can contain null values
   @NotNull(appliesTo = { ConstraintTarget.CONTAINER })
   private List items;

   // the field must not be null as well as all keys 
   // and values of the map
   @NotNull(appliesTo = { ConstraintTarget.CONTAINER, ConstraintTarget.KEYS, ConstraintTarget.VALUES })
   private Map itemsByGroup;

   // . . .
}

Download
You can get the latest binaries and source files of OVal from here: //sourceforge.net/projects/oval/files/

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

  • Blog (1)
  • IT (21)
    • Development (16)
      • Java (7)
      • Jython (4)
      • Visual Basic (5)
    • Linux (3)
    • WebSphere Application Server (1)
    • WebSphere Portal (2)
    • Windows (1)
  • My Freeware (2)
  • My Music (3)

Recent Posts

  • Logging WebSphere API calls in wsadmin scripts
  • [Solved] Windows 7 “Safely Remove Hardware” pop-up menu horrendously slow
  • Bash: Capturing stderr in a variable while still printing to the console.
  • Configuring EMF Teneo with Hibernate, Commons DBCP, Spring Hibernate Transaction Manager, and the OpenSessionInViewFilter
  • Using EMF ECore model objects with Wicket components
  • Installing Tomcat 6 on Debian Squeeze
  • Leveraging PyDev’s auto-completion for indirectly created objects
  • OVal 1.40 released
  • Installing WebSphere Portal in a local network
  • Comparing version numbers in Jython / Python

Blogroll

  • E L S U A
  • elektrofever.de
  • OVal
  • Sweettt.com
  • Twins’ Running Blog

Recent Comments

  • Annibale on Visual Basic – Multiple Undos Class v2.04
  • Annibale on Visual Basic – Multiple Undos Class v2.04
  • koliko2k3 on Guestbook
  • hdkid on MyPad v1.1.6 – a PHP Editor
  • Luis Diego Villarreal on Excel – VBA Timer Example v1.0.1

Archives

  • June 2014
  • May 2012
  • January 2011
  • October 2010
  • September 2010
  • March 2010
  • February 2010
  • September 2009
  • July 2009
  • March 2009
  • February 2009
  • November 2008
  • September 2008
  • May 2008
  • September 2007
  • July 2007
  • July 2004
  • March 2003
  • August 2002
  • April 2002
  • January 2002
  • Deutsch (de)Deutsch
  • English (en)English
© 2025 sebthom.de | Powered by Minimalist Blog WordPress Theme