public class ComponentClassResolverImpl extends Object implements ComponentClassResolver, InvalidationListener
Constructor and Description |
---|
ComponentClassResolverImpl(org.slf4j.Logger logger,
ClassNameLocator classNameLocator,
String startPageName,
Collection<LibraryMapping> mappings) |
Modifier and Type | Method and Description |
---|---|
String |
canonicalizePageName(String pageName)
Returns the canonical form of a page name.
|
List<String> |
getComponentNames()
Returns a list of all component names, in sorted order.
|
Map<String,ControlledPackageType> |
getControlledPackageMapping()
Used to identify which packages are controlled packages (from which components are loaded).
|
Map<String,String> |
getFolderToPackageMapping()
A mapping from virtual folder name to a package name (used for converting classpath
Asset s
to client URLs). |
Collection<LibraryMapping> |
getLibraryMappings()
Returns the library mappings.
|
String |
getLibraryNameForClass(String className)
Given a class name of a component class, returns the library name (as defined by a
contributed library name).
|
List<String> |
getLibraryNames()
Returns the names of all libraries (as configured).
|
List<String> |
getMixinNames()
Returns a list of all mixin names, in sorted order.
|
List<String> |
getPageNames()
Returns a list of all page names, in sorted order.
|
boolean |
isPage(String pageClassName)
Returns true if the class name is specifically a page class, and not a component, mixin or base class.
|
boolean |
isPageName(String pageName)
For a particular path, determines if the path is a logical page name.
|
void |
objectWasInvalidated()
When the class loader is invalidated, clear any cached page names or component types.
|
String |
resolveComponentTypeToClassName(String componentType)
Converts a component type (a logical component name such as might be used inside a template or annotation) into a
fully qualified class name.
|
String |
resolveMixinTypeToClassName(String mixinType)
Converts a logical mixin type (as with component types) into a fully qualified class name.
|
String |
resolvePageClassNameToPageName(String pageClassName)
Converts a fully qualified page class name into a page name (often, for inclusion as part of the URI).
|
String |
resolvePageNameToClassName(String pageName)
Converts a logical page name (such as might be encoded into a URL) into a fully qualified class name.
|
public ComponentClassResolverImpl(org.slf4j.Logger logger, ClassNameLocator classNameLocator, @Symbol(value="tapestry.start-page-name") String startPageName, Collection<LibraryMapping> mappings)
public Map<String,ControlledPackageType> getControlledPackageMapping()
ComponentClassResolver
getControlledPackageMapping
in interface ComponentClassResolver
ControlledPackageType
.public void objectWasInvalidated()
objectWasInvalidated
in interface InvalidationListener
public String resolvePageNameToClassName(String pageName)
ComponentClassResolver
resolvePageNameToClassName
in interface ComponentClassResolver
pageName
- page namepublic boolean isPageName(String pageName)
ComponentClassResolver
isPageName
in interface ComponentClassResolver
pageName
- potential logical page namepublic boolean isPage(String pageClassName)
ComponentClassResolver
isPage
in interface ComponentClassResolver
public List<String> getPageNames()
ComponentClassResolver
getPageNames
in interface ComponentClassResolver
public List<String> getComponentNames()
ComponentClassResolver
getComponentNames
in interface ComponentClassResolver
public List<String> getMixinNames()
ComponentClassResolver
getMixinNames
in interface ComponentClassResolver
public String resolveComponentTypeToClassName(String componentType)
ComponentClassResolver
resolveComponentTypeToClassName
in interface ComponentClassResolver
componentType
- a logical component typepublic String resolveMixinTypeToClassName(String mixinType)
ComponentClassResolver
resolveMixinTypeToClassName
in interface ComponentClassResolver
mixinType
- a logical mixin typepublic String resolvePageClassNameToPageName(String pageClassName)
ComponentClassResolver
ComponentClassResolver.resolvePageNameToClassName(String)
.resolvePageClassNameToPageName
in interface ComponentClassResolver
pageClassName
- fully qualified name of a page classpublic String canonicalizePageName(String pageName)
ComponentClassResolver
canonicalizePageName
in interface ComponentClassResolver
public Map<String,String> getFolderToPackageMapping()
ComponentClassResolver
Asset
s
to client URLs). This is derived from the contributed LibraryMapping
s.
It is allowed to contribute multiple root packages as a single folder name. In this case, the best common package
name is used. For example, if both com.example.main
and com.example.extras
is mapped to
folder "example", then the package mapping for "example" will be com.example
.getFolderToPackageMapping
in interface ComponentClassResolver
ClasspathAssetAliasManager
public List<String> getLibraryNames()
ComponentClassResolver
getLibraryNames
in interface ComponentClassResolver
public String getLibraryNameForClass(String className)
ComponentClassResolver
getLibraryNameForClass
in interface ComponentClassResolver
public Collection<LibraryMapping> getLibraryMappings()
ComponentClassResolver
getLibraryMappings
in interface ComponentClassResolver
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.