Class FieldSummary

java.lang.Object
redempt.redlib.config.instantiation.FieldSummary

public class FieldSummary extends Object
Represents a summary of the relevant fields, converters, and other info required to load objects from config
  • Method Details

    • getComments

      public static List<String> getComments(Field field)
      Gets the comments applied to a field
      Parameters:
      field - The Field
      Returns:
      The comments applied to the field
    • getComments

      public static List<String> getComments(Parameter param)
      Gets the comments applied to a parameter
      Parameters:
      param - The Parameter
      Returns:
      The comments applied to the parameter
    • getFieldSummary

      public static FieldSummary getFieldSummary(ConversionManager manager, Class<?> clazz, boolean staticContext)
      Generates a FieldSummary of a class
      Parameters:
      manager - The ConversionManager with access to converters
      clazz - The class being summarized
      staticContext - Whether static fields should be retrieved instead of member fields
      Returns:
      A field summary
    • getFields

      public List<ConfigField> getFields()
      Returns:
      The ConfigFields that should be loaded to
    • getConverters

      public Map<ConfigField,TypeConverter<?>> getConverters()
      Returns:
      The converters for all the field types
    • getConfigPath

      public Field getConfigPath()
      Returns:
      The ConfigPath field, if one exists
    • getConfigPathConverter

      public StringConverter<?> getConfigPathConverter()
      Returns:
      The converter for the ConfigPath field, if it exists
    • getPostInit

      public Method getPostInit()
      Returns:
      The post-init method, if it exists
    • applyComments

      public void applyComments(DataHolder holder)
      Attempts to apply comments to the given DataHolder
      Parameters:
      holder - The DataHolder to apply comments to