Clover coverage report - Code Coverage for tapestry release 3.1-alpha-1
Coverage timestamp: Mon Feb 21 2005 09:16:14 EST
file stats: LOC: 706   Methods: 24
NCLOC: 368   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
PageLoader.java 91.7% 97.4% 100% 96.7%
coverage coverage
 1   
 // Copyright 2004, 2005 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.tapestry.pageload;
 16   
 
 17   
 import java.util.ArrayList;
 18   
 import java.util.Iterator;
 19   
 import java.util.List;
 20   
 import java.util.Locale;
 21   
 
 22   
 import org.apache.commons.logging.Log;
 23   
 import org.apache.hivemind.ApplicationRuntimeException;
 24   
 import org.apache.hivemind.HiveMind;
 25   
 import org.apache.hivemind.Location;
 26   
 import org.apache.tapestry.AbstractComponent;
 27   
 import org.apache.tapestry.BaseComponent;
 28   
 import org.apache.tapestry.IAsset;
 29   
 import org.apache.tapestry.IBinding;
 30   
 import org.apache.tapestry.IComponent;
 31   
 import org.apache.tapestry.IEngine;
 32   
 import org.apache.tapestry.INamespace;
 33   
 import org.apache.tapestry.IPage;
 34   
 import org.apache.tapestry.IRequestCycle;
 35   
 import org.apache.tapestry.ITemplateComponent;
 36   
 import org.apache.tapestry.asset.AssetSource;
 37   
 import org.apache.tapestry.binding.BindingSource;
 38   
 import org.apache.tapestry.binding.ExpressionBinding;
 39   
 import org.apache.tapestry.binding.ListenerBinding;
 40   
 import org.apache.tapestry.coerce.ValueConverter;
 41   
 import org.apache.tapestry.engine.IPageLoader;
 42   
 import org.apache.tapestry.event.ChangeObserver;
 43   
 import org.apache.tapestry.resolver.ComponentSpecificationResolver;
 44   
 import org.apache.tapestry.services.BSFManagerFactory;
 45   
 import org.apache.tapestry.services.ComponentConstructor;
 46   
 import org.apache.tapestry.services.ComponentConstructorFactory;
 47   
 import org.apache.tapestry.services.ComponentTemplateLoader;
 48   
 import org.apache.tapestry.spec.BindingType;
 49   
 import org.apache.tapestry.spec.IAssetSpecification;
 50   
 import org.apache.tapestry.spec.IBindingSpecification;
 51   
 import org.apache.tapestry.spec.IComponentSpecification;
 52   
 import org.apache.tapestry.spec.IContainedComponent;
 53   
 import org.apache.tapestry.spec.IListenerBindingSpecification;
 54   
 
 55   
 /**
 56   
  * Runs the process of building the component hierarchy for an entire page.
 57   
  * <p>
 58   
  * This implementation is not threadsafe, therefore the threaded service model must be used.
 59   
  * 
 60   
  * @author Howard Lewis Ship
 61   
  */
 62   
 
 63   
 public class PageLoader implements IPageLoader
 64   
 {
 65   
     private Log _log;
 66   
 
 67   
     /** @since 3.1 */
 68   
 
 69   
     private ComponentSpecificationResolver _componentResolver;
 70   
 
 71   
     /** @since 3.1 */
 72   
 
 73   
     private String _defaultPageClassName;
 74   
 
 75   
     /** @since 3.1 */
 76   
 
 77   
     private String _defaultScriptLanguage;
 78   
 
 79   
     /** @since 3.1 */
 80   
 
 81   
     private BindingSource _bindingSource;
 82   
 
 83   
     /** @since 3.1 */
 84   
 
 85   
     private ComponentTemplateLoader _componentTemplateLoader;
 86   
 
 87   
     /** @since 3.1 */
 88   
 
 89   
     private BSFManagerFactory _managerFactory;
 90   
 
 91   
     private IEngine _engine;
 92   
 
 93   
     private List _inheritedBindingQueue = new ArrayList();
 94   
 
 95   
     /** @since 3.1 */
 96   
     private IComponentVisitor _establishDefaultParameterValuesVisitor;
 97   
 
 98   
     private ComponentTreeWalker _establishDefaultParameterValuesWalker;
 99   
 
 100   
     private ComponentTreeWalker _verifyRequiredParametersWalker;
 101   
 
 102   
     /** @since 3.1 */
 103   
 
 104   
     private ComponentConstructorFactory _componentConstructorFactory;
 105   
 
 106   
     /** @since 3.1 */
 107   
 
 108   
     private ValueConverter _valueConverter;
 109   
 
 110   
     /** @since 3.1 */
 111   
 
 112   
     private AssetSource _assetSource;
 113   
 
 114   
     /**
 115   
      * The locale of the application, which is also the locale of the page being loaded.
 116   
      */
 117   
 
 118   
     private Locale _locale;
 119   
 
 120   
     /**
 121   
      * Number of components instantiated, excluding the page itself.
 122   
      */
 123   
 
 124   
     private int _count;
 125   
 
 126   
     /**
 127   
      * The recursion depth. A page with no components is zero. A component on a page is one.
 128   
      */
 129   
 
 130   
     private int _depth;
 131   
 
 132   
     /**
 133   
      * The maximum depth reached while building the page.
 134   
      */
 135   
 
 136   
     private int _maxDepth;
 137   
 
 138  141
     public void initializeService()
 139   
     {
 140   
 
 141   
         // Create the mechanisms for walking the component tree when it is
 142   
         // complete
 143  141
         IComponentVisitor verifyRequiredParametersVisitor = new VerifyRequiredParametersVisitor();
 144  141
         _verifyRequiredParametersWalker = new ComponentTreeWalker(new IComponentVisitor[]
 145   
         { verifyRequiredParametersVisitor });
 146   
 
 147  141
         _establishDefaultParameterValuesWalker = new ComponentTreeWalker(new IComponentVisitor[]
 148   
         { _establishDefaultParameterValuesVisitor });
 149   
     }
 150   
 
 151   
     /**
 152   
      * Binds properties of the component as defined by the container's specification.
 153   
      * <p>
 154   
      * This implementation is very simple, we will need a lot more sanity checking and eror checking
 155   
      * in the final version.
 156   
      * 
 157   
      * @param container
 158   
      *            The containing component. For a dynamic binding ({@link ExpressionBinding}) the
 159   
      *            property name is evaluated with the container as the root.
 160   
      * @param component
 161   
      *            The contained component being bound.
 162   
      * @param spec
 163   
      *            The specification of the contained component.
 164   
      * @param contained
 165   
      *            The contained component specification (from the container's
 166   
      *            {@link IComponentSpecification}).
 167   
      */
 168   
 
 169  605
     private void bind(IComponent container, IComponent component, IContainedComponent contained)
 170   
     {
 171  605
         IComponentSpecification spec = component.getSpecification();
 172  605
         boolean formalOnly = !spec.getAllowInformalParameters();
 173   
 
 174  605
         IComponentSpecification containerSpec = container.getSpecification();
 175  605
         boolean containerFormalOnly = !containerSpec.getAllowInformalParameters();
 176   
 
 177  605
         if (contained.getInheritInformalParameters())
 178   
         {
 179  3
             if (formalOnly)
 180  1
                 throw new ApplicationRuntimeException(PageloadMessages
 181   
                         .inheritInformalInvalidComponentFormalOnly(component), component, contained
 182   
                         .getLocation(), null);
 183   
 
 184  2
             if (containerFormalOnly)
 185  1
                 throw new ApplicationRuntimeException(PageloadMessages
 186   
                         .inheritInformalInvalidContainerFormalOnly(container, component),
 187   
                         component, contained.getLocation(), null);
 188   
 
 189  1
             IQueuedInheritedBinding queued = new QueuedInheritInformalBindings(component);
 190  1
             _inheritedBindingQueue.add(queued);
 191   
         }
 192   
 
 193  603
         Iterator i = contained.getBindingNames().iterator();
 194   
 
 195  603
         while (i.hasNext())
 196   
         {
 197  766
             String name = (String) i.next();
 198   
 
 199  766
             boolean isFormal = spec.getParameter(name) != null;
 200   
 
 201  766
             IBindingSpecification bspec = contained.getBinding(name);
 202   
 
 203   
             // If not allowing informal parameters, check that each binding
 204   
             // matches
 205   
             // a formal parameter.
 206   
 
 207  766
             if (formalOnly && !isFormal)
 208  0
                 throw new ApplicationRuntimeException(PageloadMessages.formalParametersOnly(
 209   
                         component,
 210   
                         name), component, bspec.getLocation(), null);
 211   
 
 212   
             // If an informal parameter that conflicts with a reserved name,
 213   
             // then skip it.
 214   
 
 215  766
             if (!isFormal && spec.isReservedParameterName(name))
 216  1
                 continue;
 217   
 
 218   
             // The type determines how to interpret the value:
 219   
             // As a simple static String
 220   
             // As a nested property name (relative to the component)
 221   
             // As the name of a binding inherited from the containing component.
 222   
             // As the name of a public field
 223   
             // As a script for a listener
 224   
 
 225  765
             BindingType type = bspec.getType();
 226   
 
 227   
             // For inherited bindings, defer until later. This gives components
 228   
             // a chance to setup bindings from static values and expressions in
 229   
             // the template. The order of operations is tricky, template bindings
 230   
             // come later. Note that this is a hold over from the Tapestry 3.0 DTD
 231   
             // and will some day no longer be supported.
 232   
 
 233  765
             if (type == BindingType.INHERITED)
 234   
             {
 235  36
                 QueuedInheritedBinding queued = new QueuedInheritedBinding(component, bspec
 236   
                         .getValue(), name);
 237  36
                 _inheritedBindingQueue.add(queued);
 238  36
                 continue;
 239   
             }
 240   
 
 241  729
             if (type == BindingType.LISTENER)
 242   
             {
 243  4
                 constructListenerBinding(component, name, (IListenerBindingSpecification) bspec);
 244  4
                 continue;
 245   
             }
 246   
 
 247  725
             String description = PageloadMessages.parameterName(name);
 248   
 
 249  725
             IBinding binding = convert(container, description, bspec);
 250   
 
 251  725
             component.setBinding(name, binding);
 252   
         }
 253   
     }
 254   
 
 255  725
     private IBinding convert(IComponent container, String description, IBindingSpecification spec)
 256   
     {
 257  725
         Location location = spec.getLocation();
 258  725
         String locator = spec.getValue();
 259   
 
 260  725
         return _bindingSource.createBinding(container, description, locator, location);
 261   
     }
 262   
 
 263   
     /**
 264   
      * Construct a {@link ListenerBinding}for the component, and add it.
 265   
      * 
 266   
      * @since 3.0
 267   
      */
 268   
 
 269  4
     private void constructListenerBinding(IComponent component, String parameterName,
 270   
             IListenerBindingSpecification spec)
 271   
     {
 272  4
         String language = spec.getLanguage();
 273   
 
 274   
         // If not provided in the page or component specification, then
 275   
         // search for a default (factory default is "jython").
 276   
 
 277  4
         if (HiveMind.isBlank(language))
 278  1
             language = _defaultScriptLanguage;
 279   
 
 280   
         // Construct the binding. The first parameter is the compononent
 281   
         // (not the DirectLink or Form, but the page or component containing the
 282   
         // link or form).
 283   
 
 284  4
         String description = PageloadMessages.parameterName(parameterName);
 285   
 
 286  4
         IBinding binding = new ListenerBinding(description, _valueConverter, spec.getLocation(),
 287   
                 component.getContainer(), language, spec.getScript(), _managerFactory);
 288   
 
 289  4
         component.setBinding(parameterName, binding);
 290   
     }
 291   
 
 292   
     /**
 293   
      * Sets up a component. This involves:
 294   
      * <ul>
 295   
      * <li>Instantiating any contained components.
 296   
      * <li>Add the contained components to the container.
 297   
      * <li>Setting up bindings between container and containees.
 298   
      * <li>Construct the containees recursively.
 299   
      * <li>Invoking
 300   
      * {@link IComponent#finishLoad(IRequestCycle, IPageLoader, IComponentSpecification)}
 301   
      * </ul>
 302   
      * 
 303   
      * @param cycle
 304   
      *            the request cycle for which the page is being (initially) constructed
 305   
      * @param page
 306   
      *            The page on which the container exists.
 307   
      * @param container
 308   
      *            The component to be set up.
 309   
      * @param containerSpec
 310   
      *            The specification for the container.
 311   
      * @param the
 312   
      *            namespace of the container
 313   
      */
 314   
 
 315  1343
     private void constructComponent(IRequestCycle cycle, IPage page, IComponent container,
 316   
             IComponentSpecification containerSpec, INamespace namespace)
 317   
     {
 318  1343
         _depth++;
 319  1343
         if (_depth > _maxDepth)
 320  426
             _maxDepth = _depth;
 321   
 
 322  1343
         List ids = new ArrayList(containerSpec.getComponentIds());
 323  1343
         int count = ids.size();
 324   
 
 325  1343
         try
 326   
         {
 327  1343
             for (int i = 0; i < count; i++)
 328   
             {
 329  605
                 String id = (String) ids.get(i);
 330   
 
 331   
                 // Get the sub-component specification from the
 332   
                 // container's specification.
 333   
 
 334  605
                 IContainedComponent contained = containerSpec.getComponent(id);
 335   
 
 336  605
                 String type = contained.getType();
 337  605
                 Location location = contained.getLocation();
 338   
 
 339  605
                 _componentResolver.resolve(cycle, namespace, type, location);
 340   
 
 341  605
                 IComponentSpecification componentSpecification = _componentResolver
 342   
                         .getSpecification();
 343  605
                 INamespace componentNamespace = _componentResolver.getNamespace();
 344   
 
 345   
                 // Instantiate the contained component.
 346   
 
 347  605
                 IComponent component = instantiateComponent(
 348   
                         page,
 349   
                         container,
 350   
                         id,
 351   
                         componentSpecification,
 352   
                         componentNamespace,
 353   
                         location);
 354   
 
 355   
                 // Add it, by name, to the container.
 356   
 
 357  605
                 container.addComponent(component);
 358   
 
 359   
                 // Set up any bindings in the IContainedComponent specification
 360   
 
 361  605
                 bind(container, component, contained);
 362   
 
 363   
                 // Now construct the component recusively; it gets its chance
 364   
                 // to create its subcomponents and set their bindings.
 365   
 
 366  603
                 constructComponent(
 367   
                         cycle,
 368   
                         page,
 369   
                         component,
 370   
                         componentSpecification,
 371   
                         componentNamespace);
 372   
             }
 373   
 
 374  1341
             addAssets(container, containerSpec);
 375   
 
 376   
             // Finish the load of the component; most components (which
 377   
             // subclass BaseComponent) load their templates here.
 378   
             // Properties with initial values will be set here (or the
 379   
             // initial value will be recorded for later use in pageDetach().
 380   
             // That may cause yet more components to be created, and more
 381   
             // bindings to be set, so we defer some checking until
 382   
             // later.
 383   
 
 384  1341
             container.finishLoad(cycle, this, containerSpec);
 385   
 
 386   
             // Have the component switch over to its active state.
 387   
 
 388  1331
             container.enterActiveState();
 389   
         }
 390   
         catch (ApplicationRuntimeException ex)
 391   
         {
 392  12
             throw ex;
 393   
         }
 394   
         catch (RuntimeException ex)
 395   
         {
 396  0
             throw new ApplicationRuntimeException(PageloadMessages.unableToInstantiateComponent(
 397   
                     container,
 398   
                     ex), container, null, ex);
 399   
         }
 400   
 
 401  1331
         _depth--;
 402   
     }
 403   
 
 404   
     /**
 405   
      * Invoked to create an implicit component (one which is defined in the containing component's
 406   
      * template, rather that in the containing component's specification).
 407   
      * 
 408   
      * @see org.apache.tapestry.services.impl.ComponentTemplateLoaderImpl
 409   
      * @since 3.0
 410   
      */
 411   
 
 412  566
     public IComponent createImplicitComponent(IRequestCycle cycle, IComponent container,
 413   
             String componentId, String componentType, Location location)
 414   
     {
 415  566
         IPage page = container.getPage();
 416   
 
 417  566
         _componentResolver.resolve(cycle, container.getNamespace(), componentType, location);
 418   
 
 419  566
         INamespace componentNamespace = _componentResolver.getNamespace();
 420  566
         IComponentSpecification spec = _componentResolver.getSpecification();
 421   
 
 422  566
         IComponent result = instantiateComponent(
 423   
                 page,
 424   
                 container,
 425   
                 componentId,
 426   
                 spec,
 427   
                 componentNamespace,
 428   
                 location);
 429   
 
 430  565
         container.addComponent(result);
 431   
 
 432   
         // Recusively build the component.
 433   
 
 434  565
         constructComponent(cycle, page, result, spec, componentNamespace);
 435   
 
 436  562
         return result;
 437   
     }
 438   
 
 439   
     /**
 440   
      * Instantiates a component from its specification. We instantiate the component object, then
 441   
      * set its specification, page, container and id.
 442   
      * 
 443   
      * @see AbstractComponent
 444   
      */
 445   
 
 446  1171
     private IComponent instantiateComponent(IPage page, IComponent container, String id,
 447   
             IComponentSpecification spec, INamespace namespace, Location location)
 448   
     {
 449  1171
         IComponent result = null;
 450  1171
         String className = spec.getComponentClassName();
 451   
 
 452  1171
         if (HiveMind.isBlank(className))
 453  16
             className = BaseComponent.class.getName();
 454   
 
 455  1171
         ComponentConstructor cc = _componentConstructorFactory.getComponentConstructor(
 456   
                 spec,
 457   
                 className);
 458   
 
 459  1171
         try
 460   
         {
 461  1171
             result = (IComponent) cc.newInstance();
 462   
 
 463   
         }
 464   
         catch (ClassCastException ex)
 465   
         {
 466  1
             throw new ApplicationRuntimeException(PageloadMessages.classNotComponent(cc
 467   
                     .getComponentClass()), container, spec.getLocation(), ex);
 468   
         }
 469   
 
 470  1170
         if (result instanceof IPage)
 471  0
             throw new ApplicationRuntimeException(PageloadMessages.pageNotAllowed(result), result,
 472   
                     null, null);
 473   
 
 474  1170
         result.setNamespace(namespace);
 475  1170
         result.setPage(page);
 476  1170
         result.setContainer(container);
 477  1170
         result.setId(id);
 478  1170
         result.setLocation(location);
 479   
 
 480  1170
         _count++;
 481   
 
 482  1170
         return result;
 483   
     }
 484   
 
 485   
     /**
 486   
      * Instantitates a page from its specification.
 487   
      * 
 488   
      * @param name
 489   
      *            the unqualified, simple, name for the page
 490   
      * @param namespace
 491   
      *            the namespace containing the page's specification
 492   
      * @param spec
 493   
      *            the page's specification We instantiate the page object, then set its
 494   
      *            specification, names and locale.
 495   
      * @see IEngine
 496   
      * @see ChangeObserver
 497   
      */
 498   
 
 499  177
     private IPage instantiatePage(String name, INamespace namespace, IComponentSpecification spec)
 500   
     {
 501  177
         IPage result = null;
 502   
 
 503  177
         String pageName = namespace.constructQualifiedName(name);
 504  177
         String className = spec.getComponentClassName();
 505  177
         Location location = spec.getLocation();
 506   
 
 507  177
         if (HiveMind.isBlank(className))
 508  60
             className = _defaultPageClassName;
 509   
 
 510  177
         ComponentConstructor cc = _componentConstructorFactory.getComponentConstructor(
 511   
                 spec,
 512   
                 className);
 513   
 
 514  176
         try
 515   
         {
 516  176
             result = (IPage) cc.newInstance();
 517   
 
 518  175
             result.setNamespace(namespace);
 519  175
             result.setPageName(pageName);
 520  175
             result.setPage(result);
 521  175
             result.setLocale(_locale);
 522  175
             result.setLocation(location);
 523   
         }
 524   
         catch (ClassCastException ex)
 525   
         {
 526  1
             throw new ApplicationRuntimeException(PageloadMessages.classNotPage(cc
 527   
                     .getComponentClass()), location, ex);
 528   
         }
 529   
 
 530  175
         return result;
 531   
     }
 532   
 
 533  177
     public IPage loadPage(String name, INamespace namespace, IRequestCycle cycle,
 534   
             IComponentSpecification specification)
 535   
     {
 536  177
         IPage page = null;
 537   
 
 538  177
         _engine = cycle.getEngine();
 539   
 
 540  177
         _locale = _engine.getLocale();
 541   
 
 542  177
         _count = 0;
 543  177
         _depth = 0;
 544  177
         _maxDepth = 0;
 545   
 
 546  177
         try
 547   
         {
 548  177
             page = instantiatePage(name, namespace, specification);
 549   
 
 550  175
             constructComponent(cycle, page, page, specification, namespace);
 551   
 
 552   
             // Walk through the complete component tree to set up the default
 553   
             // parameter values.
 554  166
             _establishDefaultParameterValuesWalker.walkComponentTree(page);
 555   
 
 556  166
             establishInheritedBindings();
 557   
 
 558   
             // Walk through the complete component tree to ensure that required
 559   
             // parameters are bound
 560  166
             _verifyRequiredParametersWalker.walkComponentTree(page);
 561   
         }
 562   
         finally
 563   
         {
 564  177
             _locale = null;
 565  177
             _engine = null;
 566  177
             _inheritedBindingQueue.clear();
 567   
         }
 568   
 
 569  166
         if (_log.isDebugEnabled())
 570  0
             _log.debug("Loaded page " + page + " with " + _count + " components (maximum depth "
 571   
                     + _maxDepth + ")");
 572   
 
 573  166
         return page;
 574   
     }
 575   
 
 576   
     /** @since 3.1 */
 577   
 
 578  271
     public void loadTemplateForComponent(IRequestCycle cycle, ITemplateComponent component)
 579   
     {
 580  271
         _componentTemplateLoader.loadTemplate(cycle, component);
 581   
     }
 582   
 
 583  166
     private void establishInheritedBindings()
 584   
     {
 585  166
         _log.debug("Establishing inherited bindings");
 586   
 
 587  166
         int count = _inheritedBindingQueue.size();
 588   
 
 589  166
         for (int i = 0; i < count; i++)
 590   
         {
 591  34
             IQueuedInheritedBinding queued = (IQueuedInheritedBinding) _inheritedBindingQueue
 592   
                     .get(i);
 593   
 
 594  34
             queued.connect();
 595   
         }
 596   
     }
 597   
 
 598  1341
     private void addAssets(IComponent component, IComponentSpecification specification)
 599   
     {
 600  1341
         List names = specification.getAssetNames();
 601   
 
 602  1341
         if (names.isEmpty())
 603  1256
             return;
 604   
 
 605  85
         Iterator i = names.iterator();
 606   
 
 607  85
         while (i.hasNext())
 608   
         {
 609  89
             String name = (String) i.next();
 610   
 
 611  89
             IAssetSpecification assetSpec = specification.getAsset(name);
 612   
 
 613  89
             IAsset asset = convertAsset(assetSpec);
 614   
 
 615  89
             component.addAsset(name, asset);
 616   
         }
 617   
     }
 618   
 
 619   
     /**
 620   
      * Builds an instance of {@link IAsset}from the specification.
 621   
      */
 622   
 
 623  89
     private IAsset convertAsset(IAssetSpecification spec)
 624   
     {
 625   
         // AssetType type = spec.getType();
 626  89
         String path = spec.getPath();
 627  89
         Location location = spec.getLocation();
 628   
 
 629  89
         return _assetSource.findAsset(location.getResource(), path, _locale, location);
 630   
     }
 631   
 
 632   
     /** @since 3.1 */
 633   
 
 634  141
     public void setLog(Log log)
 635   
     {
 636  141
         _log = log;
 637   
     }
 638   
 
 639   
     /** @since 3.1 */
 640   
 
 641  141
     public void setComponentResolver(ComponentSpecificationResolver resolver)
 642   
     {
 643  141
         _componentResolver = resolver;
 644   
     }
 645   
 
 646   
     /** @since 3.1 */
 647   
 
 648  141
     public void setDefaultPageClassName(String string)
 649   
     {
 650  141
         _defaultPageClassName = string;
 651   
     }
 652   
 
 653   
     /** @since 3.1 */
 654   
 
 655  141
     public void setDefaultScriptLanguage(String string)
 656   
     {
 657  141
         _defaultScriptLanguage = string;
 658   
     }
 659   
 
 660   
     /** @since 3.1 */
 661   
 
 662  141
     public void setBindingSource(BindingSource bindingSource)
 663   
     {
 664  141
         _bindingSource = bindingSource;
 665   
     }
 666   
 
 667   
     /**
 668   
      * @since 3.1
 669   
      */
 670  141
     public void setComponentTemplateLoader(ComponentTemplateLoader componentTemplateLoader)
 671   
     {
 672  141
         _componentTemplateLoader = componentTemplateLoader;
 673   
     }
 674   
 
 675   
     /** @since 3.1 */
 676  141
     public void setEstablishDefaultParameterValuesVisitor(
 677   
             IComponentVisitor establishDefaultParameterValuesVisitor)
 678   
     {
 679  141
         _establishDefaultParameterValuesVisitor = establishDefaultParameterValuesVisitor;
 680   
     }
 681   
 
 682   
     /** @since 3.1 */
 683  141
     public void setComponentConstructorFactory(
 684   
             ComponentConstructorFactory componentConstructorFactory)
 685   
     {
 686  141
         _componentConstructorFactory = componentConstructorFactory;
 687   
     }
 688   
 
 689   
     /** @since 3.1 */
 690  141
     public void setValueConverter(ValueConverter valueConverter)
 691   
     {
 692  141
         _valueConverter = valueConverter;
 693   
     }
 694   
 
 695   
     /** @since 3.1 */
 696  141
     public void setAssetSource(AssetSource assetSource)
 697   
     {
 698  141
         _assetSource = assetSource;
 699   
     }
 700   
 
 701   
     /** @since 3.1 */
 702  141
     public void setManagerFactory(BSFManagerFactory managerFactory)
 703   
     {
 704  141
         _managerFactory = managerFactory;
 705   
     }
 706   
 }