Class ClassData


  • public class ClassData
    extends java.lang.Object
    Container class used to store information about classes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String name
      The internal (like the fully-qualified name, but with '/' instead of '.') of the class.
      java.lang.String nameMapped
      The mapped internal (like the fully-qualified name, but with '/' instead of '.') of the class.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassData​(java.lang.String name, java.lang.String nameMapped)
      The constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addField​(java.lang.String plain, java.lang.String mapped)
      Adds a field to the target class.
      void addField​(java.lang.String plain, java.lang.String mapped, java.lang.String descriptor)
      Adds a field to the target class.
      void addMethod​(java.lang.String name, java.lang.String nameMapped, java.lang.String descriptor)
      Adds a method to the target class.
      ClassData generateReverseMappings​(Mapper mapper)
      Generates the reverse mappings for this class.
      java.util.Map<java.lang.String,​FieldData> getFields()
      Gets the underlying Map for FieldData.
      java.util.Map<MethodSignature,​MethodData> getMethods()
      Gets the underlying Map for MethodData.
      FieldData mapField​(java.lang.String fieldName)
      Gets the FieldData its name.
      MethodData mapMethod​(java.lang.String methodName, java.lang.String methodDescriptor)
      Gets the MethodData from its name and descriptor, which may be partial (i.e.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        public final java.lang.String name
        The internal (like the fully-qualified name, but with '/' instead of '.') of the class.
      • nameMapped

        public final java.lang.String nameMapped
        The mapped internal (like the fully-qualified name, but with '/' instead of '.') of the class.
    • Constructor Detail

      • ClassData

        public ClassData​(java.lang.String name,
                         java.lang.String nameMapped)
        The constructor. It takes in the names (plain and mapped) of a class.
        Parameters:
        name - the plain name
        nameMapped - the mapped name
    • Method Detail

      • addMethod

        public void addMethod​(java.lang.String name,
                              java.lang.String nameMapped,
                              java.lang.String descriptor)
        Adds a method to the target class.
        Parameters:
        name - the method name
        nameMapped - the mapped method name
        descriptor - the descriptor of the method
      • addField

        public void addField​(java.lang.String plain,
                             java.lang.String mapped)
        Adds a field to the target class.
        Parameters:
        plain - the name of the field
        mapped - the mapped name of the field
      • addField

        public void addField​(java.lang.String plain,
                             java.lang.String mapped,
                             java.lang.String descriptor)
        Adds a field to the target class.
        Parameters:
        plain - the name of the field
        mapped - the mapped name of the field
        descriptor - the plain type descriptor of the field
      • generateReverseMappings

        public ClassData generateReverseMappings​(Mapper mapper)
        Generates the reverse mappings for this class. Should always be called only after the given mapper has finished processing all classes.
        Parameters:
        mapper - the mapper that generated this data
        Returns:
        a ClassData representing the inverted mappings
      • mapMethod

        public MethodData mapMethod​(java.lang.String methodName,
                                    java.lang.String methodDescriptor)
        Gets the MethodData from its name and descriptor, which may be partial (i.e. not include the return type).
        Parameters:
        methodName - the method name
        methodDescriptor - the method descriptor, which may be partial
        Returns:
        the requested MethodData
        Throws:
        MappingNotFoundException - if the mapping wasn't found
      • getFields

        public java.util.Map<java.lang.String,​FieldData> getFields()
        Gets the underlying Map for FieldData.
        Returns:
        a Map tying each field name to its FieldData