private void validateField(final Object object, final ValidationContext context,
final XMLFieldDescriptor fieldDescriptor) throws ValidationException {
FieldValidator fieldValidator = fieldDescriptor.getValidator();
if (fieldValidator != null) {
try {
fieldValidator.validate(object, context);
} catch (ValidationException e) {
if (fieldDescriptor.getNodeType() == NodeType.Attribute
|| fieldDescriptor.getNodeType() == NodeType.Element) {
addLocationInformation(fieldDescriptor, e);
}