|
19 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
20 | 20 | * SOFTWARE. |
21 | 21 | */ |
22 | | -package com.github.packageurl.type; |
| 22 | +package com.github.packageurl.internal; |
23 | 23 |
|
| 24 | +import aQute.bnd.annotation.spi.ServiceConsumer; |
24 | 25 | import com.github.packageurl.MalformedPackageURLException; |
25 | 26 | import com.github.packageurl.PackageURL; |
26 | | -import com.github.packageurl.internal.StringUtil; |
| 27 | + |
27 | 28 | import java.security.AccessController; |
28 | 29 | import java.security.PrivilegedAction; |
29 | 30 | import java.util.ArrayList; |
|
34 | 35 | import java.util.ServiceLoader; |
35 | 36 | import java.util.Set; |
36 | 37 | import java.util.TreeMap; |
| 38 | + |
| 39 | +import com.github.packageurl.spi.PackageTypeProvider; |
37 | 40 | import org.jspecify.annotations.NonNull; |
38 | 41 | import org.jspecify.annotations.Nullable; |
| 42 | +import org.osgi.annotation.bundle.Requirement; |
39 | 43 |
|
| 44 | +@ServiceConsumer(value = PackageTypeProvider.class, resolution = Requirement.Resolution.MANDATORY, cardinality = Requirement.Cardinality.MULTIPLE) |
40 | 45 | public final class PackageTypeFactory implements PackageTypeProvider { |
41 | 46 | private static final @NonNull PackageTypeFactory INSTANCE = new PackageTypeFactory(); |
42 | 47 |
|
@@ -109,7 +114,7 @@ private static void validateQualifiers(@Nullable Map<String, String> qualifiers) |
109 | 114 | } |
110 | 115 | } |
111 | 116 |
|
112 | | - static void validateType(@NonNull String type) throws MalformedPackageURLException { |
| 117 | + public static void validateType(@NonNull String type) throws MalformedPackageURLException { |
113 | 118 | if (type.isEmpty()) { |
114 | 119 | throw new MalformedPackageURLException("a type is always required"); |
115 | 120 | } |
|
0 commit comments