Class ClassName


  • public class ClassName
    extends java.lang.Object
    A class name.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String decode​(java.lang.String internal)
      Decodes an internal or so called binary class name to it's standard form.
      static java.lang.String effectiveName​(java.lang.String name, java.lang.String classPackage)
      Gets the effective class name by removing any unnecessary package prefix.
      static ClassName fromConstant​(@Nullable NameConstant nameConstant)
      Constructs a new ClassName instance from a name constant.
      static ClassName fromInternalName​(java.lang.String internal)
      Constructs a new ClassName instance from an internal class name.
      java.lang.String getEffectiveName​(java.lang.String classPackage)
      Gets the effective class name by removing any unnecessary package prefix.
      java.lang.String getName()
      Gets the full class name.
      java.lang.String getPackageName()
      Gets the package name.
      boolean isEnum()
      Checks whether this instance denotes the class Enum.
      boolean isModuleInfo()
      Checks whether this instance denotes a module info class.
      boolean isObject()
      Checks whether this instance denotes the class Object.
      boolean isPackageInfo()
      Checks whether this instance denotes a package info class.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • decode

        public static java.lang.String decode​(java.lang.String internal)
        Decodes an internal or so called binary class name to it's standard form.
        Parameters:
        internal - the class name to decode.
        Returns:
        the decoded class name.
      • effectiveName

        public static java.lang.String effectiveName​(java.lang.String name,
                                                     java.lang.String classPackage)
        Gets the effective class name by removing any unnecessary package prefix.
        Parameters:
        name - the class name to get the effective name for.
        classPackage - the class package the class name is accessed in.
        Returns:
        the effective class name.
      • fromInternalName

        public static ClassName fromInternalName​(java.lang.String internal)
        Constructs a new ClassName instance from an internal class name.
        Parameters:
        internal - the internal class name to create the ClassName instance from.
        Returns:
        the ClassName instance representing the submitted class name.
      • fromConstant

        public static ClassName fromConstant​(@Nullable NameConstant nameConstant)
                                      throws java.io.IOException
        Constructs a new ClassName instance from a name constant.
        Parameters:
        nameConstant - the name constant to create the ClassName instance from (may be null to point to class Object).
        Returns:
        the ClassName instance representing the submitted name constant.
        Throws:
        java.io.IOException - if the name constant cannot be resolved.
      • isPackageInfo

        public boolean isPackageInfo()
        Checks whether this instance denotes a package info class.
        Returns:
        true if this instance denotes a package info class.
      • isModuleInfo

        public boolean isModuleInfo()
        Checks whether this instance denotes a module info class.
        Returns:
        true if this instance denotes a module info class.
      • isObject

        public boolean isObject()
        Checks whether this instance denotes the class Object.
        Returns:
        true if this instance denotes the class Object.
      • isEnum

        public boolean isEnum()
        Checks whether this instance denotes the class Enum.
        Returns:
        true if this instance denotes the class Enum.
      • getName

        public java.lang.String getName()
        Gets the full class name.
        Returns:
        the full class name.
      • getEffectiveName

        public java.lang.String getEffectiveName​(java.lang.String classPackage)
        Gets the effective class name by removing any unnecessary package prefix.
        Parameters:
        classPackage - the class package the class name is accessed in.
        Returns:
        the effective class name.
      • getPackageName

        public java.lang.String getPackageName()
        Gets the package name.
        Returns:
        the package name.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object