Class NestedClass

java.lang.Object
org.netbeans.spi.project.NestedClass

public final class NestedClass extends Object
Structure representing an identification of a nested class in a file.

NestedClass can be used to represent nested classes within parent class Example: If we have following structure: ParentClass (parent-of) ChildClass1 (parent-of) ChildClass2, for ChildClass1 className field would contain "ChildClass1" and topLevelClassName would contain "ParentClass", for ChildClass2 className field would contain "ChildClass1.ChildClass2" and topLevelClassName would contain "ParentClass"

Since:
1.99
  • Constructor Details

    • NestedClass

      public NestedClass(String className, String topLevelClassName, org.openide.filesystems.FileObject file)
      Creates a new instance holding the specified identification of a nested class.
      Parameters:
      className - name of a class inside the file
      topLevelClassName - top level name of a class inside the file
      file - file to be kept in the object
      Throws:
      IllegalArgumentException - if the file or class name is null
      Since:
      1.99
  • Method Details

    • getFile

      public org.openide.filesystems.FileObject getFile()
      Returns the file identification.
      Returns:
      file held by this object
      Since:
      1.99
    • getClassName

      public String getClassName()
      Returns name of a nested class within a file.
      Returns:
      class name held by this object
      Since:
      1.99
    • getTopLevelClassName

      public String getTopLevelClassName()
      Returns name of a top level class within a file.
      Returns:
      top level class name held by this object
      Since:
      1.99
    • getFQN

      public String getFQN(String packageName)
      Returns fully qualified name.
      Parameters:
      packageName - name of the package where the class is
      Returns:
      fully qualified name held by this object
      Since:
      1.99
    • getFQN

      public String getFQN(String packageName, String nestedClassSeparator)
      Returns fully qualified name.
      Parameters:
      packageName - name of the package where the class is
      nestedClassSeparator - separator for the nested classes
      Returns:
      fully qualified name held by this object
      Since:
      1.99
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object