Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7581497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:13:05+00:00 2026-05-30T18:13:05+00:00

trying to understand how validation works in playframework1.2.4,I went through the docs and also

  • 0

trying to understand how validation works in playframework1.2.4,I went through the docs and
also through some posts in SO..Still a couple of things nag me..

In the documentation ,the URICheck class has the following method

@Override
public void configure(URI uri) {
    setMessage(uri.message());
    this.schemes = Arrays.asList(uri.schemes());
}

where does the uri.schemes() come from?Is there a URI class apart from the @interface URI ?

Also,later in the isSatisfied() method,

public boolean isSatisfied(Object validatedObject, Object value,OValContext context, Validator validator){
...
}

The validatedObject is the instance of URI ,isn’t it? and the value parameter is the actual value passed which need to be validated.

If someone can clarify these,it would be much helpful..I hope there was a bit more in the javadocs explaining the parameters
The @interface URI doesn’t have any such methods.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:13:07+00:00Added an answer on May 30, 2026 at 6:13 pm

    I don’t see a URI class in the source code of PLay, only a URL, but the behaviour will be the same.

    When you annotate a field with a validation-related annotation, you may give some parameters to that annotation. For example, to simplify:

       @Max(value=10, message="My error message")
       public int myValue;
    

    That Annotation is defined as follows:

    @Retention(RetentionPolicy.RUNTIME)
    @Target({ElementType.FIELD, ElementType.PARAMETER})
    @Constraint(checkWith = MaxCheck.class)
    public @interface Max {
    
        String message() default MaxCheck.mes;
        double value();
    }
    

    As you can see, it has 2 methods whose names are the same as the parameters I set. Once I call these methods, I’ll obtain the parameters related to that instance of the annotation.

    Later on, Play does some “magic” via reflection to check the annotation related to a field of an entity, uses that instance in the configure method and then executes the isSatisfied method.

    The configured method for Max is:

    @Override
        public void configure(Max max) {
            this.max = max.value();
            setMessage(max.message());
        }
    

    As you can see, it uses the methods from the annotation, which you initialized in your entity.

    I hope this helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to understand how validation works for a combo box when its ItemsSource
I am trying to better understand how validation works in a Windows Forms application.
I'm trying to understand why this does not work. (Basic example with no validation
Sorry to bother you all here but I am still trying to understand more
ASP.NET MVC Model Binding is still new to me and I'm trying to understand
I spent some two hours trying to understand why the JavaScript file I am
I am trying to understand why my login form does not display the validation
I'm trying to learn / understand client-side validation with jquery.validate. Currently, I have a
I'm having an awful time trying to understand what my validation method is having
Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling) Input is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.