Attribute mapping
- Last Updated: March 24, 2022
- 3 minute read
- Corticon
- Version 6.3
- Documentation
When attempting to map attributes, the mapper looks for class properties
which are exposed using public get and set methods by the same name. For example, if
mapping attribute flightNumber, the mapper looks for
public getFlightNumber and setFlightNumber methods in the mapped class.
When Java Object mapping has been added to the Vocabulary, its Attribute properties are displayed.
| Java Object Get Method | Manually specifies the GET method of a class property that does not conform to naming conventions of the auto-mapper. |
| Java Object Set Method | Manually specifies the SET method of a class property that does not conform to naming conventions of the auto-mapper. |
| Java Object Field Name | Manually specifies a public instance variable name. |
In the case of attribute flightNumber,
the mapper finds get and set methods that conform to this naming convention, so the
method names are inserted into the fields in gray type, as shown in the following
figure.
In those cases where the mapper cannot locate the corresponding methods,
you will need to select them manually. Notice in the MyAircraft class shown in First Portion of MyAircraft Class, no get and set methods
exist for istrAircraftType since it is a public
instance variable. Therefore, we need to select it from the Java Object Field Name drop-down, as shown in the following figure.
When a class property contains get and set methods, but their names do not conform to the naming convention assumed by the auto-mapper, we must select the method names from the Java Object Get Method and Set Method drop-downs, as shown in the following figure.
A property's data type is detected by the auto-mapper, so there is no
need to manually enter it. This is shown by the flightNumber attribute in the following figure.