Skip to content

Commit 6c14b03

Browse files
committed
Add documentation to writeSetterIfNotDefault
1 parent 3225a13 commit 6c14b03

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main/java/com/j256/ormlite/android/processor/OrmLiteAnnotationProcessor.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,25 @@ private void writeTable(Writer writer, TableBindings table)
652652
writer.write("}\n");
653653
}
654654

655+
/**
656+
* This function examines a single field in an annotation and if the current
657+
* value doesn't match the default, outputs a setter call. It returns
658+
* whether it output the setter call in case calling code needs to fall back
659+
* on another field only if the primary field wasn't set (e.g. a deprecated
660+
* field and its replacement).
661+
*
662+
* @param annotation
663+
* the annotation containing the field of interest
664+
* @param annotationFieldName
665+
* the name of the field in the annotation to read
666+
* @param setterCall
667+
* a format string describing the code that should be emitted to
668+
* set this property in the table configuration
669+
* @param writer
670+
* the writer for the generated file
671+
* @return true if the value was not the default and a setter was emitted,
672+
* false if the field had the default value
673+
*/
655674
private boolean writeSetterIfNotDefault(Annotation annotation,
656675
String annotationFieldName, String setterCall, Writer writer) {
657676
try {

0 commit comments

Comments
 (0)