Skip to content

Feature: Add class model-episode.java #662

Description

@mattrpav

For each package, add a model-episode.java class (akin to ObjectFactory.java and package-info.java) that contains the same information as the sun-jaxb.episode file.

Design goals:

  1. Class should be generated along side the generated classes
  2. Class should lazy instantiate information for query
  3. Terminology not be specifically tied to jaxb -- for example, could be used for JSON as well.
  4. No caching of references/handles to classes to allow for Java VM runtime class loading/unloading without leaking

Use case:
Auto-discovery of model classes, enums, etc. for wiring Classloaders to be used by JAXB, JSON and other model ser/deser frameworks.

Draft interface:

String getPackageName()
String getNamespace() // returns xmlns urn:foo.com:v2, https://foo.com/v2, etc
Map<String, Class listClasses() // retun unmodifiable map of fully qualified class name -> Class
Map<String, Class listEnumClasses() // retun unmodifiable map of fully qualified typesafe enum class name -> Class

Note: This may need to go upstream to jaxb-ri, but could be implemented here as a proof-of-concept.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions