assertEquals("The setter method must be declared in the same class than the " +
"getter method - not in a parent class, to avoid issues with JAXB.",
getter.getDeclaringClass(), setter.getDeclaringClass());
assertEquals("The setter parameter type shall be the same than the getter return type.",
getter.getReturnType(), getSingleton(setter.getParameterTypes()));
final XmlElement element = getter.getAnnotation(XmlElement.class);
assertEquals("Expected @XmlElement XOR @XmlElementRef.", (element == null),
getter.isAnnotationPresent(XmlElementRef.class));
/*
* If the annotation is @XmlElement, ensure that XmlElement.name() is equals to
* the UML identifier. Then verify that the
*/
if (element != null) {
assertFalse("Expected @XmlElementRef.", wrapper.isInherited);
final UML uml = type.getAnnotation(UML.class);
if (uml != null) { // 'assertNotNull' is 'testInterfaceAnnotations()' job.
assertEquals("Wrong @XmlElement.", uml.identifier(), element.name());
}
final String namespace = assertExpectedNamespace(element.namespace(), wrapper.type, uml);
if (!CodeList.class.isAssignableFrom(type)) {
final String expected = getNamespace(getImplementation(type));
if (expected != null) { // 'assertNotNull' is 'testImplementationAnnotations()' job.
assertEquals("Inconsistent @XmlRootElement namespace.", expected, namespace);
}