@Nullable
private static JavaMethod getGetterMethod(final DomElement element, final DomElement parent) {
final String xmlElementName = element.getXmlElementName();
final String namespace = element.getXmlElementNamespaceKey();
final DomGenericInfo genericInfo = parent.getGenericInfo();
if (element instanceof GenericAttributeValue) {
final DomAttributeChildDescription description = genericInfo.getAttributeChildDescription(xmlElementName, namespace);
assert description != null;
return description.getGetterMethod();
}
final DomFixedChildDescription description = genericInfo.getFixedChildDescription(xmlElementName, namespace);
return description != null ? description.getGetterMethod(description.getValues(parent).indexOf(element)) : null;
}