protected void createGetterMethod ( ClassNode declaringClass , PropertyNode propertyNode , String getterName , Statement getterBlock , List < AnnotationNode > annotations ) { int mod = propertyNode . getModifiers ( ) | Modifier . FINAL ; MethodNode getter = new MethodNode ( getterName , mod , propertyNode . getType ( ) , Parameter . EMPTY_ARRAY , ClassNode . EMPTY_ARRAY , getterBlock ) ; if ( annotations != null ) getter . addAnnotations ( annotations ) ; getter . setSynthetic ( true ) ; declaringClass . addMethod ( getter ) ; }
Creates a getter method and adds it to the declaring class .