Class DefaultSourceUrlResolver
java.lang.Object
com.flowingcode.vaadin.addons.demo.DefaultSourceUrlResolver
- All Implemented Interfaces:
SourceUrlResolver
Implementation of
SourceUrlResolver.
If no value or clazz is specified, and the demo view is annotated with
GithubLink, then the source URL defaults to the location of the annotated class under
src/test/java and the branch is determined from the value of GithubBranch in the
demo view class (if the annotation is present) or the containing package of the demo view class.
If the source URL is defaulted and no GithubBranch annotation is present either in the
demo view class or its containing package, then the branch defaults to master.
- Author:
- Javier Godoy / Flowing Code
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolveURL(TabbedDemo demo, Class<?> annotatedClass, DemoSource annotation) Resolves the source URL for a given demo class and annotation.resolveURL(Class<? extends TabbedDemo> viewClass, Class<?> annotatedClass, DemoSource annotation)
-
Constructor Details
-
DefaultSourceUrlResolver
public DefaultSourceUrlResolver()
-
-
Method Details
-
resolveURL
Description copied from interface:SourceUrlResolverResolves the source URL for a given demo class and annotation.- Specified by:
resolveURLin interfaceSourceUrlResolver- Parameters:
demo- TheTabbedDemoview requesting the URL resolution.annotatedClass- The class that is annotated withDemoSource.annotation- TheDemoSourceannotation providing source metadata.- Returns:
- An
Optionalcontaining the resolved URL if available, otherwise an emptyOptional.
-
resolveURL
public Optional<String> resolveURL(Class<? extends TabbedDemo> viewClass, Class<?> annotatedClass, DemoSource annotation)
-