Skip to content

Stax reader adding a namespace and version check if <versionDefinition> is present #477

@andrzejj0

Description

@andrzejj0

This came up when I tried moving from Xpp3 to Stax for our Modello readers in Versions Maven Plugin. It turns out that modello-stax adds a namespace- and version check in the generated Stax parser while it does not do so in other flavours of the parser.

See StaxReaderGenerator.java#L217

VersionDefinition versionDefinition = objectModel.getVersionDefinition();
if (versionDefinition != null && versionDefinition.isNamespaceType()) {
    sc.add("String modelVersion = getVersionFromRootNamespace( xmlStreamReader );");

    writeModelVersionCheck(sc);
}

Perhaps there should come a new optional parameter to make the check optional and also consistent with other parsers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions