Skip to content

Commit

Permalink
Improve javadoc and reduce scope to package private for jaxb classes
Browse files Browse the repository at this point in the history
  • Loading branch information
derTobsch committed Dec 21, 2024
1 parent 34f08a5 commit 4cd50b9
Show file tree
Hide file tree
Showing 14 changed files with 471 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import static de.focus_shift.jollyday.jaxb.mapping.ChronologyType.JULIAN;
import static java.util.stream.Collectors.toList;


public class JaxbChristianHoliday implements ChristianHoliday {
/**
* {@inheritDoc}
*/
class JaxbChristianHoliday implements ChristianHoliday {

private final de.focus_shift.jollyday.jaxb.mapping.ChristianHoliday christianHoliday;

public JaxbChristianHoliday(de.focus_shift.jollyday.jaxb.mapping.ChristianHoliday christianHoliday) {
JaxbChristianHoliday(de.focus_shift.jollyday.jaxb.mapping.ChristianHoliday christianHoliday) {
this.christianHoliday = christianHoliday;
}

Expand All @@ -29,46 +31,81 @@ public ChristianHolidayType type() {
return ChristianHolidayType.valueOf(christianHoliday.getType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Chronology chronology() {
return christianHoliday.getChronology() == JULIAN
? JulianChronology.INSTANCE
: IsoChronology.INSTANCE;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public String descriptionPropertiesKey() {
return christianHoliday.getDescriptionPropertiesKey();
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public HolidayType officiality() {
return christianHoliday.getLocalizedType() == null
? HolidayType.PUBLIC_HOLIDAY
: HolidayType.valueOf(christianHoliday.getLocalizedType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validFrom() {
return christianHoliday.getValidFrom() == null
? null
: Year.of(christianHoliday.getValidFrom());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validTo() {
return christianHoliday.getValidTo() == null
? null
: Year.of(christianHoliday.getValidTo());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public YearCycle cycle() {
return christianHoliday.getEvery() == null
? YearCycle.EVERY_YEAR
: YearCycle.valueOf(christianHoliday.getEvery().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public List<MovingCondition> conditions() {
return christianHoliday.getMovingCondition().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

import java.util.stream.Stream;


public class JaxbConfiguration implements Configuration {
/**
* {@inheritDoc}
*/
class JaxbConfiguration implements Configuration {

private final de.focus_shift.jollyday.jaxb.mapping.Configuration xmlConfiguration;

public JaxbConfiguration(de.focus_shift.jollyday.jaxb.mapping.Configuration xmlConfiguration) {
JaxbConfiguration(de.focus_shift.jollyday.jaxb.mapping.Configuration xmlConfiguration) {
this.xmlConfiguration = xmlConfiguration;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
import java.io.InputStream;
import java.net.URL;


/**
* {@inheritDoc}
*/
public class JaxbConfigurationService implements ConfigurationService {

private static final XMLUtil xmlUtil = new XMLUtil();

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Configuration getConfiguration(ManagerParameter parameter) {
final URL resourceUrl = parameter.createResourceUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,78 @@

import java.time.Year;

public class JaxbEthiopianOrthodoxHoliday implements EthiopianOrthodoxHoliday {
/**
* {@inheritDoc}
*/
class JaxbEthiopianOrthodoxHoliday implements EthiopianOrthodoxHoliday {

private final de.focus_shift.jollyday.jaxb.mapping.EthiopianOrthodoxHoliday ethiopianOrthodoxHoliday;

public JaxbEthiopianOrthodoxHoliday(de.focus_shift.jollyday.jaxb.mapping.EthiopianOrthodoxHoliday ethiopianOrthodoxHoliday) {
JaxbEthiopianOrthodoxHoliday(de.focus_shift.jollyday.jaxb.mapping.EthiopianOrthodoxHoliday ethiopianOrthodoxHoliday) {
this.ethiopianOrthodoxHoliday = ethiopianOrthodoxHoliday;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public String descriptionPropertiesKey() {
return ethiopianOrthodoxHoliday.getDescriptionPropertiesKey();
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public HolidayType officiality() {
return ethiopianOrthodoxHoliday.getLocalizedType() == null
? HolidayType.PUBLIC_HOLIDAY
: HolidayType.valueOf(ethiopianOrthodoxHoliday.getLocalizedType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public EthiopianOrthodoxHolidayType type() {
return EthiopianOrthodoxHolidayType.valueOf(ethiopianOrthodoxHoliday.getType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validFrom() {
return ethiopianOrthodoxHoliday.getValidFrom() == null
? null
: Year.of(ethiopianOrthodoxHoliday.getValidFrom());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validTo() {
return ethiopianOrthodoxHoliday.getValidTo() == null
? null
: Year.of(ethiopianOrthodoxHoliday.getValidTo());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public YearCycle cycle() {
return ethiopianOrthodoxHoliday.getEvery() == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,79 @@

import static java.util.stream.Collectors.toList;


public class JaxbFixed implements Fixed {
/**
* {@inheritDoc}
*/
class JaxbFixed implements Fixed {

private final XMLUtil xmlUtil = new XMLUtil();

private final de.focus_shift.jollyday.jaxb.mapping.Fixed fixed;

public JaxbFixed(de.focus_shift.jollyday.jaxb.mapping.Fixed fixed) {
JaxbFixed(de.focus_shift.jollyday.jaxb.mapping.Fixed fixed) {
this.fixed = fixed;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public MonthDay day() {
return MonthDay.of(xmlUtil.getMonth(fixed.getMonth()), fixed.getDay());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public String descriptionPropertiesKey() {
return fixed.getDescriptionPropertiesKey();
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public HolidayType officiality() {
return fixed.getLocalizedType() == null
? HolidayType.PUBLIC_HOLIDAY
: HolidayType.valueOf(fixed.getLocalizedType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validFrom() {
return fixed.getValidFrom() == null
? null
: Year.of(fixed.getValidFrom());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validTo() {
return fixed.getValidTo() == null
? null
: Year.of(fixed.getValidTo());
}
/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/

@Override
public YearCycle cycle() {
Expand All @@ -60,6 +92,11 @@ public YearCycle cycle() {
: YearCycle.valueOf(fixed.getEvery().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public List<MovingCondition> conditions() {
return fixed.getMovingCondition().stream()
Expand Down
Loading

0 comments on commit 4cd50b9

Please sign in to comment.