Package org.tentackle.buildsupport
Class RecordDTOInfo
java.lang.Object
org.tentackle.buildsupport.RecordDTOInfo
Holds information gathered by the
@RecordDTO annotation.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an RecordDTOInfo for a given type.RecordDTOInfo(ProcessingEnvironment processingEnv, TypeElement recordElement) Creates an RecordDTOInfo from a method element. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(RecordDTOInfoParameter parameter) Adds a formal parameterGets the formal parameters of the method.Gets the name of the class this analyze-info is part of.static RecordDTOInfoReads info from a file.static RecordDTOInforeadInfo(LineNumberReader reader) Reads info from a line reader.voidsetRecordName(String recordName) Sets the classname and the packagename from a given classname.toString()Gets the declaration string.voidwrite(PrintWriter writer) Writes this object to an info file.
-
Field Details
-
INFO_FILE_VERSION
File-format version- See Also:
-
INFO_FILE_NAME
Name of all record DTO info files.- See Also:
-
-
Constructor Details
-
RecordDTOInfo
public RecordDTOInfo()Creates an RecordDTOInfo for a given type. Used when reading from infofile. -
RecordDTOInfo
Creates an RecordDTOInfo from a method element. Used during apt processing.- Parameters:
processingEnv- the annotation processor's environmentrecordElement- the record type element
-
-
Method Details
-
readInfo
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
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
Gets the name of the class this analyze-info is part of.- Returns:
- the classname
-
setRecordName
Sets the classname and the packagename from a given classname.- Parameters:
recordName- the full class name
-
getParameters
Gets the formal parameters of the method.- Returns:
- the array of parameters
-
addParameter
Adds a formal parameter- Parameters:
parameter- the formal parameter to add
-
toString
Gets the declaration string. -
write
Writes this object to an info file.- Parameters:
writer- is the PrintWriter object
-