1/*2 * $Id: AbstractTypeDetectingAttributeRenderer.java 821299 2009-10-03 12:15:05Z apetrelli $3 *4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122package org.apache.tiles.renderer.impl;
2324import org.apache.tiles.Attribute;
25import org.apache.tiles.context.TilesRequestContext;
26import org.apache.tiles.evaluator.AttributeEvaluator;
27import org.apache.tiles.renderer.TypeDetectingAttributeRenderer;
2829/***30 * Abstract implementation of {@link TypeDetectingAttributeRenderer} that31 * implements {@link #isRenderable(Attribute, TilesRequestContext)} to delegate32 * to {@link #isRenderable(Object, Attribute, TilesRequestContext)}.33 *34 * @version $Rev: 821299 $ $Date: 2009-10-03 14:15:05 +0200 (sab, 03 ott 2009) $35 * @since 2.2.136 */37publicabstractclassAbstractTypeDetectingAttributeRendererextends38AbstractBaseAttributeRenderer implements TypeDetectingAttributeRenderer {
3940/*** {@inheritDoc} */41publicboolean isRenderable(Attribute attribute, TilesRequestContext request) {
42AttributeEvaluator evaluator = attributeEvaluatorFactory
43 .getAttributeEvaluator(attribute);
44 Object value = evaluator.evaluate(attribute, request);
45return isRenderable(value, attribute, request);
46 }
47 }