diff options
Diffstat (limited to 'utils/src/main/java/at/gv/egiz/marshal')
-rw-r--r-- | utils/src/main/java/at/gv/egiz/marshal/MarshallerFactory.java | 15 | ||||
-rw-r--r-- | utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java | 10 |
2 files changed, 11 insertions, 14 deletions
diff --git a/utils/src/main/java/at/gv/egiz/marshal/MarshallerFactory.java b/utils/src/main/java/at/gv/egiz/marshal/MarshallerFactory.java index 3ac0a86e..6cc79ae5 100644 --- a/utils/src/main/java/at/gv/egiz/marshal/MarshallerFactory.java +++ b/utils/src/main/java/at/gv/egiz/marshal/MarshallerFactory.java @@ -20,8 +20,8 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.PropertyException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -29,23 +29,22 @@ import org.apache.commons.logging.LogFactory; */ public class MarshallerFactory { - private static final Log log = LogFactory.getLog(MarshallerFactory.class); - public static Marshaller createMarshaller(JAXBContext ctx, boolean formattedOutput, boolean fragment) throws JAXBException { + Logger log = LoggerFactory.getLogger(MarshallerFactory.class); Marshaller m = ctx.createMarshaller(); try { if (formattedOutput) { - log.trace("setting marshaller property FORMATTED_OUTPUT"); + log.trace("Setting marshaller property FORMATTED_OUTPUT."); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); } if (fragment) { - log.trace("setting marshaller property FRAGMENT"); + log.trace("Setting marshaller property FRAGMENT."); m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE); } - log.trace("setting marshaller property NamespacePrefixMapper"); + log.trace("Setting marshaller property NamespacePrefixMapper."); m.setProperty("com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapperImpl()); } catch (PropertyException ex) { - log.info("failed to set marshaller property: " + ex.getMessage()); + log.info("Failed to set marshaller property: {}.", ex.getMessage()); } return m; } diff --git a/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java b/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java index e0698977..dc2a5c95 100644 --- a/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java +++ b/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java @@ -21,8 +21,8 @@ import java.util.HashMap; import java.util.Map; import com.sun.xml.bind.marshaller.NamespacePrefixMapper; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory; */ public class NamespacePrefixMapperImpl extends NamespacePrefixMapper { - private static final Log log = LogFactory.getLog(NamespacePrefixMapperImpl.class); + private final Logger log = LoggerFactory.getLogger(NamespacePrefixMapperImpl.class); protected static final Map<String, String> prefixMap = new HashMap<String, String>(); @@ -51,9 +51,7 @@ public class NamespacePrefixMapperImpl extends NamespacePrefixMapper { @Override public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) { - if (log.isTraceEnabled()) { - log.trace("prefix for namespace " + namespaceUri + " requested"); - } + log.trace("Prefix for namespace {} reqested.", namespaceUri); String prefix = prefixMap.get(namespaceUri); |