[YANGTOOLS-1508] Make YangTextSchemaSource work on CharSource Created: 03/May/23  Updated: 13/Jun/23  Resolved: 13/Jun/23

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 11.0.0

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As it currently stands, YangTextSchemaSource works on ByteSource, i.e. it does not make any guarantees about the actual character set being used. We pass whatever bytes we have to ANTLR, where we use a constructor which assumes UTF-8.

We can be more flexible: make YangTextSchemaSource as CharSource, exposing the character set in use the the various utility methods. This allows use to push the charset assumption up a layer to actual callers and interface ANTLR with plain java.io.Reader, i.e. without forcing everone to use UTF-8.

Since this impacts YANGTOOLS-1507, rename ImmediateYangTextSchemaSource to StringYangTextSchemaSource, making it more obvious.


Generated at Wed Feb 07 20:56:21 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.