* In some contexts (such as an association mapping) merging with
* annotations is never allowed.
*/
private AttributeOverrides mergeAttributeOverrides(XMLContext.Default defaults, List<AttributeOverride> attributes, boolean mergeWithAnnotations) {
if ( mergeWithAnnotations && defaults.canUseJavaAnnotations() ) {
AttributeOverride annotation = getJavaAnnotation( AttributeOverride.class );
addAttributeOverrideIfNeeded( annotation, attributes );
AttributeOverrides annotations = getJavaAnnotation( AttributeOverrides.class );
if ( annotations != null ) {
for ( AttributeOverride current : annotations.value() ) {
addAttributeOverrideIfNeeded( current, attributes );