private void addIntervalPattern ( MethodSpec . Builder method , List < Node > pattern , String which ) { for ( Node node : pattern ) { if ( node instanceof Text ) { method . addStatement ( "b.append($S)" , ( ( Text ) node ) . text ( ) ) ; } else if ( node instanceof Field ) { Field field = ( Field ) node ; method . addStatement ( "formatField($L, '$L', $L, b)" , which , field . ch ( ) , field . width ( ) ) ; } } }
Adds code to format a date time interval pattern which may be the start or end date time signified by the which parameter .