- java.lang.Object
-
- de.carne.mcd.jvmdecoder.classfile.ClassName
-
public class ClassName extends java.lang.ObjectA class name.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringdecode(java.lang.String internal)Decodes an internal or so called binary class name to it's standard form.static java.lang.StringeffectiveName(java.lang.String name, java.lang.String classPackage)Gets the effective class name by removing any unnecessary package prefix.static ClassNamefromConstant(@Nullable NameConstant nameConstant)Constructs a new ClassName instance from a name constant.static ClassNamefromInternalName(java.lang.String internal)Constructs a new ClassName instance from an internal class name.java.lang.StringgetEffectiveName(java.lang.String classPackage)Gets the effective class name by removing any unnecessary package prefix.java.lang.StringgetName()Gets the full class name.java.lang.StringgetPackageName()Gets the package name.booleanisEnum()Checks whether this instance denotes the class Enum.booleanisModuleInfo()Checks whether this instance denotes a module info class.booleanisObject()Checks whether this instance denotes the class Object.booleanisPackageInfo()Checks whether this instance denotes a package info class.java.lang.StringtoString()
-
-
-
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.
-
fromConstant
public static ClassName fromConstant(@Nullable NameConstant nameConstant) throws java.io.IOException
Constructs a new ClassName instance from a name constant.
-
isPackageInfo
public boolean isPackageInfo()
Checks whether this instance denotes a package info class.- Returns:
trueif this instance denotes a package info class.
-
isModuleInfo
public boolean isModuleInfo()
Checks whether this instance denotes a module info class.- Returns:
trueif this instance denotes a module info class.
-
isObject
public boolean isObject()
Checks whether this instance denotes the class Object.- Returns:
trueif this instance denotes the class Object.
-
isEnum
public boolean isEnum()
Checks whether this instance denotes the class Enum.- Returns:
trueif 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:
toStringin classjava.lang.Object
-
-