Class JClass

    • Constructor Detail

      • JClass

        public JClass​(java.lang.String name)
        Creates a new JClass with the given name.
        Parameters:
        name - The name of the JClass to create.
    • Method Detail

      • addImport

        public final void addImport​(java.lang.String className)
        Adds the given import to this JStructure. Note: You cannot import from the "default package," so imports with no package are ignored.
        Specified by:
        addImport in class JStructure
        Parameters:
        className - Name of the class to import.
      • addMember

        public void addMember​(JMember jMember)
        Adds the given JMember to this JStructure.
        This method is implemented by subclasses and should only accept the proper types for the subclass otherwise an IllegalArgumentException will be thrown.
        Specified by:
        addMember in class JStructure
        Parameters:
        jMember - The JMember to add to this JStructure.
      • getSuperClass

        public final JTypeName getSuperClass()
        Returns the super class that this class extends.
        Returns:
        superClass The super class that this class extends.
      • getSuperClassQualifiedName

        public final java.lang.String getSuperClassQualifiedName()
        Returns the qualified name of the super class that this class extends.
        Returns:
        superClass The qualified name of the super class that this class extends.
      • setSuperClass

        public final void setSuperClass​(java.lang.String superClass)
        Sets the super Class that this class extends.
        Parameters:
        superClass - The super Class that this Class extends.
      • print

        public void print​(JSourceWriter jsw,
                          boolean classOnly)
        Deprecated.
        Please use the Velocity-template based approach instead.
        Prints the source code for this JClass to the given JSourceWriter.
        Specified by:
        print in class AbstractJClass
        Parameters:
        jsw - The JSourceWriter to print to. Must not be null.
        classOnly - If true, the file header, package declaration, and imports are not printed.
        See Also:
        SourceGenerator.setJClassPrinterType(String)
      • changeLocalName

        public void changeLocalName​(java.lang.String localName)
        Changes the local name of this class type.
        Parameters:
        localName - The new local name to be used.