Questions tagged [oval]

OVal (Object Validation Framework) is a validation framework for Java objects

Per the OVal about page:

OVal is a pragmatic and extensible validation framework for any kind of Java objects (not only JavaBeans).

Constraints can be declared with annotations (@NotNull, @MaxLength), POJOs or XML.

Custom constraints can be expressed as custom Java classes or by using scripting languages such as JavaScript, Groovy, BeanShell, OGNL or MVEL.

Besides field/property validation OVal implements Programming by Contract features by utilizing AspectJ based aspects. This for example allows runtime validation of method arguments.

See also: OVal User Guide

59 questions
6
votes
1 answer

How to detect missing field when converting jsonObject to Model Object

I am sending a JsonObject using web service. The method that receives the call has a method parameter of model Object for the corresponding JsonObject Input being passed. The JsonObject is successfully getting converted to model object but I am…
Tarun
  • 271
  • 1
  • 6
  • 18
5
votes
1 answer

Access annotation attributes from custom oval annotation

Is it possible, when using custom oval annotation and custom class for check, to access the annotation and retrieve the used annotation attributes ? Reference for oval:…
Talos
  • 457
  • 4
  • 15
4
votes
2 answers

Is it possible to set multiple messages using oval AbstractAnnotationCheck?

I am using the Oval validation framework to validate fields that HTML fields cannot hold malicious javascript code. For the malicious code detection, I am using an external framework that returns me a list of errors that I would like to use as…
Ransom Briggs
  • 3,025
  • 3
  • 32
  • 46
3
votes
1 answer

Oval path Animation using image

I am trying to implement Oval path animation, I want to show path animation using image, I tried https://github.com/matthewrkula/AnimatedPathView but it's not work for oval. I also tried below code for oval path but it is shows circle, Anyone have…
user5418227
2
votes
2 answers

parameter validation with net.sf.oval (in play framework)

I would love to use the @NotNull annotation (or @Required or anything) for my own methods. While this works quite well in Controller and Model classes I cant get it to work in my own. This probably is more of a net.sf.oval question then play…
Alex
  • 474
  • 3
  • 10
2
votes
1 answer

Changing WMI/WQL results output

Now this is a odd one but as I don't know WMI/WQL I hope someone can help and spot a simple mistake.. I need to find out if a system is a domain controller or not - simple with WMI select DomainRole from Win32_ComputerSystem gets the data. However…
Dreaddan
  • 687
  • 1
  • 7
  • 14
2
votes
1 answer

How to get the numeric ID of an IIS 6 Metabase property in C#?

The code below works OK and can read everything in a remote IIS 6 server's metabase -- except the frikkin' numeric ID of the properties. I can't find them in the PropertyValueCollection object. var site = new DirectoryEntry("IIS://" + tbHost.Text +…
JCCyC
  • 16,140
  • 11
  • 48
  • 75
2
votes
2 answers

Hibernate Validator method or constructor validation

How can I use Hibernate validator to validate the arguments inside the constructor or method? I want the validation to occur before the ValueObject creation so I can throw an exception and not create the object unless all parameters are…
Kai
  • 1,709
  • 1
  • 23
  • 36
2
votes
1 answer

how to use oval on custom validation Annotation

Here is my code for creating a custom Annotation for validating Name ValidName.java package custom.Annotation; import java.lang.annotation.*; import…
2
votes
3 answers

Overwrite Annotations with Reflection?

I'm using Oval to do validations, so we have code that looks like this: @NotNull(errorCode = "NumberInvalid") @NotNegative(errorCode = "NumberInvalid") @Range(errorCode = "NumberInvalid", min=1, max=10) protected Integer dollarAmount; I…
Jason
  • 13,563
  • 15
  • 74
  • 125
2
votes
2 answers

How to validate a array using oval validation framework?

I have a bean object and want to validate its fields using oval validation framework. e.g public class Demo{ @Range(min=1) private long id; @NotNull private long[] values; } As above, I have a field whose type is a array of long.…
kino lucky
  • 1,365
  • 4
  • 15
  • 24
1
vote
2 answers

Oval - Multiple ValidateWithMethod / complex custom validations with different messages?

I am trying to use @ValidateWithMethod to validate a property. I have two very different custom validations. I want to put them in separate methods so that I can have different messages. However, placing two separate @ValidateWithMethod attributes…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
1
vote
1 answer

Oval - object validation framework for Java

@ValidateWithMethod(methodName = "isValidPostalCode", parameterType = String.class) private String _postalCode; private boolean isValidPostalCode(String _postalCode) { boolean status = false; if (this.getTypeEnum() == 2) { if…
Rakhita
  • 4,493
  • 1
  • 16
  • 15
1
vote
2 answers

How to draw oval shape (rectangle with round corners) as text background using Paint and Convas in Android java

I am trying to add an oval background to my text according to its size using Paint. There are a few problems in my code. I want to draw rectangle with round corners instead of the circles. Its size does not changes according to text length. Here…
Waqas K
  • 144
  • 2
  • 12
1
vote
2 answers

Should I use OVal (Object Validation Framework) even if it requires AspectJ or not?

I have a Java Maven project which is developed by multiple people. As I really like doing JUnit Tests and the like, the concept of OVal intrigues me because I can write code like: @NotNull @NotEmpty @Length(max=32) private String name However the…
Konrad Höffner
  • 11,100
  • 16
  • 60
  • 118
1
2 3 4