/*
- * Copyright (c) 2015. Developed by Hedgecode.
+ * Copyright (c) 2015-2019. Developed by Hedgecode.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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()
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,