001// Copyright 2005 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.tapestry.annotations;
016
017import java.lang.annotation.Documented;
018import java.lang.annotation.ElementType;
019import java.lang.annotation.Retention;
020import java.lang.annotation.RetentionPolicy;
021import java.lang.annotation.Target;
022
023/**
024 * Defines a new asset. The asset will have the same name as the property (and will be accessible
025 * via the "asset:" binding prefix, or using {@link org.apache.tapestry.IComponent#getAsset(String)},
026 * with that name).
027 * <p>
028 * Note: if we ever rename IAsset to Asset, this will cause a naming conflict. Perhaps we should
029 * come up with annotation names that are compatible with a potential rename.
030 * 
031 * @author Howard M. Lewis Ship
032 * @since 4.0
033 */
034
035@Target(
036{ ElementType.METHOD })
037@Retention(RetentionPolicy.RUNTIME)
038@Documented
039public @interface Asset {
040
041    /**
042     * The value is the asset path, which may include a prefix to define the module in which it can
043     * be resolved.
044     */
045
046    String value();
047}