reports-service: simple prototype fix

This commit is contained in:
akulikov 2022-09-01 18:32:36 +03:00
parent 38e0bd5790
commit ce1749fe83
2 changed files with 12 additions and 5 deletions

View file

@ -26,6 +26,7 @@
<module>securities-service</module>
<module>utility-service</module>
<module>company-service</module>
<module>reports-service</module>
</modules>
<properties>

View file

@ -6,6 +6,9 @@ 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 {
@ -15,15 +18,18 @@ public class ChildElementForWrite {
@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 = {false}, strings = {"yes", "no"})
@XStreamConverter(value = BooleanConverter.class, booleans = {true}, strings = {"yes", "no"})
private Boolean testYesAttributeBool = Boolean.TRUE;
// @XStreamAlias("booleanField")
// @XStreamConverter(value = BooleanConverter.class, booleans = {true, false}, strings = {"yes", "no"})
// private Boolean testNoFieldBool = Boolean.FALSE;
private Integer testChildInt = Integer.MAX_VALUE;
@XStreamOmitField