Skip to content

Support for types #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dwalluck opened this issue Mar 12, 2025 · 2 comments
Open

Support for types #188

dwalluck opened this issue Mar 12, 2025 · 2 comments

Comments

@dwalluck
Copy link
Contributor

Right now, type validation/normalization is just a big method with a switch statement.

Should type handling be moved to separate classes, e.g., have PackageURL handle validation/normalization only in the general case and have each type handle itself?

dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 14, 2025
dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 14, 2025
dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 14, 2025
dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 18, 2025
dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 22, 2025
@jeremylong
Copy link
Collaborator

Yes, this should be moved to a new class. This will be especially true once the spec is updated to have the types in a machine-readable format. Moving this to it's own class now will be a good step in preparation for the future.

@ppkarwasz
Copy link
Contributor

Do we know how the spec will handle new type registrations? If the enumeration of types will not be centralized, a SPI might be useful to register new types.

dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 23, 2025
dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 23, 2025
This uses the Java Service Provider Interface via `ServiceLoader` to
register new types, where each type gets its own class.
dwalluck added a commit to dwalluck/packageurl-java that referenced this issue Mar 23, 2025
This uses the Java Service Provider Interface via `ServiceLoader` to
register new types, where each type gets its own class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants