01 /*
02 * Copyright 2008-2015 the original author or authors.
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package griffon.core.resources;
17
18 import javax.annotation.Nonnull;
19 import java.util.List;
20
21 /**
22 * @author Andres Almiray
23 * @since 2.4.0
24 */
25 public interface GroovyAwareResourceResolver extends ResourceResolver {
26 /**
27 * Try to resolve the resource.
28 *
29 * @param key Key to lookup, such as 'sample.SampleModel.icon'
30 * @return The resolved resource at the given key for the default locale
31 * @throws NoSuchResourceException if no resource is found
32 */
33 @Nonnull
34 Object getAt(@Nonnull String key) throws NoSuchResourceException;
35
36 /**
37 * Try to resolve the resource.
38 *
39 * @param keyAndArgs Key to lookup, such as 'sample.SampleModel.icon' and arguments
40 * that will be filled in for params within the resource (params look like "{0}" within a
41 * resource, but this might differ between implementations), or null if none.
42 * @return The resolved resource at the given key for the default locale
43 * @throws NoSuchResourceException if no resource is found
44 */
45 @Nonnull
46 Object getAt(@Nonnull List<?> keyAndArgs) throws NoSuchResourceException;
47 }
|