01: package org.objectweb.celtix.resource;
02:
03: import java.io.InputStream;
04:
05: /**
06: * Resolves resource. A ResourceResolver is used to find references
07: * to resources that are being injected into classes
08: *
09: */
10: public interface ResourceResolver {
11:
12: /**
13: * Resolve a resource given its name and type.
14: *
15: * @param resourceName name of the resource to resolve.
16: * @param resourceType type of the resource to resolve.
17: * @return an instance of the resource or <code>null</code> if the
18: * resource cannot be resolved.
19: */
20: <T> T resolve(String resourceName, Class<T> resourceType);
21:
22: /**
23: * Resolve a resource given its name and return an InputStream to it.
24: *
25: * @param resourceName name of the resource to resolve.
26: * @return an InputStream for the resource or null if it could not be found.
27: */
28: InputStream getAsStream(String name);
29: }
|