4242import com .vaadin .flow .router .internal .NavigationRouteTarget ;
4343import com .vaadin .flow .router .internal .PathUtil ;
4444import com .vaadin .flow .router .internal .RouteTarget ;
45+ import com .vaadin .flow .server .ErrorRouteRegistry ;
4546import com .vaadin .flow .server .PWA ;
4647import com .vaadin .flow .server .VaadinContext ;
4748
5152 *
5253 * @since 1.3
5354 */
54- public class ApplicationRouteRegistry extends AbstractRouteRegistry {
55+ public class ApplicationRouteRegistry extends AbstractRouteRegistry
56+ implements ErrorRouteRegistry {
5557
5658 private AtomicReference <Class <?>> pwaConfigurationClass = new AtomicReference <>();
5759 private static final Set <Class <? extends Component >> defaultErrorHandlers = Stream
@@ -168,15 +170,7 @@ private boolean allErrorFiltersMatch(Class<? extends Component> target) {
168170 .allMatch (filter -> filter .testErrorNavigationTarget (target ));
169171 }
170172
171- /**
172- * Get a registered navigation target for given exception. First we will
173- * search for a matching cause for in the exception chain and if no match
174- * found search by extended type.
175- *
176- * @param exception
177- * exception to search error view for
178- * @return optional error target entry corresponding to the given exception
179- */
173+ @ Override
180174 public Optional <ErrorTargetEntry > getErrorNavigationTarget (
181175 Exception exception ) {
182176 if (getConfiguration ().getExceptionHandlers ().isEmpty ()) {
@@ -189,30 +183,6 @@ public Optional<ErrorTargetEntry> getErrorNavigationTarget(
189183 return result ;
190184 }
191185
192- @ Override
193- public NavigationRouteTarget getNavigationRouteTarget (String url ) {
194- return getConfiguration ().getNavigationRouteTarget (url );
195- }
196-
197- @ Override
198- public RouteTarget getRouteTarget (Class <? extends Component > target ,
199- RouteParameters parameters ) {
200- return getConfiguration ().getRouteTarget (target , parameters );
201- }
202-
203- @ Override
204- public Optional <Class <? extends Component >> getNavigationTarget (
205- String url ) {
206- Objects .requireNonNull (url , "url must not be null." );
207- return getConfiguration ().getTarget (url );
208- }
209-
210- @ Override
211- public Optional <Class <? extends Component >> getNavigationTarget (String url ,
212- List <String > segments ) {
213- return getNavigationTarget (PathUtil .getPath (url , segments ));
214- }
215-
216186 /**
217187 * Check if there are registered navigation targets in the registry.
218188 *
0 commit comments