deprecate old reports
This commit is contained in:
parent
b59597bc7b
commit
0e58782a4c
53 changed files with 48 additions and 339 deletions
|
|
@ -10,6 +10,7 @@ import java.time.format.DateTimeFormatter;
|
|||
/**
|
||||
* Общая шапка (атрибуты) для всех отчетов
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class AbstractReport {
|
||||
protected static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy");
|
||||
protected static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("dd.MM.yyyy'T'HH:mm:ss");
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import ru.spcex.platform.utils.enumeration.IEnumKey;
|
|||
/**
|
||||
* Идентификаторы отчётов
|
||||
*/
|
||||
// todo create new ID
|
||||
@Deprecated
|
||||
public enum ReportId implements IEnumKey {
|
||||
PA_B("REPPA.B"), PA_IV("REPPA.IV"),
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
|||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Deprecated
|
||||
public abstract class ReportWithClearingStatus extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("clearingStatus")
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.time.LocalDate;
|
|||
/**
|
||||
* Шапка для отчётов, содержащих startDate и endDate
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class ReportWithPeriod extends AbstractReport {
|
||||
|
||||
@XStreamAsAttribute
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("netPositionBank")
|
||||
@Deprecated
|
||||
public class ReportPA_B extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("clearingMemberCategory")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("netPositionInitiator")
|
||||
@Deprecated
|
||||
public class ReportPA_IV extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("clearingMemberCategory")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("incomingDocuments")
|
||||
@Deprecated
|
||||
public class ReportDOCIN extends AbstractReport {
|
||||
/**
|
||||
* Дата в формате: dd.MM.yyyy
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("incomingDocuments")
|
||||
@Deprecated
|
||||
public class ReportDOCOUT extends AbstractReport {
|
||||
/**
|
||||
* Дата в формате: dd.MM.yyyy
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("accountBalanceInfo")
|
||||
@Deprecated
|
||||
public class ReportINACCNT extends AbstractReport {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("clearingMemberCategory")
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearedLiabilities")
|
||||
@Deprecated
|
||||
public class ReportBR_0420315_P1 extends ReportWithClearingStatus {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.time.LocalDate;
|
|||
import java.time.LocalDateTime;
|
||||
|
||||
@XStreamAlias("clearedLiabilitiesTotal")
|
||||
@Deprecated
|
||||
public class ReportBR_0420315_P2 extends ReportWithPeriod {
|
||||
@XStreamAlias("rows")
|
||||
private Info_0420315_P2 rows;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingServiceStatus")
|
||||
@Deprecated
|
||||
public class ReportBR_0420317 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("unfundedLiabilities")
|
||||
@Deprecated
|
||||
public class ReportBR_0420318 extends ReportWithClearingStatus {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("accountTransactionLiabilities")
|
||||
@Deprecated
|
||||
public class ReportBR_0420314_P1 extends ReportWithClearingStatus {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("accountTransactionTurnover")
|
||||
@Deprecated
|
||||
public class ReportBR_0420314_P2 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage1")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P1 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage10")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P10 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage2")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P2 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage3")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P3 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage4")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P4 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage5")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P5 extends ReportWithPeriod {
|
||||
|
||||
@XStreamAsAttribute
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage6")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P6 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage7")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P7 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage8")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P8 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
@XStreamAlias("clearingCoverage9")
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P9 extends ReportWithPeriod {
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("destination")
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import ru.spcex.clearing.reports.reports.AbstractReport;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@Deprecated
|
||||
public abstract class FileReportBuilder {
|
||||
protected final Class<? extends AbstractReport> reportClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import java.io.FileOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Deprecated
|
||||
public class XMLReportBuilder extends FileReportBuilder {
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
protected final XStream xStream;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.Set;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportPA_B_Collector extends ReportWithPeriodCollector<ReportPA_B> {
|
||||
private final Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
private final Imdg<ClearingMemberCategory> clearingMemberCategoryImdg;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.Set;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportPA_IV_Collector extends ReportWithPeriodCollector<ReportPA_IV> {
|
||||
private final Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
private final Imdg<ClearingStatusDictionary> clearingStatusDictionaryImdg;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import java.time.LocalTime;
|
|||
import java.util.Collection;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportDOCIN_Collector extends SimpleReportCollector<ReportDOCIN> {
|
||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import java.time.LocalTime;
|
|||
import java.util.Collection;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportDOCOUT_Collector extends SimpleReportCollector<ReportDOCOUT> {
|
||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import java.util.Set;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportINACCNT_Collector extends ReportForClearingCodeCollector<ReportINACCNT> {
|
||||
private final Imdg<AccountBalance> accountBalanceImdg;
|
||||
private final Imdg<Company> companyImdg;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.time.LocalDate;
|
|||
import java.util.*;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420315_P1_Collector extends ReportWithPeriodCollector<ReportBR_0420315_P1> {
|
||||
protected static final List<String> ALLOW_CLEARING_MEMBER_CATEGORY = Arrays.asList(ClearingCategory.I.getKey(), ClearingCategory.V.getKey());
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import java.util.Collection;
|
|||
import java.util.HashSet;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420315_P2_collector extends ReportWithPeriodCollector<ReportBR_0420315_P2> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.Collection;
|
|||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420317_Collector extends ReportWithPeriodCollector<ReportBR_0420317> {
|
||||
private Imdg<Company> companyImdg;
|
||||
private Imdg<Relation> relationImdg;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420318_Collector extends ReportWithPeriodCollector<ReportBR_0420318> {
|
||||
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import java.util.Map;
|
|||
* accountTransactionLiabilities
|
||||
*/
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420314_P1_Collector extends ReportWithPeriodCollector<ReportBR_0420314_P1> {
|
||||
private Imdg<Company> companyImdg;
|
||||
private Imdg<CompanySymbols> companySymbolsImdg;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import java.util.Objects;
|
|||
* accountTransactionLiabilities
|
||||
*/
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420314_P2_Collector extends ReportWithPeriodCollector<ReportBR_0420314_P2> {
|
||||
private Imdg<Company> companyImdg;
|
||||
private Imdg<PaymentInstruction> paymentInstructionImdg;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.Collection;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P10_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P10> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P1_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P1> {
|
||||
private final Imdg<Company> companyImdg;
|
||||
private final Imdg<CompanySymbols> companySymbolsImdg;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P2_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P2> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P3_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P3> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.Collection;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P4_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P4> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.Collection;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P5_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P5> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.Collection;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P6_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P6> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.Collection;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P7_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P7> {
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P8_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P8> {
|
||||
private Imdg<Company> companyImdg;
|
||||
private Imdg<CompanySymbols> companySymbolsImdg;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.Map;
|
|||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Deprecated
|
||||
public class ReportBR_0420312_P9_Collector extends ReportWithPeriodCollector<ReportBR_0420312_P9> {
|
||||
private Imdg<Company> companyImdg;
|
||||
private Imdg<LiabilitiesClaimsAssets> liabilitiesClaimsAssetsImdg;
|
||||
|
|
|
|||
|
|
@ -1,80 +0,0 @@
|
|||
package ru.spcex.clearing.reports.xml_test;
|
||||
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamConverter;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import com.thoughtworks.xstream.converters.basic.BooleanConverter;
|
||||
import com.thoughtworks.xstream.converters.basic.DateConverter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
// without aliases
|
||||
public class ChildElementForWrite {
|
||||
@XStreamAlias("childStr") // alias for field name
|
||||
private String testChildString = "testChildStr";
|
||||
|
||||
@XStreamAsAttribute
|
||||
private Integer testAttributeInt = Integer.MIN_VALUE;
|
||||
|
||||
// при использовании настраевомого встроенного конвертора, ему необходимо передать параметры в конструктор
|
||||
// делается это посредством параметров strings, booleans, nulls.
|
||||
// т.е. такая запись эквивалентна:
|
||||
// new DateConverter("MM-yyyy-dd", null)
|
||||
@XStreamConverter(value = DateConverter.class, strings = {"MM-yyyy-dd"}, nulls = {String[].class})
|
||||
private Date testDate = new Date();
|
||||
|
||||
@XStreamAsAttribute
|
||||
@XStreamAlias("isBoolean")
|
||||
@XStreamConverter(value = BooleanConverter.class, booleans = {true}, strings = {"yes", "no"})
|
||||
private Boolean testYesAttributeBool = Boolean.TRUE;
|
||||
|
||||
private Integer testChildInt = Integer.MAX_VALUE;
|
||||
|
||||
@XStreamOmitField
|
||||
private String testIgnoredString = "testIgnore";
|
||||
|
||||
|
||||
|
||||
public String getTestChildString() {
|
||||
return testChildString;
|
||||
}
|
||||
|
||||
public void setTestChildString(String testChildString) {
|
||||
this.testChildString = testChildString;
|
||||
}
|
||||
|
||||
public Integer getTestAttributeInt() {
|
||||
return testAttributeInt;
|
||||
}
|
||||
|
||||
public void setTestAttributeInt(Integer testAttributeInt) {
|
||||
this.testAttributeInt = testAttributeInt;
|
||||
}
|
||||
|
||||
public Integer getTestChildInt() {
|
||||
return testChildInt;
|
||||
}
|
||||
|
||||
public void setTestChildInt(Integer testChildInt) {
|
||||
this.testChildInt = testChildInt;
|
||||
}
|
||||
|
||||
public String getTestIgnoredString() {
|
||||
return testIgnoredString;
|
||||
}
|
||||
|
||||
public void setTestIgnoredString(String testIgnoredString) {
|
||||
this.testIgnoredString = testIgnoredString;
|
||||
}
|
||||
|
||||
public Boolean getTestYesAttributeBool() {
|
||||
return testYesAttributeBool;
|
||||
}
|
||||
|
||||
public void setTestYesAttributeBool(Boolean testYesAttributeBool) {
|
||||
this.testYesAttributeBool = testYesAttributeBool;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
package ru.spcex.clearing.reports.xml_test;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
|
||||
@XStreamAlias("withAttrsOnly")
|
||||
public class ElementWithAttributeOnly {
|
||||
@XStreamAsAttribute
|
||||
private String attrStr = "attrStr";
|
||||
|
||||
@XStreamAsAttribute
|
||||
private Long attrLong = Long.MIN_VALUE;
|
||||
|
||||
public String getAttrStr() {
|
||||
return attrStr;
|
||||
}
|
||||
|
||||
public void setAttrStr(String attrStr) {
|
||||
this.attrStr = attrStr;
|
||||
}
|
||||
|
||||
public Long getAttrLong() {
|
||||
return attrLong;
|
||||
}
|
||||
|
||||
public void setAttrLong(Long attrLong) {
|
||||
this.attrLong = attrLong;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
package ru.spcex.clearing.reports.xml_test;
|
||||
|
||||
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Objects;
|
||||
|
||||
public class FormattedLocalDateConverter extends AbstractSingleValueConverter {
|
||||
private final String DEFAULT_PATTERN = "dd.MM.yyyy";
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
public FormattedLocalDateConverter() {
|
||||
formatter = DateTimeFormatter.ofPattern(DEFAULT_PATTERN);
|
||||
}
|
||||
|
||||
public FormattedLocalDateConverter(String pattern) {
|
||||
formatter = DateTimeFormatter.ofPattern(Objects.requireNonNullElse(pattern, DEFAULT_PATTERN));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConvert(Class type) {
|
||||
return LocalDate.class.isAssignableFrom(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object fromString(String str) {
|
||||
// not implemented (not used)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(Object obj) {
|
||||
LocalDate date = (LocalDate) obj;
|
||||
return date != null ? formatter.format(date) : "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
package ru.spcex.clearing.reports.xml_test;
|
||||
|
||||
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Objects;
|
||||
|
||||
public class FormattedLocalTimeConverter extends AbstractSingleValueConverter {
|
||||
private final String DEFAULT_PATTERN = "HH:mm:ss";
|
||||
private final DateTimeFormatter formatter;
|
||||
|
||||
public FormattedLocalTimeConverter() {
|
||||
formatter = DateTimeFormatter.ofPattern(DEFAULT_PATTERN);
|
||||
}
|
||||
|
||||
public FormattedLocalTimeConverter(String pattern) {
|
||||
formatter = DateTimeFormatter.ofPattern(Objects.requireNonNullElse(pattern, DEFAULT_PATTERN));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConvert(Class type) {
|
||||
return LocalTime.class.isAssignableFrom(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object fromString(String str) {
|
||||
// not implemented (not used)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(Object obj) {
|
||||
LocalTime date = (LocalTime) obj;
|
||||
return date != null ? formatter.format(date) : "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
package ru.spcex.clearing.reports.xml_test;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamConverter;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@XStreamAlias("root") // alias for classname
|
||||
public class RootElementForWrite {
|
||||
|
||||
@XStreamAlias("string") // alias for field
|
||||
private String testString = "testString";
|
||||
|
||||
private BigDecimal testBigDecimal = new BigDecimal("666.666");
|
||||
|
||||
private Double testDouble = Double.MAX_VALUE;
|
||||
|
||||
private Long testLong = Long.MIN_VALUE;
|
||||
|
||||
private Boolean testBoolean = Boolean.FALSE;
|
||||
|
||||
private LocalDate testLocalDateDefault = LocalDate.now();
|
||||
|
||||
@XStreamConverter(FormattedLocalDateConverter.class)
|
||||
private LocalDate testLocalDateCustom = LocalDate.now();
|
||||
|
||||
private LocalDateTime testLocalDateTime = LocalDateTime.now();
|
||||
|
||||
private OffsetDateTime testOffsetDateTime = OffsetDateTime.now();
|
||||
|
||||
private Instant testInstant = Instant.now();
|
||||
|
||||
@XStreamAlias("namedList")
|
||||
private List<ChildElementForWrite> testList = new ArrayList<>();
|
||||
|
||||
@XStreamImplicit
|
||||
private List<ChildElementForWrite> testListTwo = Arrays.asList(new ChildElementForWrite(), new ChildElementForWrite());
|
||||
|
||||
// can marshal without getter/setter
|
||||
private ElementWithAttributeOnly elementWithAttributeOnly = new ElementWithAttributeOnly();
|
||||
|
||||
public String getTestString() {
|
||||
return testString;
|
||||
}
|
||||
|
||||
public void setTestString(String testString) {
|
||||
this.testString = testString;
|
||||
}
|
||||
|
||||
public BigDecimal getTestBigDecimal() {
|
||||
return testBigDecimal;
|
||||
}
|
||||
|
||||
public void setTestBigDecimal(BigDecimal testBigDecimal) {
|
||||
this.testBigDecimal = testBigDecimal;
|
||||
}
|
||||
|
||||
public Double getTestDouble() {
|
||||
return testDouble;
|
||||
}
|
||||
|
||||
public void setTestDouble(Double testDouble) {
|
||||
this.testDouble = testDouble;
|
||||
}
|
||||
|
||||
public Long getTestLong() {
|
||||
return testLong;
|
||||
}
|
||||
|
||||
public void setTestLong(Long testLong) {
|
||||
this.testLong = testLong;
|
||||
}
|
||||
|
||||
public Boolean getTestBoolean() {
|
||||
return testBoolean;
|
||||
}
|
||||
|
||||
public void setTestBoolean(Boolean testBoolean) {
|
||||
this.testBoolean = testBoolean;
|
||||
}
|
||||
|
||||
public LocalDate getTestLocalDate() {
|
||||
return testLocalDateCustom;
|
||||
}
|
||||
|
||||
public void setTestLocalDate(LocalDate testLocalDate) {
|
||||
this.testLocalDateCustom = testLocalDate;
|
||||
}
|
||||
|
||||
public LocalDateTime getTestLocalDateTime() {
|
||||
return testLocalDateTime;
|
||||
}
|
||||
|
||||
public void setTestLocalDateTime(LocalDateTime testLocalDateTime) {
|
||||
this.testLocalDateTime = testLocalDateTime;
|
||||
}
|
||||
|
||||
public OffsetDateTime getTestOffsetDateTime() {
|
||||
return testOffsetDateTime;
|
||||
}
|
||||
|
||||
public void setTestOffsetDateTime(OffsetDateTime testOffsetDateTime) {
|
||||
this.testOffsetDateTime = testOffsetDateTime;
|
||||
}
|
||||
|
||||
public Instant getTestInstant() {
|
||||
return testInstant;
|
||||
}
|
||||
|
||||
public void setTestInstant(Instant testInstant) {
|
||||
this.testInstant = testInstant;
|
||||
}
|
||||
|
||||
public List<ChildElementForWrite> getTestList() {
|
||||
return testList;
|
||||
}
|
||||
|
||||
public void setTestList(List<ChildElementForWrite> testList) {
|
||||
this.testList = testList;
|
||||
}
|
||||
|
||||
public List<ChildElementForWrite> getTestListTwo() {
|
||||
return testListTwo;
|
||||
}
|
||||
|
||||
public void setTestListTwo(List<ChildElementForWrite> testListTwo) {
|
||||
this.testListTwo = testListTwo;
|
||||
}
|
||||
|
||||
public LocalDate getTestLocalDateDefault() {
|
||||
return testLocalDateDefault;
|
||||
}
|
||||
|
||||
public void setTestLocalDateDefault(LocalDate testLocalDateDefault) {
|
||||
this.testLocalDateDefault = testLocalDateDefault;
|
||||
}
|
||||
|
||||
public LocalDate getTestLocalDateCustom() {
|
||||
return testLocalDateCustom;
|
||||
}
|
||||
|
||||
public void setTestLocalDateCustom(LocalDate testLocalDateCustom) {
|
||||
this.testLocalDateCustom = testLocalDateCustom;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Reference in a new issue