Class JavadocProcessorBase

java.lang.Object
org.apache.clusterbr.zupportl5.processor.JavadocProcessorBase
Direct Known Subclasses:
JavadocProcessor

public class JavadocProcessorBase extends Object

UML Diagrams:

UML CLASS Diagram

Since:
2024-1108
Author:
arcbrth@gmail.com
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
  • Constructor Details

    • JavadocProcessorBase

      public JavadocProcessorBase()
  • Method Details

    • shouldSkipProcessing

      protected boolean shouldSkipProcessing(File file)
    • generateRestApiComments

      protected JavadocCommentBuilder generateRestApiComments(Class<?> controllerClass)
    • containsSkipAnnotation

      protected boolean containsSkipAnnotation(File file)
    • containsExecuteAnnotation

      protected boolean containsExecuteAnnotation(File file)
    • getClassName

      protected String getClassName(File file)
    • getClassFullName

      protected String getClassFullName(File file)
    • extractFullyQualifiedClassName

      protected String extractFullyQualifiedClassName(String content)
    • processRestore

      protected void processRestore(File file, String content) throws IOException
      Throws:
      IOException
    • writeUpdatedContent

      protected void writeUpdatedContent(File file, String content) throws IOException
      Throws:
      IOException
    • deleteEntireClassLevelComment

      protected String deleteEntireClassLevelComment(String content)
      Deletes the entire class-level Javadoc comment, ensuring it is removed only if it precedes a class, interface, enum, or record declaration, regardless of its access modifier.
      Parameters:
      content - the source code content
      Returns:
      the modified source code with the class-level Javadoc removed
    • deleteJavadocProcessorComments

      protected String deleteJavadocProcessorComments(String content)
      Delete all content between and (inclusive) The regex matches everything between and including the start and end markers. The (?s) flag allows . to match newline characters.
      Parameters:
      content -
      Returns:
      String
    • replaceOrInsertJavadocProcessorComments

      protected String replaceOrInsertJavadocProcessorComments(String fileSourceCode, String newComments)
      Replaces or inserts comment processor tags and content into the source code. Handles three cases: - No comments at all at class level: Inserts the new comment block before the class. - Tags do not exist but class-level comments exist: Adds the new comments just before the ending of the existing class-level comments. - Tags exist and class-level comments exist: Replaces content between the tags with new comments.
      Parameters:
      fileSourceCode - the full source code of the file
      newComments - the new comments to be added
      Returns:
      the modified source code