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 7159057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:10:03+00:00 2026-05-28T13:10:03+00:00

I am making an application that uses Drools planner. The @ValueRangeFromSolutionProperty is supposed to

  • 0

I am making an application that uses Drools planner.

The @ValueRangeFromSolutionProperty is supposed to refer to a property from another class (NQueens in this case). From the JavaDocs for @ValueRangeFromSolutionProperty:

propertyName

    The property name of which exists a getter on the Solution that returns a Collection. 

But I noticed an inconsistency: the annotator uses the property rowList from NQueens. But rowList (as opposed to RowList) is a private variable (see snippets below). If it were supposed to infer a property by introspection (from it’s getter and setter methods), shouldnt it be spelled RowList as in getRowList()?

Question: How does Java infer (introspect) the property name (case and all) from the getter methods?

Or does the @ValueRangeFromSolutionProperty access the private variables directly?


Background details:
From Queen.java, a class that represents a queen on a chessboard:

public class Queen extends AbstractPersistable {
....
@ValueRangeFromSolutionProperty(propertyName = "rowList")
public Row getRow() {
    return row;
....

From NQueens.java, the class from which the @ValueRangeFromSolutionProperty gets it’s property from:

public class NQueens extends AbstractPersistable implements Solution<SimpleScore> {
...
private List<Column> columnList;
private List<Row> rowList;
....
public List<Row> getRowList() {
    return rowList;
...
  • 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-28T13:10:04+00:00Added an answer on May 28, 2026 at 1:10 pm

    The JavaBeans Specification says that for a property propertyName there should be a getter method getPropertyName() and/or a setter method setPropertyName().

    A property is defined by the only presence of the getter and setter methods and can also be a computed value. A instance variable on the object is not required.

    The specification defines the capitalization rules for properties and getter/setter methods:

    Thus when we extract a property or event name from the middle of an
    existing Java name, we normally convert the first character to lower
    case. However to support the occasional use of all upper-case names,
    we check if the first two characters of the name are both upper case
    and if so leave it alone. So for example,

    “FooBah” becomes “fooBah”, “Z” becomes “z”, “URL” becomes “URL


    The method is in fact implemented as:

    /*
    Utility method to take a string and convert it to normal Java variable name 
    capitalization. This normally means converting the first character from upper case to  
    lower case, but in the (unusual) special case when there is more than one character  
    and both the first and second characters are upper case, we leave it alone.
    
    Thus "FooBah" becomes "fooBah" and "X" becomes "x", but "URL" stays as "URL".
    
     Parameters:
         name The string to be decapitalized.
     Returns:
     The decapitalized version of the string.
     */
     public static String  decapitalize(String name) {
     if (name == null || name.length() == 0) {
     return name;
     }
     if (name.length() > 1 && Character.isUpperCase(name.charAt(1)) &&
                         Character.isUpperCase(name.charAt(0))){
            return name;
         }
    
         char chars[] = name.toCharArray();
         chars[0] = Character.toLowerCase(chars[0]);
         return new String(chars);
     }
    

    So:

    1. if the name is null, return it as such
    2. if the name has first two characters in caps, return it as such
    3. all other strings, decapitalize first character
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making an Android application that reads an XML Internet. This application uses SAX
I'm making a web application that uses hash tags for page navigation like this
I am making a simple application that uses a NSSlider, which can be put
I'm making an application in Win32 API that uses the modern Ribbon style UI.
I am making an application that involves controlling Safari from Applescript. Is there a
I am making an android application that loads files from a directory on the
I'm making a chat application that works with long-polling to emulate a push from
Alright, I'm in the process of making a C# application that uses an API
I am making an android application that uses these views: (Root) - LinearLayout (Child
I am making an android application that uses a listview. I want to get

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.