SPR-5634 - OXM does not permit targetClass and mapping file for CastorMarshaller

This commit is contained in:
Arjen Poutsma
2009-04-22 12:08:57 +00:00
parent de18d64b5c
commit c1667687d5
4 changed files with 77 additions and 16 deletions

View File

@@ -183,18 +183,14 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
public final void afterPropertiesSet() throws CastorMappingException, IOException {
if (this.mappingLocations != null && this.targetClass != null) {
throw new IllegalArgumentException("Cannot set both the 'mappingLocations' and 'targetClass' property. " +
"Set 'targetClass' for unmarshalling a single class, and 'mappingLocations' for multiple classes.");
}
if (logger.isInfoEnabled()) {
if (this.mappingLocations != null) {
logger.info("Configured using " + StringUtils.arrayToCommaDelimitedString(this.mappingLocations));
}
else if (this.targetClass != null) {
if (this.targetClass != null) {
logger.info("Configured for target class [" + this.targetClass.getName() + "]");
}
else {
if (this.mappingLocations == null && this.targetClass == null) {
logger.info("Using default configuration");
}
}