/** * Provides an easy way to set a default JSONObject-type params for one of your mixin. * It will be use with the Widget Class. * * @since 2.6.0 * @author Emmanuel DEMEY */ @UsesMappedConfiguration(value = JSONObject.class) public interface WidgetParams { public abstract JSONObject paramsForWidget(String widget); }
/** * @author Emmanuel DEMEY * Service used by the jQueryJavaScriptStack for retrieving the jQuery version of a Prototype/Scriptaculous JavaScript file. */ @UsesMappedConfiguration(value = String.class) public interface JavaScriptFilesConfiguration { public abstract Asset getAsset(Asset original); }
/** * A source for value encoders based on a property type. */ @UsesMappedConfiguration(key=Class.class, value=ValueEncoderFactory.class) public interface ValueEncoderSource { /** * Gets or creates a value encoder for the indicated type. ValueEncoders are cached. * * @param type type of value to be encoded and decoded * @return the value encoder */ <T> ValueEncoder<T> getValueEncoder(Class<T> type); }
/** * Used globally to track what compatibility traits are enabled. By default, in Tapestry 5.4, * all traits are enabled unless explicitly disabled. This behavior may change in Tapestry 5.5. * * The configuration allows traits to be explicitly enabled or disabled. * * @since 5.4 */ @UsesMappedConfiguration(key = Trait.class, value = Boolean.class) public interface Compatibility { /** * Returns true if the indicated compatibility trait is enabled. * * @param trait * @return true if enabled, false otherwise */ boolean enabled(Trait trait); }
/** * Provides access to user defined lifecycles (beyond the two built-in lifecycles: "singleton" and "primitive"). The * user defined lifecycles are contributed into the service's configuration. * * Note that the default scope {@linkplain org.apache.tapestry5.ioc.ScopeConstants#DEFAULT "singleton"} is special and * not a contribution. */ @UsesMappedConfiguration(ServiceLifecycle.class) public interface ServiceLifecycleSource { /** * Used to locate a configuration lifecycle, by name. * * @param scope * @return the named lifecycle, or null if the name is not found */ ServiceLifecycle get(String scope); }
/** * A source for {@link org.apache.tapestry5.NullFieldStrategy} instances based on a logical name. */ @UsesMappedConfiguration(NullFieldStrategy.class) public interface NullFieldStrategySource { /** * Returns the instance based on the name. Instances are expected to be stateless and therefore, shareable and * thread safe. * * @param name name of the strategy (case is ignored) * @return the strategy * @throws IllegalArgumentException if the name does not match a configured instance */ NullFieldStrategy get(String name); }
/** * Service that makes it easy to identify a class annotation and use its presence, or the value of an attribute, * to set a meta-data key. The configuration map class annotation types to corresponding extractors who will be invoked * when the annotation is present. Most commonly, a {@link FixedExtractor} is used to set a fixed value to a fixed key, * triggered by the presence of the corresponding annotation. * * @since 5.2.0 */ @UsesMappedConfiguration(key = Class.class, value = MetaDataExtractor.class) public interface MetaWorker { /** * Returns the worker that performs transformations (in 5.2, MetaWorker implemented ComponentClassTransformWorker). * * @return worker that implements the meta data analysis */ ComponentClassTransformWorker2 getWorker(); }
/** * A provider of values for symbols, used by the {@link org.apache.tapestry5.ioc.services.SymbolSource} service. * * This is the service interface for the FactoryDefaults and ApplicationDefaults services; each of these takes a * configuration mapping symbols to their values. * * @see FactoryDefaults * @see ApplicationDefaults */ @UsesMappedConfiguration(String.class) public interface SymbolProvider { /** * Returns the value for the symbol, or null if this provider can not provide a value. The value itself may contain * symbols that will be recursively expanded. * * @param symbolName * @return the value or null */ String valueForSymbol(String symbolName); }
/** * Used to override built in services. Simply contribute a mapping from a type to an instance of that type. Anywhere * that exact type is injected, without specifying markers or other annotations, the contributed instance will be * injected, even if there is already a service that implements the interface. * * In fact, this is <em>not</em> limited to overriding services; any object that can be injected based solely on type * can be contributed. * * @since 5.1.0.0 */ @UsesMappedConfiguration(key = Class.class, value = Object.class) public interface ServiceOverride { /** * Returns a provider based on the configuration; this is wired into the * {@link org.apache.tapestry5.ioc.services.MasterObjectProvider}'s configuration. */ ObjectProvider getServiceOverrideProvider(); }
/** * Provides some assistance in determining <em>where</em> to place a hidden field based on standard (X)HTML elements. * * The service works based on a mapped service contribution; keys are the element names, values area {@link * org.apache.tapestry5.services.RelativeElementPosition}. */ @UsesMappedConfiguration(RelativeElementPosition.class) public interface HiddenFieldLocationRules { /** * Checks the element to see if a hidden field may be placed inside the element. */ boolean placeHiddenFieldInside(Element element); /** * Checks the element to see if a hidden field may be placed after the element (as a sibling element). */ boolean placeHiddenFieldAfter(Element element); }
/** * A provider of values for symbols, used by the {@link org.apache.tapestry5.ioc.services.SymbolSource} service. * * This is the service interface for the FactoryDefaults and ApplicationDefaults services; each of these takes a * configuration mapping symbols to their values. * * @see FactoryDefaults * @see ApplicationDefaults */ @UsesMappedConfiguration(String.class) public interface SymbolProvider { /** * Returns the value for the symbol, or null if this provider can not provide a value. The value itself may contain * symbols that will be recursively expanded. * * @param symbolName * @return the value or null */ String valueForSymbol(String symbolName); }
/** * Allows support for "validator macros", a simple-minded way of combining several related valiations together under * a single name. The service's configuration maps string keys (macro names) to string values (validation constraints). * * @since 5.2.0 */ @UsesMappedConfiguration(String.class) public interface ValidatorMacro { /** * Given a <em>potential</em> validator macro (a simple string name), returns the value for that macro, a * comma-separated list of validation constraints. * * @return constraints, or null if no such validator macro */ String valueForMacro(String validatorMacro); }
/** * Provides access to user defined lifecycles (beyond the two built-in lifecycles: "singleton" and "primitive"). The * user defined lifecycles are contributed into the service's configuration. * * Note that the default scope {@linkplain org.apache.tapestry5.ioc.ScopeConstants#DEFAULT "singleton"} is special and * not a contribution. */ @UsesMappedConfiguration(ServiceLifecycle.class) public interface ServiceLifecycleSource { /** * Used to locate a configuration lifecycle, by name. * * @param scope * @return the named lifecycle, or null if the name is not found */ ServiceLifecycle get(String scope); }
/** * This service is used by {@link TranslatorSource} to specify {@link Translator} <em>alternates</em>: translators that * are used when specified explicitly by name. These translators may overlap the standard translators * by type (thus requiring a separate configuration). * * Translators contributed to this configuration must have names that do not overlap the standard translators. Further, * the contribution key must match the {@linkplain Translator#getName() translator name}. * * @since 5.2.0 */ @UsesMappedConfiguration(Translator.class) public interface TranslatorAlternatesSource { /** * Get the mapping from name to Translator, based on the contributions to the service. It will be verified * that the keys of the map corresponding to the names of the Translator values. */ Map<String, Translator> getTranslatorAlternates(); }
/** * Used to determine the MIME content type for a resource. The service configuration is the first step, * followed by {@link Context#getMimeType(String)}, and then (finally) "application/octet-stream" * as a stop-gap. * * The service configuration maps the file extension (e.g., "png") to its corresponding MIME type (e.g., "image/png"); */ @UsesMappedConfiguration(String.class) public interface ContentTypeAnalyzer { /** * Analyze the resource to determine its content type. * * @param resource * to analyze * @return a MIME content type */ String getContentType(Resource resource); }
/** * Used to override built in services. Simply contribute a mapping from a type to an instance of that type. Anywhere * that exact type is injected, without specifying markers or other annotations, the contributed instance will be * injected, even if there is already a service that implements the interface. * * In fact, this is <em>not</em> limited to overriding services; any object that can be injected based solely on type * can be contributed. * * @since 5.1.0.0 */ @UsesMappedConfiguration(key = Class.class, value = Object.class) public interface ServiceOverride { /** * Returns a provider based on the configuration; this is wired into the * {@link org.apache.tapestry5.ioc.services.MasterObjectProvider}'s configuration. */ ObjectProvider getServiceOverrideProvider(); }
/** * A strategy interface used for converting an object into markup that describes that object. This is primarily used in * terms of an {@link org.apache.tapestry5.services.ExceptionReporter} page. * * The ObjectRenderer service (distinguished by the @{@link org.apache.tapestry5.ioc.annotations.Primary} marker * annotation) uses {@linkplain org.apache.tapestry5.ioc.services.StrategyBuilder type-based matching} to find a * specific ObjectRenderer for any given type. */ @UsesMappedConfiguration(key = Class.class, value = ObjectRenderer.class) public interface ObjectRenderer<T> { /** * Renders the object out as markup. * * @param object to be rendered * @param writer to which output should be directed */ void render(T object, MarkupWriter writer); }
@UsesMappedConfiguration(key = Class.class, value = SessionPersistedObjectAnalyzer.class) public interface SessionPersistedObjectAnalyzer<T>
/** * Certain kinds of resources can be minimized: this primarily refers to JavaScript and CSS, both of which contain * whitespace, comments and other features that can be reduced. * * The service configuration maps a MIME content type (e.g., "text/javascript") to an appropriate implementation of this * interface. The master service has the @{@link Primary} marker interface. * * @since 5.3 */ @UsesMappedConfiguration(ResourceMinimizer.class) public interface ResourceMinimizer { /** * Checks the {@linkplain StreamableResource#getContentType() content type} of the resource and applies an * appropriate minimization to it if possible. * * @param resource * to minimize * @return the same resource, or a minimized replacement for the resource * @throws IOException */ StreamableResource minimize(StreamableResource resource) throws IOException; }
/** * Used to provide access to * {@link org.apache.tapestry5.services.ApplicationStatePersistenceStrategySource} instances * via a logical name for the strategy, such as "session". * <p> * <em>NOTE: The term "Application" here is a hold-over from Tapestry 5.0, which used * the @ApplicationState (deprecated and deleted) annotation, and called them "ASOs" * (Application State Objects). This service would be better named * "SessionStatePersistenceStrategySource" (but renaming it would cause backwards * compatibility issues).</em> */ @UsesMappedConfiguration(ApplicationStatePersistenceStrategy.class) public interface ApplicationStatePersistenceStrategySource { /** * Returns the named strategy. * * @param name of strategy to access * @return the strategy * @throws RuntimeException if the name does not match a configured strategy */ ApplicationStatePersistenceStrategy get(String name); }