public final class AutoLinkResolver extends Object implements IComponentResolver
If href points to a *.html file, a BookmarkablePageLink> will automatically be created, except for absolute paths, where an ExternalLink is created.
If href points to a *.html file, it resolves the given URL by searching for a page class, either relative or absolute, specified by the href attribute of the tag. If relative the href URL must be relative to the package containing the associated page. An exception is thrown if no Page class was found.
If href is no *.html file a static reference to the resource is created.
WicketLinkTagHandler
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
AutoLinkResolver.AbstractAutolinkResolverDelegate
Abstract implementation that has a helper method for creating a resource reference.
|
static class |
AutoLinkResolver.AutolinkBookmarkablePageLink<T>
Autolink components delegate component resolution to their parent components.
|
static interface |
AutoLinkResolver.IAutolinkResolverDelegate
Interface to delegate the actual resolving of auto components to.
|
static class |
AutoLinkResolver.PathInfo
Encapsulates different aspects of a path.
|
Constructor and Description |
---|
AutoLinkResolver()
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
addTagReferenceResolver(String tagName,
String attributeName,
AutoLinkResolver.IAutolinkResolverDelegate resolver)
Register (add or replace) a new resolver with the tagName and attributeName.
|
AutoLinkResolver.IAutolinkResolverDelegate |
getAutolinkResolverDelegate(String tagName)
Get the resolver registered for 'tagName'
|
Component |
resolve(MarkupContainer container,
MarkupStream markupStream,
ComponentTag tag)
Try to resolve a component.
|
public final void addTagReferenceResolver(String tagName, String attributeName, AutoLinkResolver.IAutolinkResolverDelegate resolver)
tagName
- The tag nameattributeName
- The attribute nameresolver
- Implements what to do based on the tag and the attributepublic final AutoLinkResolver.IAutolinkResolverDelegate getAutolinkResolverDelegate(String tagName)
tagName
- The tag's namepublic final Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag)
IComponentResolver
resolve
in interface IComponentResolver
container
- The container parsing its markupmarkupStream
- The current markupStreamtag
- The current component tag while parsing the markupnull
if not foundIComponentResolver.resolve(org.apache.wicket.MarkupContainer,
org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag)
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.