Class RecordDTOInfo

java.lang.Object
org.tentackle.buildsupport.RecordDTOInfo

public class RecordDTOInfo extends Object
Holds information gathered by the @RecordDTO annotation.
  • Field Details

  • Constructor Details

    • RecordDTOInfo

      public RecordDTOInfo()
      Creates an RecordDTOInfo for a given type. Used when reading from infofile.
    • RecordDTOInfo

      public RecordDTOInfo(ProcessingEnvironment processingEnv, TypeElement recordElement)
      Creates an RecordDTOInfo from a method element. Used during apt processing.
      Parameters:
      processingEnv - the annotation processor's environment
      recordElement - the record type element
  • Method Details

    • readInfo

      public static RecordDTOInfo readInfo(File infoFile) throws IOException
      Reads info from a file.
      Parameters:
      infoFile - the file to read from
      Returns:
      an RecordDTOInfo object, null if file is empty or does not contain an RecordDTOInfo-text
      Throws:
      IOException - if reading failed
    • readInfo

      public static RecordDTOInfo readInfo(LineNumberReader reader) throws IOException
      Reads info from a line reader.
      Parameters:
      reader - is the LineNumberReader
      Returns:
      the record info, null if file is empty or does not contain such info
      Throws:
      IOException - if reading failed
    • getRecordName

      public String getRecordName()
      Gets the name of the class this analyze-info is part of.
      Returns:
      the classname
    • setRecordName

      public void setRecordName(String recordName)
      Sets the classname and the packagename from a given classname.
      Parameters:
      recordName - the full class name
    • getParameters

      public RecordDTOInfoParameter[] getParameters()
      Gets the formal parameters of the method.
      Returns:
      the array of parameters
    • addParameter

      public void addParameter(RecordDTOInfoParameter parameter)
      Adds a formal parameter
      Parameters:
      parameter - the formal parameter to add
    • toString

      public String toString()
      Gets the declaration string.

      Overrides:
      toString in class Object
    • write

      public void write(PrintWriter writer)
      Writes this object to an info file.
      Parameters:
      writer - is the PrintWriter object