eclipse-ee4j / eclipse-ee4j/jaxb-fi

Encoder does not support custom encoding algorithms

Open
#30 9 comments 0 reactions 1 assignee Claimed by @glassfishrobot View on GitHub
Component: core ERR: Assignee Priority: Critical Type: Improvement
Dominant language
Java
Stars
12
Forks
9
Avg merge
1d 15h
Merged PRs (30d)
3

Description

1\. The Encoder does not write the presence of the optional components (see
C.2.5, C.2.5.1) in the initial vocabulary.
In our case encoding-algorithms flag is not set although we register the
encoding algorithm using:

Encoder.setRegisteredEncodingAlgorithms(…)

Fixed by introduction of a new method:

Encoder.encodeInitialVocabularyOptionalComponentPresence(…)

2\. If any of the optional components of the initial vocabulary are present (see
C.2.5.3), the Encoder does not write them to the output.

Fixed by introduction of a new method:

Encoder.encodeInitialVocabularyOptionalComponents(…)

3\. The Encoder does not provide a way to map element QNames to an encoding
algorithm URI. This is required to locate an algorithm implementation to encode
the element’s content during processing.

Fixed by two new methods:

FastInfosetSerializer.setRegisteredQNameToAlgorithMappings(…)
FastInfosetSerializer.getRegisteredQNameToAlgorithmMapping(…)

Please see attached Encoder.patch for the list of all required changes.

Examples how to use custom encoding algorithms can be found in the following test:

EncodingTest.testCustomEncodingAlgorithm()
#### Environment
Operating System: All
Platform: All
#### Affected Versions
[current]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.