mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Updates PlaylistManager to use faster jackson XML serialization.
Removes native xml.bind serialization for improved compatibility with Java 9. Global optimize imports on the entire project.
This commit is contained in:
@@ -18,15 +18,15 @@
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.icon;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
@XmlRootElement(name = "icon")
|
||||
@JacksonXmlRootElement(localName = "icon")
|
||||
public class Icon implements Comparable<Icon>
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(Icon.class);
|
||||
@@ -46,7 +46,7 @@ public class Icon implements Comparable<Icon>
|
||||
mPath = path;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "name")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "name")
|
||||
public String getName()
|
||||
{
|
||||
return mName;
|
||||
@@ -62,7 +62,7 @@ public class Icon implements Comparable<Icon>
|
||||
return mName;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "path")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "path")
|
||||
public String getPath()
|
||||
{
|
||||
return mPath;
|
||||
@@ -73,7 +73,7 @@ public class Icon implements Comparable<Icon>
|
||||
mPath = path;
|
||||
}
|
||||
|
||||
@XmlTransient
|
||||
@JsonIgnore
|
||||
public ImageIcon getIcon()
|
||||
{
|
||||
if(mImageIcon == null && mPath != null)
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
/*******************************************************************************
|
||||
/*
|
||||
* *********************************************************************************************************************
|
||||
* sdrtrunk
|
||||
* Copyright (C) 2014-2017 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
******************************************************************************/
|
||||
* You should have received a copy of the GNU General Public License along with this program.
|
||||
* If not, see <http://www.gnu.org/licenses/>
|
||||
* *********************************************************************************************************************
|
||||
*/
|
||||
package io.github.dsheirer.icon;
|
||||
|
||||
import io.github.dsheirer.properties.SystemProperties;
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.icon;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@XmlRootElement(name="iconset")
|
||||
@JacksonXmlRootElement(localName = "iconset")
|
||||
public class IconSet
|
||||
{
|
||||
private String mDefaultIcon;
|
||||
@@ -45,7 +45,7 @@ public class IconSet
|
||||
mIcons.remove(icon);
|
||||
}
|
||||
|
||||
@XmlElement(name = "icon")
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "icon")
|
||||
public List<Icon> getIcons()
|
||||
{
|
||||
if(mIcons == null)
|
||||
@@ -61,7 +61,7 @@ public class IconSet
|
||||
mIcons = icons;
|
||||
}
|
||||
|
||||
@XmlAttribute(name = "default")
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "default")
|
||||
public String getDefaultIcon()
|
||||
{
|
||||
return mDefaultIcon;
|
||||
|
||||
Reference in New Issue
Block a user