Class ClassAndPropertiesSettersJavadocScraper

    • Method Detail

      • initialize

        public static void initialize​(String newModuleName)
        Initialize the scraper. Clears static context and sets the module name.
        Parameters:
        newModuleName - the module name.
      • isMethodOfScrapedModule

        private static boolean isMethodOfScrapedModule​(DetailAST methodDef)
        Checks if the given method is a method of the module being scraped. Traverses parent nodes until it finds the class definition and checks if the class name is the same as the module name. We want to avoid scraping javadocs from inner classes.
        Parameters:
        methodDef - the method definition.
        Returns:
        true if the method is a method of the given module, false otherwise.
      • getParentAst

        private static DetailAST getParentAst​(DetailAST ast,
                                              int type)
        Get the parent node of the given type. Traverses up the tree until it finds the given type.
        Parameters:
        ast - the node to start traversing from.
        type - the type of the parent node to find.
        Returns:
        the parent node of the given type, or null if not found.
      • getPropertyName

        private static String getPropertyName​(String setterName)
        Get the property name from the setter method name. For example, getPropertyName("setFoo") returns "foo". This method removes the "set" prefix and decapitalizes the first letter of the property name.
        Parameters:
        setterName - the setter method name.
        Returns:
        the property name.
      • isSetterMethod

        private static boolean isSetterMethod​(DetailAST ast)
        Returns whether an AST represents a setter method.
        Parameters:
        ast - the AST to check with
        Returns:
        whether the AST represents a setter method