All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jdplus.x13.base.xml.XmlDefaultTradingDaysSpec Maven / Gradle / Ivy

There is a newer version: 3.3.0
Show newest version
/*
 * Copyright 2016 National Bank of Belgium
 * 
 * Licensed under the EUPL, Version 1.1 or – as soon they will be approved 
 * by the European Commission - subsequent versions of the EUPL (the "Licence");
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 * 
 * http://ec.europa.eu/idabc/eupl
 * 
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and 
 * limitations under the Licence.
 */
package jdplus.x13.base.xml;

import jdplus.x13.base.api.regarima.RegressionTestSpec;
import jdplus.x13.base.api.regarima.TradingDaysSpec;
import jdplus.toolkit.base.api.timeseries.calendars.LengthOfPeriodType;
import jdplus.toolkit.base.api.timeseries.calendars.TradingDaysType;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 * 

* Java class for DefaultTradingDaysSpecType complex type. * *

* The following schema fragment specifies the expected content contained within * this class. * *

 * <complexType name="DefaultTradingDaysSpecType">
 *   <complexContent>
 *     <extension base="{ec/eurostat/jdemetra/modelling}DefaultTradingDaysSpecType">
 *       <sequence>
 *         <element name="Test" type="{ec/eurostat/jdemetra/sa/tramoseats}TradingDaysTestEnum" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DefaultTradingDaysSpecType", propOrder = { "autoAdjust" }) public class XmlDefaultTradingDaysSpec extends jdplus.toolkit.base.xml.legacy.modelling.XmlDefaultTradingDaysSpec { @XmlElement(name = "AutoAdjust") protected Boolean autoAdjust; public Boolean getAutoAdjust() { return autoAdjust; } public void setAutoAdjust(Boolean value) { // if (value != null && value) { // autoAdjust = null; // } else { this.autoAdjust = value; // } } public static boolean marshal(TradingDaysSpec v, XmlTradingDaysSpec xml) { if (xml.defaulttd != null) { xml.defaulttd.setCalendar(v.getHolidays()); xml.defaulttd.setTdOption(v.getTradingDaysType()); xml.defaulttd.setLpOption(v.getLengthOfPeriodType()); if (v.getRegressionTestType() != RegressionTestSpec.None) { xml.setTest(v.getRegressionTestType()); } return true; } else { return false; } } public static TradingDaysSpec unmarshal(XmlTradingDaysSpec xml) { if (xml.defaulttd == null) { return null; } if (xml.defaulttd.tdOption == null && xml.defaulttd.lpOption == null) { return TradingDaysSpec.none(); } TradingDaysType td = xml.defaulttd.tdOption == null ? TradingDaysType.NONE : xml.defaulttd.getTdOption(); LengthOfPeriodType lp = xml.defaulttd.lpOption == null ? LengthOfPeriodType.None : xml.defaulttd.getLpOption(); RegressionTestSpec test = xml.test == null ? RegressionTestSpec.None : xml.test; boolean adjust = xml.defaulttd.autoAdjust == null ? false : xml.defaulttd.autoAdjust; if (xml.defaulttd.calendar == null) { return TradingDaysSpec.td(td, lp, test, adjust); } else { return TradingDaysSpec.holidays(xml.defaulttd.calendar, td, lp, test, adjust); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy