Class DecodedClassInfo

  • All Implemented Interfaces:
    ClassInfo

    public class DecodedClassInfo
    extends java.lang.Object
    implements ClassInfo
    The actual class file decoder.
    • Method Detail

      • decode

        public static DecodedClassInfo decode​(de.carne.mcd.io.MCDInputBuffer buffer)
                                       throws java.io.IOException
        Decodes the given class file data.
        Parameters:
        buffer - the class file data to decode.
        Returns:
        the decoded class info.
        Throws:
        java.io.IOException - if a decoding failure occurs.
      • majorVersion

        public int majorVersion()
        Description copied from interface: ClassInfo
        Gets the class file's major version.
        Specified by:
        majorVersion in interface ClassInfo
        Returns:
        the class file's major version.
      • minorVersion

        public int minorVersion()
        Description copied from interface: ClassInfo
        Gets the class file's minor version.
        Specified by:
        minorVersion in interface ClassInfo
        Returns:
        the class file's minor version.
      • resolveConstant

        public <T extends Constant> T resolveConstant​(int index,
                                                      java.lang.Class<T> type)
                                               throws java.io.IOException
        Description copied from interface: ClassInfo
        Resolves a constant from the class file's constant pool.
        Specified by:
        resolveConstant in interface ClassInfo
        Type Parameters:
        T - the actual type of the constant to resolve.
        Parameters:
        index - the constant pool index to resolve.
        type - the type of the constant to resolve.
        Returns:
        the resolved constant.
        Throws:
        java.io.IOException - if the constant cannot be resolved.
      • resolveRuntimeSymbol

        public java.lang.String resolveRuntimeSymbol​(int index)
        Description copied from interface: ClassInfo
        Resolves a run-time constant pool index to it's corresponding symbol.
        Specified by:
        resolveRuntimeSymbol in interface ClassInfo
        Parameters:
        index - the run-time constant pool index to resolve.
        Returns:
        the resolved symbol.
      • accessFlags

        public int accessFlags()
        Description copied from interface: ClassInfo
        Gets the class' access flags.
        Specified by:
        accessFlags in interface ClassInfo
        Returns:
        the class' access flags.
      • thisClass

        public ClassName thisClass()
        Description copied from interface: ClassInfo
        Gets the class' name.
        Specified by:
        thisClass in interface ClassInfo
        Returns:
        the class' name.
      • superClass

        public ClassName superClass()
        Description copied from interface: ClassInfo
        Gets the class' super class.
        Specified by:
        superClass in interface ClassInfo
        Returns:
        the class' super class.
      • interfaces

        public java.util.List<ClassName> interfaces()
        Description copied from interface: ClassInfo
        Gets the class' super interfaces.
        Specified by:
        interfaces in interface ClassInfo
        Returns:
        the class' super interfaces.
      • fields

        public java.util.List<FieldInfo> fields()
        Description copied from interface: ClassInfo
        Gets the class' field informations.
        Specified by:
        fields in interface ClassInfo
        Returns:
        the class' field informations.
      • methods

        public java.util.List<MethodInfo> methods()
        Description copied from interface: ClassInfo
        Gets the class' method informations.
        Specified by:
        methods in interface ClassInfo
        Returns:
        the class' method informations.
      • attributes

        public java.util.List<Attribute> attributes()
        Description copied from interface: ClassInfo
        Gets the class' attributes.
        Specified by:
        attributes in interface ClassInfo
        Returns:
        the class' attributes.