Class JModule

    • Method Detail

      • name

        public String name()
        Gets the name of this module.
        Returns:
        name of this module.
      • _exports

        public void _exports​(JPackage pkg)
        Adds a package to the list of Java module exports. The package name shall not be null or empty String.
        Parameters:
        pkg - Java package to be exported.
      • _exports

        public void _exports​(Collection<JPackage> pkgs,
                             boolean addEmpty)
        Adds packages to the list of Java module exports.
        Parameters:
        pkgs - Collection of packages to be added.
        addEmpty - Adds also packages without any classes when true.
      • _requires

        public void _requires​(String name,
                              boolean isPublic,
                              boolean isStatic)
        Adds a module to the list of Java module requirements. The module name shall not be null or empty String.
        Parameters:
        name - Name of required Java module.
        isPublic - Use public modifier.
        isStatic - Use static modifier.
      • _requires

        public void _requires​(String name)
        Adds a module to the list of Java module requirements without public and static modifiers. The module name shall not be null or empty String.
        Parameters:
        name - Name of required Java module.
      • _requires

        public void _requires​(boolean isPublic,
                              boolean isStatic,
                              String... names)
        Adds all modules to the list of Java module requirements. The module name shall not be null or empty String.
        Parameters:
        names - Names of required Java module.
        isPublic - Use public modifier.
        isStatic - Use static modifier.
      • _requires

        public void _requires​(String... names)
        Adds all modules to the list of Java module requirements without public and static modifiers.
        Parameters:
        names - Names of required Java module.
      • annotate

        public JAnnotationUse annotate​(JClass clazz)
        Description copied from interface: JAnnotatable
        Adds an annotation to this program element.
        Specified by:
        annotate in interface JAnnotatable
        Parameters:
        clazz - The annotation class to annotate the program element with
      • removeAnnotation

        public boolean removeAnnotation​(JAnnotationUse annotation)
        Description copied from interface: JAnnotatable
        Removes annotation from this program element.
        Specified by:
        removeAnnotation in interface JAnnotatable
        Parameters:
        annotation - The annotation to be removed from the program element
      • javadoc

        public JDocComment javadoc()
        Creates, if necessary, and returns the class javadoc for this JModule
        Specified by:
        javadoc in interface JDocCommentable
        Returns:
        JDocComment containing javadocs for this class
      • generate

        public void generate​(JFormatter f)
        Print source code of Java Module declaration.
        Specified by:
        generate in interface JGenerable
        Parameters:
        f - Java code formatter.