Annotation Interface PluralOf
XmlElement annotation
on it
The rules for determining the singular form of the element name is the following:
- Remove the get or set from the method name. The remainder is the element name
- decapitalize the element name
- If the element name has more than one letter and ends in "s", remove the "s"
- The remainder is the singular of the element name
For example, if the method name is getDoctors, the singular element name will be "doctor". In that case the adder method will be addDoctor, the remover method will be removeDoctor and the lookup method will be lookupDoctor. In some cases the singular of a word is the same as the plural. If that word does not end in s the default behavior works fine. For example if the method name is getMoose, the singular element name will be "moose". The adder method will be addMoose and so on.
In cases that do not conform to the above rule this annotation is provided, which allows the
user to specify what this element name is the plural of. For example, if the method
name is getMice then this annotation should be used:
VPluralOf("mouse")
In this case the adder method will become addMouse, the remover will be removeMouse and the
lookup will be lookupMouse.
This annotation can also be used to specify the exact method name that should be used for the adder, remover and lookup. If those fields are filled in the will override the algorithm for determining the singular for this element name.
- Author:
- jwells
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionReturns the exact name of the method that should be used as the adder for this elementReturns the exact name of the method that should be used as the lookkup for this elementReturns the exact name of the method that should be used as the remover for this elementReturns the singular of the element name described by this setter or getter method. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis value is used to indicate that the normal algorithm should be used for determining the singular of the element name
-
Field Details
-
USE_NORMAL_PLURAL_PATTERN
This value is used to indicate that the normal algorithm should be used for determining the singular of the element name- See Also:
-
-
Element Details
-
value
String valueReturns the singular of the element name described by this setter or getter method. This name should be fully capitalized as it should appear after the "add", "remove" or "lookup" in the method name.For example, if this is returning the singular for "mice", it should return "Mouse".
- Returns:
- The singular of the element name, or
USE_NORMAL_PLURAL_PATTERNif the normal algorithm should be applied
- Default:
- "*"
-
add
String addReturns the exact name of the method that should be used as the adder for this element- Returns:
- The exact name of the method that should be
used as the adder for this element, or
USE_NORMAL_PLURAL_PATTERNif the normal algorithm should be used (as modified by thevalue()method)
- Default:
- "*"
-
remove
String removeReturns the exact name of the method that should be used as the remover for this element- Returns:
- The exact name of the method that should be
used as the remover for this element, or
USE_NORMAL_PLURAL_PATTERNif the normal algorithm should be used (as modified by thevalue()method)
- Default:
- "*"
-
lookup
String lookupReturns the exact name of the method that should be used as the lookkup for this element- Returns:
- The exact name of the method that should be
used as the lookup for this element, or
USE_NORMAL_PLURAL_PATTERNif the normal algorithm should be used (as modified by thevalue()method)
- Default:
- "*"
-