diff options
author | mcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2010-05-05 15:29:01 +0000 |
---|---|---|
committer | mcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2010-05-05 15:29:01 +0000 |
commit | b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd (patch) | |
tree | 0883f08a408f89f758e9a1be629232e3dd055c3a /utils/src/main/java/at/gv/egiz/marshal | |
parent | 83a9b613836910f7edc370c2fe60fa2268dc4461 (diff) | |
download | mocca-b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd.tar.gz mocca-b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd.tar.bz2 mocca-b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd.zip |
Merged feature branch mocca-1.2.13-id@r724 back to trunk.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@725 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
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); |