Package ftbsc.lll.mapper.data
Class ClassData
- java.lang.Object
-
- ftbsc.lll.mapper.data.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 underlyingMap
forFieldData
.java.util.Map<MethodSignature,MethodData>
getMethods()
Gets the underlyingMap
forMethodData
.FieldData
mapField(java.lang.String fieldName)
Gets theFieldData
its name.MethodData
mapMethod(java.lang.String methodName, java.lang.String methodDescriptor)
Gets theMethodData
from its name and descriptor, which may be partial (i.e.
-
-
-
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 namenameMapped
- the mapped method namedescriptor
- 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 fieldmapped
- 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 fieldmapped
- the mapped name of the fielddescriptor
- 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 theMethodData
from its name and descriptor, which may be partial (i.e. not include the return type).- Parameters:
methodName
- the method namemethodDescriptor
- the method descriptor, which may be partial- Returns:
- the requested
MethodData
- Throws:
MappingNotFoundException
- if the mapping wasn't found
-
mapField
public FieldData mapField(java.lang.String fieldName)
Gets theFieldData
its name.- Parameters:
fieldName
- the field name- Returns:
- the requested
FieldData
- Throws:
MappingNotFoundException
- if the mapping wasn't found
-
getMethods
public java.util.Map<MethodSignature,MethodData> getMethods()
Gets the underlyingMap
forMethodData
.- Returns:
- a
Map
tying eachMethodSignature
to itsMethodData
-
-