[LIB-4] Transition to typed properties
[hespiff.git] / src / main / java / org / hedgecode / xml / xspf / XMLBindPlaylist.java
index 0ae5a5c..d554207 100644 (file)
@@ -166,9 +166,7 @@ public class XMLBindPlaylist extends AbstractXMLBindElement implements Playlist
     public String getAsString()
             throws JAXBException, UnsupportedEncodingException
     {
-        Charset charset = (Charset) Properties.getProperty(
-                Properties.CHARSET, Charset.class
-        );
+        Charset charset = XSPFProperties.getCharset();
         ByteArrayOutputStream os = (ByteArrayOutputStream) getAsStream();
         return os.toString(
                 charset.name()
@@ -178,17 +176,16 @@ public class XMLBindPlaylist extends AbstractXMLBindElement implements Playlist
     private Marshaller createMarshaller(Class xmlRootClass) throws JAXBException {
         JAXBContext jaxbContext = JAXBContext.newInstance(xmlRootClass);
         Marshaller marshaller = jaxbContext.createMarshaller();
-        Charset charset = (Charset) Properties.getProperty(Properties.CHARSET, Charset.class);
+        Charset charset = XSPFProperties.getCharset();
         marshaller.setProperty(
                 Marshaller.JAXB_ENCODING,
                 charset.name()
         );
         marshaller.setProperty(
                 Marshaller.JAXB_FORMATTED_OUTPUT,
-                Properties.getProperty(Properties.FORMATTED, Boolean.class)
+                XSPFProperties.getBoolean(XSPFProperties.FORMATTED)
         );
-        Object standalone = Properties.getProperty(Properties.STANDALONE, Boolean.class);
-        if (Boolean.FALSE.equals(standalone)) {
+        if (Boolean.FALSE.equals(XSPFProperties.getBoolean(XSPFProperties.STANDALONE))) {
             marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
             marshaller.setProperty(
                     XSPFConstants.XML_HEADER_NAME,