001// Copyright 2007, 2008, 2009 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.tapestry5; 016 017/** 018 * Constants for the built-in binding prefixes. These are often used with the {@link 019 * org.apache.tapestry5.annotations.Parameter#defaultPrefix()} annotation attribute. 020 */ 021public class BindingConstants 022{ 023 /** 024 * Binding expression prefix used for literal strings. 025 */ 026 public static final String LITERAL = "literal"; 027 /** 028 * Binding expression prefix used to bind to a property of the component. When {@link 029 * org.apache.tapestry5.annotations.Parameter#defaultPrefix()} is not specified, the default is PROP. 030 */ 031 public static final String PROP = "prop"; 032 033 /** 034 * A way of selecting a named {@link org.apache.tapestry5.NullFieldStrategy} contributed to {@link 035 * org.apache.tapestry5.services.NullFieldStrategySource}. 036 */ 037 public static final String NULLFIELDSTRATEGY = "nullfieldstrategy"; 038 039 /** 040 * A reference to a component within the container's template, by local component id. 041 */ 042 public static final String COMPONENT = "component"; 043 044 /** 045 * A reference to a localized message from the component's message catalog (including message keys inherited from 046 * the application global message catalog). 047 */ 048 public static final String MESSAGE = "message"; 049 050 /** 051 * References (and configures) one ore more named {@link org.apache.tapestry5.Validator}s contributed to the {@link 052 * org.apache.tapestry5.services.FieldValidatorSource} service. 053 * 054 * @see org.apache.tapestry5.services.FieldValidatorSource 055 */ 056 public static final String VALIDATE = "validate"; 057 058 /** 059 * References a named {@link org.apache.tapestry5.Translator} contributed to the {@link 060 * org.apache.tapestry5.services.TranslatorSource} service. The binding is of type {@link 061 * org.apache.tapestry5.FieldTranslator}. 062 */ 063 public static final String TRANSLATE = "translate"; 064 065 /** 066 * References a named block within the template. 067 */ 068 public static final String BLOCK = "block"; 069 070 /** 071 * References a localized asset. The asset will be relative to the component's class file, unless a prefix 072 * (typically, "context:") is used on the expression. Typically, this is used for classpath assets relative to 073 * the component class, and {@link #CONTEXT} is used for context assets. 074 * 075 * @see org.apache.tapestry5.Asset 076 * @see org.apache.tapestry5.services.AssetSource 077 */ 078 public static final String ASSET = "asset"; 079 080 /** 081 * Allows for temporary storage of information during the render only (may not currently be used during form 082 * submission processing). This is often used to store the current object iterated over by a {@link 083 * org.apache.tapestry5.corelib.components.Loop} component. 084 */ 085 public static final String VAR = "var"; 086 087 /** 088 * Binding factory for context assets specifically. The expression is the path from the root of the web 089 * application. 090 * 091 * @since 5.1.0.0 092 */ 093 public static final String CONTEXT = "context"; 094 095 096 /** 097 * References a value of a symbol. 098 * 099 * @since 5.2.0 100 */ 101 public static final String SYMBOL = "symbol"; 102}