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:
Denny
2017-12-21 07:18:26 -05:00
parent 47cc194415
commit ee6aeafa84
303 changed files with 3457 additions and 4687 deletions

View File

@@ -17,12 +17,14 @@
******************************************************************************/
package io.github.dsheirer.module.decode.config;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.github.dsheirer.controller.config.Configuration;
import io.github.dsheirer.module.decode.DecoderType;
import javax.xml.bind.annotation.XmlElement;
import java.util.ArrayList;
@JsonSubTypes.Type(value = AuxDecodeConfiguration.class, name = "auxDecodeConfiguration")
public class AuxDecodeConfiguration extends Configuration
{
ArrayList<DecoderType> mAuxDecoders = new ArrayList<DecoderType>();
@@ -31,7 +33,7 @@ public class AuxDecodeConfiguration extends Configuration
{
}
@XmlElement( name="aux_decoder" )
@JacksonXmlProperty(isAttribute = false, localName = "aux_decoder")
public ArrayList<DecoderType> getAuxDecoders()
{
return mAuxDecoders;

View File

@@ -1,22 +1,27 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014 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 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/>
******************************************************************************/
package io.github.dsheirer.module.decode.config;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.github.dsheirer.controller.config.Configuration;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.module.decode.am.DecodeConfigAM;
@@ -27,78 +32,69 @@ import io.github.dsheirer.module.decode.nbfm.DecodeConfigNBFM;
import io.github.dsheirer.module.decode.p25.DecodeConfigP25Phase1;
import io.github.dsheirer.module.decode.passport.DecodeConfigPassport;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
@XmlSeeAlso( { DecodeConfigAM.class,
DecodeConfigNBFM.class,
DecodeConfigLTRNet.class,
DecodeConfigLTRStandard.class,
DecodeConfigMPT1327.class,
DecodeConfigPassport.class,
DecodeConfigP25Phase1.class } )
@XmlRootElement( name = "decode_configuration" )
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = DecodeConfigAM.class, name = "decodeConfigAM"),
@JsonSubTypes.Type(value = DecodeConfigLTRNet.class, name = "decodeConfigLTRNet"),
@JsonSubTypes.Type(value = DecodeConfigLTRStandard.class, name = "decodeConfigLTRStandard"),
@JsonSubTypes.Type(value = DecodeConfigMPT1327.class, name = "decodeConfigMPT1327"),
@JsonSubTypes.Type(value = DecodeConfigNBFM.class, name = "decodeConfigNBFM"),
@JsonSubTypes.Type(value = DecodeConfigP25Phase1.class, name = "decodeConfigP25Phase1"),
@JsonSubTypes.Type(value = DecodeConfigPassport.class, name = "decodeConfigPassport")
})
@JacksonXmlRootElement(localName = "decode_configuration")
public abstract class DecodeConfiguration extends Configuration
{
public static final int DEFAULT_CALL_TIMEOUT_SECONDS = 45;
public static final int CALL_TIMEOUT_MINIMUM = 1;
public static final int CALL_TIMEOUT_MAXIMUM = 300; //5 minutes
public static final int TRAFFIC_CHANNEL_LIMIT_DEFAULT = 3;
public static final int TRAFFIC_CHANNEL_LIMIT_MINIMUM = 0;
public static final int TRAFFIC_CHANNEL_LIMIT_MAXIMUM = 30;
public static final int DEFAULT_CALL_TIMEOUT_SECONDS = 45;
public static final int CALL_TIMEOUT_MINIMUM = 1;
public static final int CALL_TIMEOUT_MAXIMUM = 300; //5 minutes
public static final int DEFAULT_AFC_MAX_CORRECTION = 1000;
private DecoderType mDecoderType = DecoderType.NBFM;
private boolean mAFCEnabled = true;
private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION;
public static final int TRAFFIC_CHANNEL_LIMIT_DEFAULT = 3;
public static final int TRAFFIC_CHANNEL_LIMIT_MINIMUM = 0;
public static final int TRAFFIC_CHANNEL_LIMIT_MAXIMUM = 30;
public DecodeConfiguration()
{
this( DecoderType.NBFM );
}
public DecodeConfiguration( DecoderType type )
{
mDecoderType = type;
}
public static final int DEFAULT_AFC_MAX_CORRECTION = 1000;
public DecoderType getDecoderType()
{
return mDecoderType;
}
private boolean mAFCEnabled = true;
private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION;
@XmlAttribute( name = "afc" )
public boolean getAFC()
{
return mAFCEnabled;
}
public boolean isAFCEnabled()
{
return mAFCEnabled;
}
public void setAFC( boolean enabled )
{
mAFCEnabled = enabled;
}
@XmlAttribute( name = "AFCMaximumCorrection" )
public int getAFCMaximumCorrection()
{
return mAFCMaxCorrection;
}
public void setAFCMaximumCorrection( int max )
{
mAFCMaxCorrection = max;
}
public boolean supportsAFC()
{
return true;
}
public DecodeConfiguration()
{
}
@JsonIgnore
public abstract DecoderType getDecoderType();
@JacksonXmlProperty(isAttribute = true, localName = "afc")
public boolean getAFC()
{
return mAFCEnabled;
}
@JsonIgnore
public boolean isAFCEnabled()
{
return mAFCEnabled;
}
public void setAFC(boolean enabled)
{
mAFCEnabled = enabled;
}
@JacksonXmlProperty(isAttribute = true, localName = "AFCMaximumCorrection")
public int getAFCMaximumCorrection()
{
return mAFCMaxCorrection;
}
public void setAFCMaximumCorrection(int max)
{
mAFCMaxCorrection = max;
}
public boolean supportsAFC()
{
return true;
}
}