Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.internal.services
Class ComponentClassResolverImpl

    java.lang.Object
      org.apache.tapestry5.internal.services.ComponentClassResolverImpl

All Implemented Interfaces:
  ComponentClassResolver, InvalidationListener

    public class ComponentClassResolverImpl

extends java.lang.Object
implements ComponentClassResolver, InvalidationListener

Constructor Summary
`ComponentClassResolverImpl(org.slf4j.Logger logger, ClassNameLocator classNameLocator, java.lang.String startPageName, java.util.Collection<LibraryMapping> mappings)`

Method Summary
`java.lang.String` | `canonicalizePageName(java.lang.String pageName)` Returns the canonical form of a page name.
`java.util.Map<java.lang.String,ControlledPackageType>` | `getControlledPackageMapping()` Used to identify which packages are controlled packages (from which components are loaded).
`java.util.Map<java.lang.String,java.lang.String>` | `getFolderToPackageMapping()` A mapping from virtual folder name to a package name (used for converting classpath `Asset`s to client URLs).
`java.util.List<java.lang.String>` | `getPageNames()` Returns a list of all page names, in sorted order.
`boolean` | `isPage(java.lang.String pageClassName)` Returns true if the class name is specifically a page class, and not a component, mixin or base class.
`boolean` | `isPageName(java.lang.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.
`java.lang.String` | `resolveComponentTypeToClassName(java.lang.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.
`java.lang.String` | `resolveMixinTypeToClassName(java.lang.String mixinType)` Converts a logical mixin type (as with component types) into a fully qualified class name.
`java.lang.String` | `resolvePageClassNameToPageName(java.lang.String pageClassName)` Converts a fully qualified page class name into a page name (often, for inclusion as part of the URI).
`java.lang.String` | `resolvePageNameToClassName(java.lang.String pageName)` Converts a logical page name (such as might be encoded into a URL) into a fully qualified class name.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ComponentClassResolverImpl

    public ComponentClassResolverImpl(org.slf4j.Logger logger,
                                      ClassNameLocator classNameLocator,
                                      @Symbol(value="tapestry.start-page-name")
                                      java.lang.String startPageName,
                                      java.util.Collection<LibraryMapping> mappings)

Method Detail

### getControlledPackageMapping

    public java.util.Map<java.lang.String,ControlledPackageType> getControlledPackageMapping()

  Description copied from interface: `ComponentClassResolver`
  Used to identify which packages are controlled packages (from which components are loaded). Future expansion may allow for additional packages which are live reloaded but not components (or perhaps are transformed, but not as components).

  Specified by:
    `getControlledPackageMapping` in interface `ComponentClassResolver`
  Returns:
    a mapping from package name to `ControlledPackageType`.

### objectWasInvalidated

    public void objectWasInvalidated()

  When the class loader is invalidated, clear any cached page names or component types.

  Specified by:
    `objectWasInvalidated` in interface `InvalidationListener`

### resolvePageNameToClassName

    public java.lang.String resolvePageNameToClassName(java.lang.String pageName)

  Description copied from interface: `ComponentClassResolver`
  Converts a logical page name (such as might be encoded into a URL) into a fully qualified class name. The case of the page name is irrelevant.

  Specified by:
    `resolvePageNameToClassName` in interface `ComponentClassResolver`
  Parameters:
    `pageName` - page name
  Returns:
    fully qualified class name for the page

### isPageName

    public boolean isPageName(java.lang.String pageName)

  Description copied from interface: `ComponentClassResolver`
  For a particular path, determines if the path is a logical page name. The check is case insensitive.

  Specified by:
    `isPageName` in interface `ComponentClassResolver`
  Parameters:
    `pageName` - potential logical page name
  Returns:
    true if the page name is valid

### isPage

    public boolean isPage(java.lang.String pageClassName)

  Description copied from interface: `ComponentClassResolver`
  Returns true if the class name is specifically a page class, and not a component, mixin or base class.

  Specified by:
    `isPage` in interface `ComponentClassResolver`
  Returns:
    true if a page class

### getPageNames

    public java.util.List<java.lang.String> getPageNames()

  Description copied from interface: `ComponentClassResolver`
  Returns a list of all page names, in sorted order.

  Specified by:
    `getPageNames` in interface `ComponentClassResolver`

### resolveComponentTypeToClassName

    public java.lang.String resolveComponentTypeToClassName(java.lang.String componentType)

  Description copied from interface: `ComponentClassResolver`
  Converts a component type (a logical component name such as might be used inside a template or annotation) into a fully qualified class name. Case is ignored in resolving the name.

  Specified by:
    `resolveComponentTypeToClassName` in interface `ComponentClassResolver`
  Parameters:
    `componentType` - a logical component type
  Returns:
    fully qualified class name

### resolveMixinTypeToClassName

    public java.lang.String resolveMixinTypeToClassName(java.lang.String mixinType)

  Description copied from interface: `ComponentClassResolver`
  Converts a logical mixin type (as with component types) into a fully qualified class name. Case is ignored when resolving the name.

  Specified by:
    `resolveMixinTypeToClassName` in interface `ComponentClassResolver`
  Parameters:
    `mixinType` - a logical mixin type
  Returns:
    fully qualified class name

### resolvePageClassNameToPageName

    public java.lang.String resolvePageClassNameToPageName(java.lang.String pageClassName)

  Description copied from interface: `ComponentClassResolver`
  Converts a fully qualified page class name into a page name (often, for inclusion as part of the URI). This value may later be passed to `ComponentClassResolver.resolvePageNameToClassName(String)`.

  Specified by:
    `resolvePageClassNameToPageName` in interface `ComponentClassResolver`
  Parameters:
    `pageClassName` - fully qualified name of a page class
  Returns:
    equivalent logical page name

### canonicalizePageName

    public java.lang.String canonicalizePageName(java.lang.String pageName)

  Description copied from interface: `ComponentClassResolver`
  Returns the canonical form of a page name. The canonical form uses character case matching the underlying class name.

  Specified by:
    `canonicalizePageName` in interface `ComponentClassResolver`

### getFolderToPackageMapping

    public java.util.Map<java.lang.String,java.lang.String> getFolderToPackageMapping()

  Description copied from interface: `ComponentClassResolver`
  A mapping from virtual folder name to a package name (used for converting classpath `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`.

  Specified by:
    `getFolderToPackageMapping` in interface `ComponentClassResolver`
  See Also:
    `ClasspathAssetAliasManager`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.