if (faultAnnotation != null) {
SoapFaultDefinition definition = new SoapFaultDefinition();
if (faultAnnotation.faultCode() != FaultCode.CUSTOM) {
definition.setFaultCode(faultAnnotation.faultCode().value());
}
else if (StringUtils.hasLength(faultAnnotation.customFaultCode())) {
definition.setFaultCode(QName.valueOf(faultAnnotation.customFaultCode()));
}
definition.setFaultStringOrReason(faultAnnotation.faultStringOrReason());
definition.setLocale(StringUtils.parseLocaleString(faultAnnotation.locale()));
return definition;