@@ -556,6 +556,33 @@ public Group produces(final String... types) {
556556 return this ;
557557 }
558558
559+ /**
560+ * Set route attribute.
561+ *
562+ * @param name Attribute's name.
563+ * @param value Attribute's value.
564+ * @return This instance.
565+ */
566+ public Group attr (final String name , final String value ) {
567+ for (Definition definition : routes ) {
568+ definition .attr (name , value );
569+ }
570+ return this ;
571+ }
572+
573+ /**
574+ * Tell jooby what renderer should use to render the output.
575+ *
576+ * @param name A renderer's name.
577+ * @return This instance.
578+ */
579+ public Group renderer (final String name ) {
580+ for (Definition definition : routes ) {
581+ definition .renderer (name );
582+ }
583+ return this ;
584+ }
585+
559586 private void newRoute (final String method , final String pattern ,
560587 final Route .Filter filter ) {
561588 newRoute (new Route .Definition (method , this .rootPattern + pattern , filter ));
@@ -594,15 +621,15 @@ private void newRoute(final Route.Definition route) {
594621 class Collection {
595622
596623 /** List of definitions. */
597- private Route .Definition [] definitions ;
624+ private Route .Definition [] routes ;
598625
599626 /**
600627 * Creates a new collection of route definitions.
601628 *
602629 * @param definitions Collection of route definitions.
603630 */
604- public Collection (final Route .Definition [] definitions ) {
605- this .definitions = requireNonNull (definitions , "Route definitions are required." );
631+ public Collection (final Route .Definition ... definitions ) {
632+ this .routes = requireNonNull (definitions , "Route definitions are required." );
606633 }
607634
608635 /**
@@ -612,7 +639,7 @@ public Collection(final Route.Definition[] definitions) {
612639 * @return This instance.
613640 */
614641 public Collection name (final String name ) {
615- for (Definition definition : definitions ) {
642+ for (Definition definition : routes ) {
616643 definition .name (name );
617644 }
618645 return this ;
@@ -625,7 +652,7 @@ public Collection name(final String name) {
625652 * @return This instance.
626653 */
627654 public Collection consumes (final MediaType ... types ) {
628- for (Definition definition : definitions ) {
655+ for (Definition definition : routes ) {
629656 definition .consumes (types );
630657 }
631658 return this ;
@@ -638,7 +665,7 @@ public Collection consumes(final MediaType... types) {
638665 * @return This instance.
639666 */
640667 public Collection consumes (final String ... types ) {
641- for (Definition definition : definitions ) {
668+ for (Definition definition : routes ) {
642669 definition .consumes (types );
643670 }
644671 return this ;
@@ -651,7 +678,7 @@ public Collection consumes(final String... types) {
651678 * @return This instance.
652679 */
653680 public Collection produces (final MediaType ... types ) {
654- for (Definition definition : definitions ) {
681+ for (Definition definition : routes ) {
655682 definition .produces (types );
656683 }
657684 return this ;
@@ -664,11 +691,39 @@ public Collection produces(final MediaType... types) {
664691 * @return This instance.
665692 */
666693 public Collection produces (final String ... types ) {
667- for (Definition definition : definitions ) {
694+ for (Definition definition : routes ) {
668695 definition .produces (types );
669696 }
670697 return this ;
671698 }
699+
700+ /**
701+ * Set route attribute.
702+ *
703+ * @param name Attribute's name.
704+ * @param value Attribute's value.
705+ * @return This instance.
706+ */
707+ public Collection attr (final String name , final String value ) {
708+ for (Definition definition : routes ) {
709+ definition .attr (name , value );
710+ }
711+ return this ;
712+ }
713+
714+ /**
715+ * Tell jooby what renderer should use to render the output.
716+ *
717+ * @param name A renderer's name.
718+ * @return This instance.
719+ */
720+ public Collection renderer (final String name ) {
721+ for (Definition definition : routes ) {
722+ definition .renderer (name );
723+ }
724+ return this ;
725+ }
726+
672727 }
673728
674729 /**
0 commit comments