Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the vocabulary POJO generation to create cleaner, more efficient code with improved documentation and caching mechanisms for QName objects.
Key Changes:
- Generates modern vocabulary classes with URI constants for RDFS classes and properties, QName helper methods, and comprehensive Javadoc
- Refactors slf4j dependencies to use only
slf4j-apifor domain projects, movingslf4j-simpleto servlet-specific dependencies - Fixes deprecated
new Boolean()constructor usage in favor ofBoolean.valueOf()
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/services/vocabularyServices.mtl | Adds query functions for generating constant names and vocabulary class names with _CLASS and _PROP suffixes |
| org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/services/resourcePropertyServices.mtl | Replaces deprecated new Boolean() constructor with Boolean.valueOf() |
| org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateVocabularyConstants.mtl | Generates new vocabulary classes with URI constants, QName helpers, Javadoc, and archaic deprecation annotations |
| org.eclipse.lyo.oslc4j.codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/config/generatePomXml.mtl | Separates slf4j dependencies: slf4j-api for all projects, slf4j-simple only for servlet projects |
| .gitattributes | Enforces LF line endings for MTL template files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateVocabularyConstants.mtl
Outdated
Show resolved
Hide resolved
...codegenerator/src/org/eclipse/lyo/oslc4j/codegenerator/files/generateVocabularyConstants.mtl
Outdated
Show resolved
Hide resolved
|
@berezovskyi What do you think of hte suggested changes. i have not changed the file names yet. |
berezovskyi
left a comment
There was a problem hiding this comment.
@Jad-el-khoury Looks good.
One comment: can we get rid of the local names? Or, at least, remove local name concatenation outside the vocab class? For example, eclipse-lyo/lyo@f6384ce#diff-d9fe2502a3e88924c68ec001d4ab09f1832174c0a15e207984574b1f3a2950beR96 should not have
@OslcPropertyDefinition(DctermsVocabularyConstants.NS + "title")
but
@OslcPropertyDefinition(DctermsVocabularyConstants.TITLE_PROP)
Minor nit: can we add a newline before the javadoc start to avoid props and javadocs being squished all together? Just a cosmetic thing.
| // [protected ('Copyright')] | ||
| /* | ||
| * Copyright (c) 2020 Contributors to the Eclipse Foundation | ||
| * Copyright (c) 2025 Contributors to the Eclipse Foundation |
Description
Adds generation for modern vocabulary POJOs, including:
@Deprecatedannotation for constants and QName helpers that are marked with a description "archaic"Additional changes:
osclprefixslf4j-apifor non-servlet (domain) project POMs.new Boolean(string)calls by switching toBoolean.valueOf(string)Checklist
Issues
Closes #0; Closes #00
(use exactly this syntax to link to issues, one issue per statement only!)