Skip to content

Commit

Permalink
Added Quarkus integration test and did some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schnell committed Feb 4, 2024
1 parent fd655d2 commit dea2e24
Show file tree
Hide file tree
Showing 150 changed files with 1,153 additions and 976 deletions.
12 changes: 5 additions & 7 deletions jaxb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
<artifactId>jakarta.validation-api</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>

<!-- Test -->

<dependency>
Expand All @@ -45,13 +50,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-ui</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.CurrencyAmount;

/**
* Converts a {@link CurrencyAmount} from/to String.
*/
@ThreadSafe
public final class CurrencyAmountConverter extends ValueObjectStringConverter<CurrencyAmount> {
public final class CurrencyAmountXmlAdapter extends ValueObjectStringXmlAdapter<CurrencyAmount> {

/**
* Default constructor.
*/
public CurrencyAmountConverter() {
public CurrencyAmountXmlAdapter() {
super(CurrencyAmount::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.fuin.objects4j.jaxb;

import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.CurrencyStrValidator;

import java.util.Currency;
Expand All @@ -27,7 +27,7 @@
* Converts a {@link Currency}.
*/
@ThreadSafe
public final class CurrencyConverter extends XmlAdapter<String, Currency> {
public final class CurrencyXmlAdapter extends XmlAdapter<String, Currency> {

/**
* Verifies that the given value can be converted into a value object using the factory. A {@literal null} parameter will return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.DayOfTheWeek;

/**
* Converts a {@link DayOfTheWeek} from/to String.
*/
@ThreadSafe
public final class DayOfTheWeekConverter extends ValueObjectStringConverter<DayOfTheWeek> {
public final class DayOfTheWeekXmlAdapter extends ValueObjectStringXmlAdapter<DayOfTheWeek> {

/**
* Default constructor.
*/
public DayOfTheWeekConverter() {
public DayOfTheWeekXmlAdapter() {
super(DayOfTheWeek::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.DayOpeningHours;

/**
* Converts {@link DayOpeningHours} from/to String.
*/
@ThreadSafe
public final class DayOpeningHoursConverter extends ValueObjectStringConverter<DayOpeningHours> {
public final class DayOpeningHoursXmlAdapter extends ValueObjectStringXmlAdapter<DayOpeningHours> {

/**
* Default constructor.
*/
public DayOpeningHoursConverter() {
public DayOpeningHoursXmlAdapter() {
super(DayOpeningHours::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.EmailAddress;

/**
* Converts {@link EmailAddress} from/to String.
*/
@ThreadSafe
public final class EmailAddressConverter extends ValueObjectStringConverter<EmailAddress> {
public final class EmailAddressXmlAdapter extends ValueObjectStringXmlAdapter<EmailAddress> {

/**
* Default constructor.
*/
public EmailAddressConverter() {
public EmailAddressXmlAdapter() {
super(EmailAddress::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.HourRange;

/**
* Converts a {@link HourRange} into a String and back.
*/
@ThreadSafe
public final class HourRangeConverter extends ValueObjectStringConverter<HourRange> {
public final class HourRangeXmlAdapter extends ValueObjectStringXmlAdapter<HourRange> {

/**
* Default constructor.
*/
public HourRangeConverter() {
public HourRangeXmlAdapter() {
super(HourRange::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.HourRanges;

/**
* Converts {@link HourRanges} into a String and back.
*/
@ThreadSafe
public final class HourRangesConverter extends ValueObjectStringConverter<HourRanges> {
public final class HourRangesXmlAdapter extends ValueObjectStringXmlAdapter<HourRanges> {

/**
* Default constructor.
*/
public HourRangesConverter() {
public HourRangesXmlAdapter() {
super(HourRanges::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.Hour;

/**
* Converts a {@link Hour} into a String and back.
*/
@ThreadSafe
public final class HourConverter extends ValueObjectStringConverter<Hour> {
public final class HourXmlAdapter extends ValueObjectStringXmlAdapter<Hour> {

/**
* Default constructor.
*/
public HourConverter() {
public HourXmlAdapter() {
super(Hour::valueOf);
}

Expand Down
61 changes: 61 additions & 0 deletions jaxb/src/main/java/org/fuin/objects4j/jaxb/JaxbUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright (C) 2013 Future Invent Informationsmanagement GmbH. All rights
* reserved. <http://www.fuin.org/>
* <p>
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option) any
* later version.
* <p>
* This library 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 Lesser General Public License for more
* details.
* <p>
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
package org.fuin.objects4j.jaxb;

import jakarta.xml.bind.annotation.adapters.XmlAdapter;

import java.util.ArrayList;
import java.util.List;

/**
* Utility class for this package.
*/
public final class JaxbUtils {

private static final List<XmlAdapter<?, ?>> ADAPTERS = List.of(
new CurrencyAmountXmlAdapter(),
new CurrencyXmlAdapter(),
new DayOfTheWeekXmlAdapter(),
new DayOpeningHoursXmlAdapter(),
new EmailAddressXmlAdapter(),
new HourXmlAdapter(),
new HourRangeXmlAdapter(),
new HourRangesXmlAdapter(),
new LocaleXmlAdapter(),
new MultiDayOfTheWeekXmlAdapter(),
new PasswordXmlAdapter(),
new PasswordSha512XmlAdapter(),
new UserNameXmlAdapter(),
new UUIDXmlAdapter(),
new WeeklyOpeningHoursXmlAdapter()
);

private JaxbUtils() {
throw new UnsupportedOperationException("Instances of utility classes are not allowed");
}

/**
* Returns the list of {@link XmlAdapter} objects defined by the package.
*
* @return New instance of the adapter list.
*/
public static List<XmlAdapter<?, ?>> getJaxbAdapters() {
return new ArrayList<>(ADAPTERS);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.fuin.objects4j.jaxb;

import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.LocaleHelper;

import java.util.Locale;
Expand All @@ -27,7 +27,7 @@
* Converts a {@link Locale} into a String and back.
*/
@ThreadSafe
public final class LocaleConverter extends XmlAdapter<String, Locale> {
public final class LocaleXmlAdapter extends XmlAdapter<String, Locale> {

@Override
public final String marshal(final Locale value) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.MultiDayOfTheWeek;

/**
* Converts {@link MultiDayOfTheWeek} into a String and back.
*/
@ThreadSafe
public final class MultiDayOfTheWeekConverter extends ValueObjectStringConverter<MultiDayOfTheWeek> {
public final class MultiDayOfTheWeekXmlAdapter extends ValueObjectStringXmlAdapter<MultiDayOfTheWeek> {

/**
* Default constructor.
*/
public MultiDayOfTheWeekConverter() {
public MultiDayOfTheWeekXmlAdapter() {
super(MultiDayOfTheWeek::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.PasswordSha512;

/**
* Converts a {@link PasswordSha512} from/to String.
*/
@ThreadSafe
public class PasswordSha512Converter extends ValueObjectStringConverter<PasswordSha512> {
public class PasswordSha512XmlAdapter extends ValueObjectStringXmlAdapter<PasswordSha512> {

/**
* Default constructor.
*/
public PasswordSha512Converter() {
public PasswordSha512XmlAdapter() {
super(PasswordSha512::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.Password;

/**
* Converts a {@link Password} from/to String.
*/
@ThreadSafe
public class PasswordConverter extends ValueObjectStringConverter<Password> {
public class PasswordXmlAdapter extends ValueObjectStringXmlAdapter<Password> {

/**
* Default constructor.
*/
public PasswordConverter() {
public PasswordXmlAdapter() {
super(Password::valueOf);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
package org.fuin.objects4j.jaxb;

import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;

import java.util.UUID;

/**
* Converts a {@link UUID} into a String and back.
*/
@ThreadSafe
public final class UUIDConverter extends XmlAdapter<String, UUID> {
public final class UUIDXmlAdapter extends XmlAdapter<String, UUID> {

@Override
public final String marshal(final UUID value) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.fuin.objects4j.jaxb;

import org.fuin.objects4j.common.ThreadSafe;
import javax.annotation.concurrent.ThreadSafe;
import org.fuin.objects4j.core.UserName;

/**
* Creates a {@link UserName}.
*/
@ThreadSafe
public final class UserNameConverter extends ValueObjectStringConverter<UserName> {
public final class UserNameXmlAdapter extends ValueObjectStringXmlAdapter<UserName> {

/**
* Default constructor.
*/
public UserNameConverter() {
public UserNameXmlAdapter() {
super(UserName::valueOf);
}

Expand Down
Loading

0 comments on commit dea2e24

Please sign in to comment.