Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step3 #498

Merged
merged 12 commits into from
Oct 19, 2024
Merged

Step3 #498

merged 12 commits into from
Oct 19, 2024

Conversation

caring-coder
Copy link
Member

@caring-coder caring-coder commented Oct 19, 2024

Introduce the CommentProcessors
Introduce the WmlFactory
Extract preset Processors into their own packages

Reorder the initialization of the context map and object list property to ensure `FLAT_STRING` is set before `OBJECT_LIST_PROP`. This reorganization improves readability and follows standard initialization practices.
Refactor the constructor and methods to include and utilize the P object. Add methods to retrieve paragraph content and parent objects. Deprecated getP() method to signal future removal.
Added a toString method to StandardComment to provide a clear and formatted string representation of the comment's ID, content, and the number of children. This will improve debugging and logging by making it easier to inspect the state of StandardComment objects.
Refactored the `applySectionBreakToParagraph` method to use `WmlFactory::newPPr` instead of a lambda function. This improves code readability and consistency by leveraging the utility class.
Refactor methods to use Optional and enhance section break detection. Replaced null checks with Optional to improve code readability and robustness. Also added additional logging for better traceability of actions.
Refactored RunUtil to use WmlFactory methods for creating runs and text elements, reducing code duplication and improving maintainability. Removed the Context object factory and associated create methods.
Consolidate imports, remove redundant stream mapping, and replace RunUtil with WmlFactory. These changes streamline the code and improve readability, making it more maintainable.
Introduced the CommentProcessors class to encapsulate comment processor management. Refactored CommentProcessorRegistry and related classes to use the new CommentProcessors, simplifying the code and improving maintainability.
…ut of CommentProcessorFactory.java

DisplayIfProcessor, RepeatProcessor, RepeatDocPartProcessor, ParagraphRepeatProcessor, and ReplaceWithProcessor. These processors allow for  dynamic content manipulation within documents, including conditionally displaying elements, repeating sections based on data, replacing content, and working with document parts.
Standardized the method for creating text runs by replacing RunUtil.create with the newRun method. This ensures consistency across the codebase and leverages the utilities provided by WmlFactory.
Revised the comment extraction logic to streamline and improve code readability. Introduced `extractContent` method to handle `CommentsPart` safely, and replaced the manual collection loop with stream operations to set comments more concisely.
Streamlined the code by removing unused imports and exceptions. Refactored `CommentUtil` class for better clarity and efficiency, particularly in handling comments retrieval and extraction.
Copy link

@caring-coder caring-coder merged commit b1040fa into main Oct 19, 2024
2 of 8 checks passed
@caring-coder caring-coder deleted the step3 branch October 19, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant