org.apache.myfaces.trinidad.share.io
Interface NameResolver


public interface NameResolver

NameResolvers are responsible for converting string names into InputStreamProviders, which encapsulate a remote file. Implementations exist that support using URLs, Files, Class resources, and the Servlet API to locate files, but other APIs may be substituted.

In some cases, the resolved target file may have need to locate support files of its own (like imported css files). Since those support files should be looked for relative to the target file, NameResolver supports creating new relative NameResolvers.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/io/NameResolver.java#0 $) $Date: 10-nov-2005.19:00:09 $

Method Summary
 InputStreamProvider getProvider(String name)
          Given a name, returns an InputStreamProvider.
 NameResolver getResolver(String name)
          Return the new NameResolver that should be used to resolve names relative to a given name.
 

Method Detail

getProvider

InputStreamProvider getProvider(String name)
                                throws IOException
Given a name, returns an InputStreamProvider. This function should never return null - if the target cannot be resolved, throw an IOException.

Parameters:
name - the name of the target
Throws:
IOException

getResolver

NameResolver getResolver(String name)
Return the new NameResolver that should be used to resolve names relative to a given name. For example, if a css file has an @import, you need to look for the imported file relative to the file. This function should never return null - if the target cannot be resolved, return a resolver that can only support absolute names.

Parameters:
name - the name of the target


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.