This project has retired. For details please refer to its Attic page.
AttributeResolver xref
View Javadoc

1   /*
2    * $Id: AttributeResolver.java 765774 2009-04-16 21:43:00Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  package org.apache.tiles.template;
23  
24  import org.apache.tiles.Attribute;
25  import org.apache.tiles.TilesContainer;
26  
27  /***
28   * Resolves an attribute, depending on the given parameters.
29   *
30   * @version $Rev: 765774 $ $Date: 2009-04-16 23:43:00 +0200 (gio, 16 apr 2009) $
31   * @since 2.2.0
32   */
33  public interface AttributeResolver {
34  
35      /***
36       * Computes the attribute.
37       *
38       * @param container The Tiles container to use.
39       * @param attribute The attribute to return immediately, if not null.
40       * @param name The name of the attribute.
41       * @param role A comma-separated list of roles. If present, the attribute
42       * will be rendered only if the current user belongs to one of the roles.
43       * @param ignore If <code>true</code> if the computed attribute is null, this problem will be ignored.
44       * @param defaultValue The default value of the attribute. To use only if the attribute was not computed.
45       * @param defaultValueRole The default comma-separated list of roles. To use only if the attribute was not computed.
46       * @param defaultValueType The default type of the attribute. To use only if the attribute was not computed.
47       * @param requestItems The request objects.
48       * @return The computed attribute.
49       * @since 2.2.0
50       */
51      Attribute computeAttribute(TilesContainer container, Attribute attribute,
52              String name, String role, boolean ignore,
53              Object defaultValue, String defaultValueRole, String defaultValueType, Object... requestItems);
54  }