How fva-net/rexs-api-java works
Purpose and Modules
REXS-API is a Java 17 library for reading, writing, transforming, validating, and upgrading REXS engineering-model files. Maven root pom.xml coordinates two deliverables: reusable API library api/pom.xml and command-line application cli/pom.xml.
Public Entry Points
Library consumers primarily enter through file-format abstractions and model APIs:
• api/src/main/java/info/rexs/io/RexsFileReader.java
• api/src/main/java/info/rexs/io/RexsFileWriter.java
• api/src/main/java/info/rexs/io/RexsFileUpgrader.java
The executable entry point is cli/src/main/java/info/rexs/cli/Application.java; it exposes conversion and validation workflows over the API.
Canonical Domain Model
The central in-memory boundary is the REXS model: models contain components, attributes, relations, submodels, and load spectra. Typed value classes represent scalar, array, matrix, and Base64-encoded attribute payloads.
• api/src/main/java/info/rexs/model/IRexsModel.java
• api/src/main/java/info/rexs/model/RexsModel.java
• api/src/main/java/info/rexs/model/RexsComponent.java
This domain representation decouples callers from XML, JSON, and ZIP serialization details.
Format I/O and Transformation
Reader/writer implementations ingest or emit the canonical model in XML, JSON, or ZIP-packaged forms. Abstract I/O bases and Resource implementations establish the file/byte-array input-output boundary. Transformers map between the domain model and serialization-specific representations.
• api/src/main/java/info/rexs/io/xml/RexsXmlFileReader.java
• api/src/main/java/info/rexs/io/json/RexsJsonFileWriter.java
• api/src/main/java/info/rexs/io/zip/RexsZipFileReader.java
• api/src/main/java/info/rexs/model/transformer/RexsModelXmlTransformer.java
Typical flow: resource/file → format reader → format-specific representation/transformer → IRexsModel; writing reverses this path.
Versioned Schema Resolution
Schema registries and resolvers provide version-aware metadata for REXS attributes, component types, relations, units, and value types. Embedded schema XML files are runtime resources, not remote services.
• api/src/main/java/info/rexs/schema/RexsSchemaRegistry.java
• api/src/main/java/info/rexs/schema/RexsSchemaResolver.java
• api/src/main/resources/info/rexs/schema/rexs_schema_2.0.0.xml
Constants under schema/constants provide strongly typed identifiers and standard vocabulary; schema resolution is the key boundary between generic model objects and a particular REXS version.
Validation Pipeline
Validation operates at file, model, component, relation, and attribute levels, returning structured results/messages. Standard validators enforce REXS rules; modelling-guideline validators add quasistatic-specific checks.
• api/src/main/java/info/rexs/validation/DefaultRexsFileValidator.java
• api/src/main/java/info/rexs/validation/DefaultRexsModelValidator.java
• api/src/main/java/info/rexs/validation/RexsStandardFileValidator.java
The CLI validation command invokes this layer rather than embedding independent validation rules.
Upgrade and CLI Orchestration
Upgrade logic resolves chained version migrations, applies model upgraders, and uses embedded changelog resources to move files from REXS 1.0 through 2.0. CLI conversion combines read, optional upgrade/version targeting, and write; validation reads then validates.
• api/src/main/java/info/rexs/upgrade/RexsUpgrader.java
• api/src/main/java/info/rexs/upgrade/upgraders/UpgradeResolver.java
• api/src/main/resources/info/rexs/upgrade/upgraders/changelog/rexs_changelog_1.7_to_2.0.0.xml
• cli/src/main/java/info/rexs/cli/convert/ConvertCommandServiceImpl.java
• cli/src/main/java/info/rexs/cli/validate/ValidateCommandServiceImpl.java
CI/release automation is provided by GitHub Actions in .github/workflows/build.yml and .github/workflows/release.yml; no deployed infrastructure or external runtime service is indicated.
Main entry points: RexsUpgrader.java Upgrade pipeline · ConvertCommandServiceImpl.java Convert command · RexsFileReader.java File reader API · IRexsModel.java REXS model
Components 20
API Library
Reusable Java 17 REXS library.
- File reader API · Public model-reading boundary.
api/src/main/java/info/rexs/io/RexsFileReader.java - File writer API · Public model-writing boundary.
api/src/main/java/info/rexs/io/RexsFileWriter.java - File upgrader API · Public file-upgrade boundary.
api/src/main/java/info/rexs/io/RexsFileUpgrader.java - XML, JSON and ZIP I/O · Format readers and writers use resource-backed input and output.
api/src/main/java/info/rexs/io/xml/RexsXmlFileReader.java - Model transformers · Maps format representations to and from the domain model.
api/src/main/java/info/rexs/model/transformer/RexsModelXmlTransformer.java - REXS model · Components, attributes, relations, submodels, and load spectra.
api/src/main/java/info/rexs/model/IRexsModel.java - Model implementation
api/src/main/java/info/rexs/model/RexsModel.java - Components and values · Typed component attributes and payload values.
api/src/main/java/info/rexs/model/RexsComponent.java - Schema registry · Resolves attributes, types, relations, units, and value types by REXS version.
api/src/main/java/info/rexs/schema/RexsSchemaRegistry.java - Schema resolver
api/src/main/java/info/rexs/schema/RexsSchemaResolver.java - File validation · Validates files and returns structured results.
api/src/main/java/info/rexs/validation/DefaultRexsFileValidator.java - Model validation · Applies model, component, relation, and attribute rules.
api/src/main/java/info/rexs/validation/DefaultRexsModelValidator.java - Upgrade pipeline · Resolves and applies chained model migrations.
api/src/main/java/info/rexs/upgrade/RexsUpgrader.java - Upgrade resolver
api/src/main/java/info/rexs/upgrade/upgraders/UpgradeResolver.java
CLI Application
Command workflows over the API.
- CLI application · Conversion and validation entry point.
cli/src/main/java/info/rexs/cli/Application.java - Convert command · Reads, optionally upgrades, then writes files.
cli/src/main/java/info/rexs/cli/convert/ConvertCommandServiceImpl.java - Validate command · Reads files and invokes API validation.
cli/src/main/java/info/rexs/cli/validate/ValidateCommandServiceImpl.java
Embedded Metadata
Versioned schema and upgrade resources.
- Embedded schema XML · Schema metadata packaged with the library.
api/src/main/resources/info/rexs/schema/rexs_schema_2.0.0.xml - Embedded changelogs · Migration definitions for version upgrades.
api/src/main/resources/info/rexs/upgrade/upgraders/changelog/rexs_changelog_1.7_to_2.0.0.xml
Other components
- Library consumers
Connections 26
- Library consumers → File reader API: read
- Library consumers → File writer API: write
- Library consumers → File upgrader API: upgrade
- CLI application → Convert command: runs
- CLI application → Validate command: runs
- Convert command → File reader API: reads
- Convert command → File upgrader API: optional upgrade
- Convert command → File writer API: writes
- Validate command → File reader API: reads
- Validate command → File validation: validates
- File reader API → XML, JSON and ZIP I/O: selects format
- XML, JSON and ZIP I/O → Model transformers: parses or serializes
- Model transformers → REXS model: maps to/from
- File writer API → XML, JSON and ZIP I/O: selects format
- REXS model → Model implementation: implemented by
- Model implementation → Components and values: contains
- Schema registry → Schema resolver: uses
- Schema resolver → Embedded schema XML: loads
- Model validation → REXS model: checks
- Model validation → Schema registry: uses rules
- File validation → Model validation: delegates
- File upgrader API → Upgrade pipeline: delegates
- Upgrade pipeline → Upgrade resolver: resolves chain
- Upgrade resolver → Embedded changelogs: loads
- Upgrade pipeline → REXS model: migrates
- Upgrade pipeline → Schema registry: targets version