Search in sources :

Example 11 with BindingFactory

use of org.apache.tapestry5.services.BindingFactory in project tapestry-5 by apache.

the class TapestryModule method contributeBindingSource.

// ========================================================================
// 
// Service Builder Methods (static)
// 
// ========================================================================
// ========================================================================
// 
// Service Contribution Methods (static)
// 
// ========================================================================
/**
 * Contributes the factory for several built-in binding prefixes ("asset",
 * "block", "component", "literal", prop",
 * "nullfieldstrategy", "message", "validate", "translate", "var").
 */
public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration, @InjectService("PropBindingFactory") BindingFactory propBindingFactory, @InjectService("MessageBindingFactory") BindingFactory messageBindingFactory, @InjectService("ValidateBindingFactory") BindingFactory validateBindingFactory, @InjectService("TranslateBindingFactory") BindingFactory translateBindingFactory, @InjectService("AssetBindingFactory") BindingFactory assetBindingFactory, @InjectService("NullFieldStrategyBindingFactory") BindingFactory nullFieldStrategyBindingFactory, @InjectService("ContextBindingFactory") BindingFactory contextBindingFactory, @InjectService("SymbolBindingFactory") BindingFactory symbolBindingFactory) {
    configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
    configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
    configuration.add(BindingConstants.VAR, new RenderVariableBindingFactory());
    configuration.add(BindingConstants.BLOCK, new BlockBindingFactory());
    configuration.add(BindingConstants.PROP, propBindingFactory);
    configuration.add(BindingConstants.MESSAGE, messageBindingFactory);
    configuration.add(BindingConstants.VALIDATE, validateBindingFactory);
    configuration.add(BindingConstants.TRANSLATE, translateBindingFactory);
    configuration.add(BindingConstants.ASSET, assetBindingFactory);
    configuration.add(BindingConstants.NULLFIELDSTRATEGY, nullFieldStrategyBindingFactory);
    configuration.add(BindingConstants.CONTEXT, contextBindingFactory);
    configuration.add(BindingConstants.SYMBOL, symbolBindingFactory);
}
Also used : LiteralBindingFactory(org.apache.tapestry5.internal.bindings.LiteralBindingFactory) BlockBindingFactory(org.apache.tapestry5.internal.bindings.BlockBindingFactory) RenderVariableBindingFactory(org.apache.tapestry5.internal.bindings.RenderVariableBindingFactory) ComponentBindingFactory(org.apache.tapestry5.internal.bindings.ComponentBindingFactory)

Aggregations

BindingFactory (org.apache.tapestry5.services.BindingFactory)10 ComponentResources (org.apache.tapestry5.ComponentResources)9 Location (org.apache.tapestry5.commons.Location)9 Test (org.testng.annotations.Test)9 Binding (org.apache.tapestry5.Binding)7 TapestryException (org.apache.tapestry5.commons.internal.util.TapestryException)4 BindingSource (org.apache.tapestry5.services.BindingSource)4 FieldComponent (org.apache.tapestry5.root.FieldComponent)2 FieldValidatorSource (org.apache.tapestry5.services.FieldValidatorSource)2 FieldTranslator (org.apache.tapestry5.FieldTranslator)1 FieldValidator (org.apache.tapestry5.FieldValidator)1 StringInternerImpl (org.apache.tapestry5.commons.internal.services.StringInternerImpl)1 BlockBindingFactory (org.apache.tapestry5.internal.bindings.BlockBindingFactory)1 ComponentBindingFactory (org.apache.tapestry5.internal.bindings.ComponentBindingFactory)1 LiteralBindingFactory (org.apache.tapestry5.internal.bindings.LiteralBindingFactory)1 RenderVariableBindingFactory (org.apache.tapestry5.internal.bindings.RenderVariableBindingFactory)1 Component (org.apache.tapestry5.runtime.Component)1 FieldTranslatorSource (org.apache.tapestry5.services.FieldTranslatorSource)1