Does Java and / or Spring have a concept of properties? I have a group of domain models, each of which has several properties. Example:
public class Person { private String name; private Date dateOfBirth; private float height; private float weight;
When displaying a face, property names are hardcoded in JSP.
Name: ${person.name}<br> Date of birth: ${person.dateOfBirth}<br> Height: ${person.height}<br> Weight: ${person.weight}<br>
In addition, there may be several different pages on which a person is displayed. Note that the date of birth is java.util.Date , so the JSP or controller will use java.text.SimpleDateFormat to format it. Height and weight are numbers, and they can have their own java.util.Format , used for formatting.
I am looking for a property search mechanism. Each property (name, date of birth, height, etc.) will have a display name, format and description (used for reference or tooltips). Property attributes will be defined in the configuration file somewhere. When a property is displayed, the display name and format will be viewed using the property mechanism. It would also solve localization.
My question is that something similar has already been implemented for Java.
source share