1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.view.facelets.tag.jsf;
20
21 import java.io.IOException;
22 import java.util.Collections;
23 import java.util.EnumSet;
24 import java.util.Iterator;
25 import java.util.List;
26 import java.util.Map;
27 import java.util.Set;
28 import java.util.logging.Level;
29 import java.util.logging.Logger;
30
31 import javax.el.ValueExpression;
32 import javax.faces.FacesWrapper;
33 import javax.faces.application.Application;
34 import javax.faces.application.ProjectStage;
35 import javax.faces.component.ActionSource;
36 import javax.faces.component.EditableValueHolder;
37 import javax.faces.component.UIComponent;
38 import javax.faces.component.UIOutput;
39 import javax.faces.component.UniqueIdVendor;
40 import javax.faces.component.ValueHolder;
41 import javax.faces.component.behavior.ClientBehaviorHolder;
42 import javax.faces.component.visit.VisitCallback;
43 import javax.faces.component.visit.VisitContext;
44 import javax.faces.component.visit.VisitHint;
45 import javax.faces.component.visit.VisitResult;
46 import javax.faces.context.FacesContext;
47 import javax.faces.event.PhaseId;
48 import javax.faces.validator.BeanValidator;
49 import javax.faces.validator.Validator;
50 import javax.faces.view.EditableValueHolderAttachedObjectHandler;
51 import javax.faces.view.facelets.ComponentConfig;
52 import javax.faces.view.facelets.ComponentHandler;
53 import javax.faces.view.facelets.FaceletContext;
54 import javax.faces.view.facelets.MetaRuleset;
55 import javax.faces.view.facelets.TagAttribute;
56 import javax.faces.view.facelets.TagException;
57 import javax.faces.view.facelets.TagHandlerDelegate;
58 import javax.faces.view.facelets.ValidatorHandler;
59
60 import org.apache.myfaces.util.ExternalSpecifications;
61 import org.apache.myfaces.view.facelets.AbstractFaceletContext;
62 import org.apache.myfaces.view.facelets.ComponentState;
63 import org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy;
64 import org.apache.myfaces.view.facelets.FaceletCompositionContext;
65 import org.apache.myfaces.view.facelets.FaceletDynamicComponentRefreshTransientBuildEvent;
66 import org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage;
67 import org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageBase;
68 import org.apache.myfaces.view.facelets.el.CompositeComponentELUtils;
69 import org.apache.myfaces.view.facelets.tag.MetaRulesetImpl;
70 import org.apache.myfaces.view.facelets.tag.jsf.core.AjaxHandler;
71 import org.apache.myfaces.view.facelets.tag.jsf.core.FacetHandler;
72
73
74
75
76
77
78
79
80
81
82
83 public class ComponentTagHandlerDelegate extends TagHandlerDelegate
84 {
85 private final static Logger log = Logger.getLogger(ComponentTagHandlerDelegate.class.getName());
86
87 private static final Set<VisitHint> VISIT_HINTS_DYN_REFRESH = Collections.unmodifiableSet(
88 EnumSet.of(VisitHint.SKIP_ITERATION));
89
90 private final ComponentHandler _delegate;
91
92 private final String _componentType;
93
94 private final TagAttribute _id;
95
96 private final String _rendererType;
97
98 private final ComponentBuilderHandler _componentBuilderHandlerDelegate;
99
100 private final RelocatableResourceHandler _relocatableResourceHandler;
101
102 @SuppressWarnings("unchecked")
103 public ComponentTagHandlerDelegate(ComponentHandler delegate)
104 {
105 _delegate = delegate;
106 ComponentConfig delegateComponentConfig = delegate.getComponentConfig();
107 _componentType = delegateComponentConfig.getComponentType();
108 _rendererType = delegateComponentConfig.getRendererType();
109 _id = delegate.getTagAttribute("id");
110
111 ComponentHandler handler = _delegate;
112 boolean found = false;
113 while(handler != null && !found)
114 {
115 if (handler instanceof ComponentBuilderHandler)
116 {
117 found = true;
118 }
119 else if (handler instanceof FacesWrapper)
120 {
121 handler = ((FacesWrapper<? extends ComponentHandler>)handler).getWrapped();
122 }
123 else
124 {
125 handler = null;
126 }
127 }
128 if (found)
129 {
130 _componentBuilderHandlerDelegate = (ComponentBuilderHandler) handler;
131 }
132 else
133 {
134 _componentBuilderHandlerDelegate = null;
135 }
136
137
138 handler = _delegate;
139 found = false;
140 while(handler != null && !found)
141 {
142 if (handler instanceof RelocatableResourceHandler)
143 {
144 found = true;
145 }
146 else if (handler instanceof FacesWrapper)
147 {
148 handler = ((FacesWrapper<? extends ComponentHandler>)handler).getWrapped();
149 }
150 else
151 {
152 handler = null;
153 }
154 }
155 if (found)
156 {
157 _relocatableResourceHandler = (RelocatableResourceHandler) handler;
158 }
159 else
160 {
161
162 if (_componentType != null && _rendererType != null &&
163 (_rendererType.equals("javax.faces.resource.Script") ||
164 _rendererType.equals("javax.faces.resource.Stylesheet")) &&
165 _componentType.equals(UIOutput.COMPONENT_TYPE))
166 {
167 _relocatableResourceHandler = ComponentRelocatableResourceHandler.INSTANCE;
168 }
169 else
170 {
171 _relocatableResourceHandler = null;
172 }
173 }
174 }
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203 @SuppressWarnings("unchecked")
204 @Override
205 public void apply(FaceletContext ctx, UIComponent parent) throws IOException
206 {
207
208 if (parent == null)
209 {
210 throw new TagException(_delegate.getTag(), "Parent UIComponent was null");
211 }
212
213 FacesContext facesContext = ctx.getFacesContext();
214
215
216 String facetName = this.getFacetName(ctx, parent);
217
218
219 String id = ctx.generateUniqueId(_delegate.getTagId());
220
221
222 FaceletCompositionContext mctx = (FaceletCompositionContext) FaceletCompositionContext.getCurrentInstance(ctx);
223
224
225 UIComponent c = null;
226
227
228
229
230 UIComponent oldParent = parent;
231
232 if (mctx.isRefreshingSection())
233 {
234 if (_relocatableResourceHandler != null)
235 {
236 c = _relocatableResourceHandler.findChildByTagId(ctx, parent, id);
237 }
238 else
239 {
240 if (facetName != null)
241 {
242 c = ComponentSupport.findChildInFacetByTagId(parent, id, facetName);
243 }
244 else
245 {
246 c = ComponentSupport.findChildInChildrenByTagId(parent, id);
247 }
248 }
249 }
250 boolean componentFound = false;
251 if (c != null)
252 {
253 componentFound = true;
254
255
256 if (_delegate.getBinding() != null &&
257 c.getAttributes().containsKey(
258 FaceletDynamicComponentRefreshTransientBuildEvent.DYNAMIC_COMPONENT_BINDING_NEEDS_REFRESH))
259 {
260 VisitContext visitContext = (VisitContext) mctx.getVisitContextFactory().
261 getVisitContext(facesContext, null, VISIT_HINTS_DYN_REFRESH);
262 c.visitTree(visitContext, new PublishFaceletDynamicComponentRefreshTransientBuildCallback());
263 }
264
265 mctx.incrementUniqueComponentId();
266
267
268 if (log.isLoggable(Level.FINE))
269 {
270 log.fine(_delegate.getTag() + " Component[" + id + "] Found, marking children for cleanup");
271 }
272
273
274
275
276 mctx.markForDeletion(c);
277
278 if (_relocatableResourceHandler != null)
279 {
280 mctx.markRelocatableResourceForDeletion(c);
281 }
282 }
283 else
284 {
285 c = this.createComponent(ctx);
286 if (log.isLoggable(Level.FINE))
287 {
288 log.fine(_delegate.getTag() + " Component[" + id + "] Created: " + c.getClass().getName());
289 }
290
291 _delegate.setAttributes(ctx, c);
292
293
294 c.getAttributes().put(ComponentSupport.MARK_CREATED, id);
295
296 if (facesContext.isProjectStage(ProjectStage.Development))
297 {
298 c.getAttributes().put(UIComponent.VIEW_LOCATION_KEY,
299 _delegate.getTag().getLocation());
300 }
301
302
303 if (this._id != null)
304 {
305 mctx.incrementUniqueComponentId();
306 c.setId(this._id.getValue(ctx));
307 }
308 else
309 {
310 String componentId = mctx.generateUniqueComponentId();
311 UniqueIdVendor uniqueIdVendor = mctx.getUniqueIdVendorFromStack();
312 if (uniqueIdVendor == null)
313 {
314 uniqueIdVendor = facesContext.getViewRoot();
315
316 if (uniqueIdVendor == null)
317 {
318
319
320
321 uniqueIdVendor = ComponentSupport.getViewRoot(ctx, parent);
322 }
323 }
324 if (uniqueIdVendor != null)
325 {
326
327
328 String uid = uniqueIdVendor.createUniqueId(facesContext, componentId);
329 c.setId(uid);
330 }
331 }
332
333 if (this._rendererType != null)
334 {
335 c.setRendererType(this._rendererType);
336 }
337
338
339 _delegate.onComponentCreated(ctx, c, parent);
340
341 if (_relocatableResourceHandler != null &&
342 _relocatableResourceHandler instanceof ComponentRelocatableResourceHandler)
343 {
344 UIComponent parentCompositeComponent
345 = mctx.getCompositeComponentFromStack();
346 if (parentCompositeComponent != null)
347 {
348 c.getAttributes().put(CompositeComponentELUtils.LOCATION_KEY,
349 parentCompositeComponent.getAttributes().get(CompositeComponentELUtils.LOCATION_KEY));
350 }
351 }
352
353 if (mctx.isRefreshingTransientBuild() && _relocatableResourceHandler != null)
354 {
355 mctx.markRelocatableResourceForDeletion(c);
356 }
357 }
358 c.pushComponentToEL(facesContext, c);
359
360 if (c instanceof UniqueIdVendor)
361 {
362 mctx.pushUniqueIdVendorToStack((UniqueIdVendor)c);
363 }
364
365 if (mctx.isDynamicComponentTopLevel())
366 {
367 mctx.setDynamicComponentTopLevel(false);
368 _delegate.applyNextHandler(ctx, c);
369 mctx.setDynamicComponentTopLevel(true);
370 }
371 else
372 {
373
374 _delegate.applyNextHandler(ctx, c);
375 }
376
377 boolean oldProcessingEvents = facesContext.isProcessingEvents();
378
379 if (componentFound && !mctx.isDynamicComponentTopLevel())
380 {
381 mctx.finalizeForDeletion(c);
382
383
384
385 if (mctx.isRefreshingSection())
386 {
387 facesContext.setProcessingEvents(false);
388 if (_relocatableResourceHandler != null &&
389 parent != null && !parent.equals(c.getParent()))
390 {
391
392 parent = c.getParent();
393
394
395
396 UIComponent c1 = ComponentSupport.findChildInChildrenByTagId(parent, id);
397 if (c1 == null)
398 {
399 facetName = ComponentSupport.findChildInFacetsByTagId(parent, id);
400 }
401 else
402 {
403 facetName = null;
404 }
405 }
406 ComponentSupport.setCachedFacesContext(c, facesContext);
407 }
408 if (facetName == null)
409 {
410 parent.getChildren().remove(c);
411 }
412 else
413 {
414 ComponentSupport.removeFacet(ctx, parent, c, facetName);
415 }
416 if (mctx.isRefreshingSection())
417 {
418 ComponentSupport.setCachedFacesContext(c, null);
419 facesContext.setProcessingEvents(oldProcessingEvents);
420 }
421
422 }
423
424
425 if (!componentFound)
426 {
427 if (c instanceof ClientBehaviorHolder && !UIComponent.isCompositeComponent(c))
428 {
429 Iterator<AjaxHandler> it = ((AbstractFaceletContext) ctx).getAjaxHandlers();
430 if (it != null)
431 {
432 while(it.hasNext())
433 {
434 it.next().applyAttachedObject(facesContext, c);
435 }
436 }
437 }
438
439 if (c instanceof EditableValueHolder)
440 {
441
442
443 addEnclosingAndDefaultValidators(ctx, mctx, facesContext, (EditableValueHolder) c);
444 }
445 }
446
447 _delegate.onComponentPopulated(ctx, c, oldParent);
448
449 if (!mctx.isDynamicComponentTopLevel() || !componentFound)
450 {
451 if (componentFound && mctx.isRefreshingSection())
452 {
453 facesContext.setProcessingEvents(false);
454 ComponentSupport.setCachedFacesContext(c, facesContext);
455 }
456 if (facetName == null)
457 {
458 parent.getChildren().add(c);
459 }
460 else
461 {
462 ComponentSupport.addFacet(ctx, parent, c, facetName);
463 }
464 if (componentFound && mctx.isRefreshingSection())
465 {
466 ComponentSupport.setCachedFacesContext(c, null);
467 facesContext.setProcessingEvents(oldProcessingEvents);
468 }
469 }
470
471 if (c instanceof UniqueIdVendor)
472 {
473 mctx.popUniqueIdVendorToStack();
474 }
475
476 c.popComponentFromEL(facesContext);
477
478 if (mctx.isMarkInitialState())
479 {
480
481 c.markInitialState();
482 }
483 }
484
485
486
487
488
489
490
491 protected final String getFacetName(FaceletContext ctx, UIComponent parent)
492 {
493 return (String) parent.getAttributes().get(FacetHandler.KEY);
494 }
495
496
497
498
499
500
501
502
503
504
505
506
507 protected UIComponent createComponent(FaceletContext ctx)
508 {
509 if (_componentBuilderHandlerDelegate != null)
510 {
511
512
513 return _componentBuilderHandlerDelegate.createComponent(ctx);
514 }
515 UIComponent c = null;
516 FacesContext faces = ctx.getFacesContext();
517 Application app = faces.getApplication();
518 if (_delegate.getBinding() != null)
519 {
520 ValueExpression ve = _delegate.getBinding().getValueExpression(ctx, Object.class);
521 if (PhaseId.RESTORE_VIEW.equals(faces.getCurrentPhaseId()))
522 {
523 if (!ve.isReadOnly(faces.getELContext()))
524 {
525 try
526 {
527
528
529 ve.setValue(faces.getELContext(), null);
530 }
531 catch (Exception e)
532 {
533
534 }
535 }
536 }
537 if (this._rendererType == null)
538 {
539 c = app.createComponent(ve, faces, this._componentType);
540 }
541 else
542 {
543 c = app.createComponent(ve, faces, this._componentType, this._rendererType);
544 }
545 if (c != null)
546 {
547 c.setValueExpression("binding", ve);
548
549 if (!ve.isReadOnly(faces.getELContext()))
550 {
551 ComponentSupport.getViewRoot(ctx, c).getAttributes().put("oam.CALL_PRE_DISPOSE_VIEW", Boolean.TRUE);
552 c.subscribeToEvent(PreDisposeViewEvent.class, new ClearBindingValueExpressionListener());
553 }
554
555 if (c.getChildCount() > 0 || c.getFacetCount() > 0)
556 {
557
558
559
560
561
562
563 c.getAttributes().put(DefaultFaceletsStateManagementStrategy.COMPONENT_ADDED_AFTER_BUILD_VIEW,
564 ComponentState.REMOVE_ADD);
565
566 if (FaceletViewDeclarationLanguageBase.isDynamicComponentNeedsRefresh(ctx.getFacesContext()))
567 {
568 FaceletViewDeclarationLanguageBase.resetDynamicComponentNeedsRefreshFlag(
569 ctx.getFacesContext());
570 FaceletCompositionContext mctx = FaceletCompositionContext.getCurrentInstance(ctx);
571 if (mctx.isUsingPSSOnThisView())
572 {
573 FaceletViewDeclarationLanguage.cleanTransientBuildOnRestore(faces);
574 }
575 else
576 {
577 FaceletViewDeclarationLanguageBase.activateDynamicComponentRefreshTransientBuild(faces);
578 }
579
580
581
582
583 c.getAttributes().put(
584 FaceletDynamicComponentRefreshTransientBuildEvent.
585 DYNAMIC_COMPONENT_BINDING_NEEDS_REFRESH,
586 Boolean.TRUE);
587 }
588 }
589 }
590 }
591 else
592 {
593
594
595
596
597
598
599
600
601
602
603
604
605 c = app.createComponent(faces, this._componentType, this._rendererType);
606
607 }
608 return c;
609 }
610
611
612
613
614
615
616
617
618
619 protected String getId(FaceletContext ctx)
620 {
621 if (this._id != null)
622 {
623 return this._id.getValue(ctx);
624 }
625 return ctx.generateUniqueId(_delegate.getTagId());
626 }
627
628 @Override
629 public MetaRuleset createMetaRuleset(Class type)
630 {
631 MetaRuleset m = new MetaRulesetImpl(_delegate.getTag(), type);
632
633 m.ignore("binding").ignore("id");
634
635
636 m.addRule(ComponentRule.INSTANCE);
637
638
639 m.addRule(PassthroughRuleImpl.INSTANCE);
640
641
642 if (ActionSource.class.isAssignableFrom(type))
643 {
644 m.addRule(ActionSourceRule.INSTANCE);
645 }
646
647
648 if (ValueHolder.class.isAssignableFrom(type))
649 {
650 m.addRule(ValueHolderRule.INSTANCE);
651
652
653 if (EditableValueHolder.class.isAssignableFrom(type))
654 {
655 m.ignore("submittedValue");
656 m.ignore("valid");
657 m.addRule(EditableValueHolderRule.INSTANCE);
658 }
659 }
660
661
662 m.alias("class", "styleClass");
663
664 return m;
665 }
666
667
668
669
670
671
672
673
674
675
676 private void addEnclosingAndDefaultValidators(FaceletContext ctx,
677 FaceletCompositionContext mctx,
678 FacesContext context,
679 EditableValueHolder component)
680 {
681
682 Iterator<Map.Entry<String, EditableValueHolderAttachedObjectHandler>> enclosingValidatorIds =
683 mctx.getEnclosingValidatorIdsAndHandlers();
684 if (enclosingValidatorIds != null)
685 {
686 while (enclosingValidatorIds.hasNext())
687 {
688 Map.Entry<String, EditableValueHolderAttachedObjectHandler> entry = enclosingValidatorIds.next();
689 addEnclosingValidator(context, component, entry.getKey(), entry.getValue());
690 }
691 }
692
693 Map<String, String> defaultValidators = context.getApplication().getDefaultValidatorInfo();
694 if (defaultValidators != null && defaultValidators.size() != 0)
695 {
696 for (Map.Entry<String, String> entry : defaultValidators.entrySet())
697 {
698 if (!mctx.containsEnclosingValidatorId(entry.getKey()))
699 {
700 addDefaultValidator(ctx, mctx, context, component, entry.getKey(), entry.getValue());
701 }
702 }
703 }
704 }
705
706 private void addDefaultValidator(FaceletContext ctx, FaceletCompositionContext mctx, FacesContext context,
707 EditableValueHolder component, String validatorId, String validatorClassName)
708 {
709 Validator enclosingValidator = null;
710
711 if (validatorClassName == null)
712 {
713
714
715
716 enclosingValidator = context.getApplication().createValidator(validatorId);
717 validatorClassName = enclosingValidator.getClass().getName();
718 }
719
720
721
722 Validator validator = null;
723 for (Validator v : component.getValidators())
724 {
725 if (v.getClass().getName().equals(validatorClassName))
726 {
727
728 validator = v;
729 break;
730 }
731 }
732
733 if (validator == null)
734 {
735 if (shouldAddDefaultValidator(ctx, mctx, component, validatorId))
736 {
737 if (enclosingValidator != null)
738 {
739
740 validator = enclosingValidator;
741 }
742 else
743 {
744
745 validator = context.getApplication().createValidator(validatorId);
746 }
747
748 component.addValidator(validator);
749 }
750 else
751 {
752
753 return;
754 }
755 }
756
757
758 if (validator instanceof BeanValidator)
759 {
760 BeanValidator beanValidator = (BeanValidator) validator;
761
762
763 String validationGroups = beanValidator.getValidationGroups();
764 if (validationGroups == null
765 || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
766 {
767
768
769
770
771
772
773
774
775
776
777
778 validationGroups = javax.validation.groups.Default.class.getName();
779
780 beanValidator.setValidationGroups(validationGroups);
781 }
782 }
783 }
784
785
786
787
788
789
790
791
792
793
794 @SuppressWarnings("unchecked")
795 private boolean shouldAddDefaultValidator(FaceletContext ctx, FaceletCompositionContext mctx,
796 EditableValueHolder component,
797 String validatorId)
798 {
799
800 List<String> exclusionList
801 = (List<String>) ((UIComponent) component).getAttributes()
802 .get(ValidatorTagHandlerDelegate.VALIDATOR_ID_EXCLUSION_LIST_KEY);
803 if (exclusionList != null)
804 {
805 for (String excludedId : exclusionList)
806 {
807 if (excludedId.equals(validatorId))
808 {
809 return false;
810 }
811 }
812 }
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828 Iterator<Map.Entry<String, EditableValueHolderAttachedObjectHandler>> enclosingValidatorIds =
829 mctx.getEnclosingValidatorIdsAndHandlers();
830 if (enclosingValidatorIds != null)
831 {
832 while (enclosingValidatorIds.hasNext())
833 {
834 Map.Entry<String, EditableValueHolderAttachedObjectHandler> entry = enclosingValidatorIds.next();
835 boolean validatorIdAvailable = entry.getKey() != null && !"".equals(entry.getKey());
836 if (validatorIdAvailable && entry.getKey().equals(validatorId))
837 {
838 if (((ValidatorHandler)((FacesWrapper<ValidatorHandler>)entry.getValue()).getWrapped())
839 .isDisabled(ctx))
840 {
841 return false;
842 }
843 }
844 }
845 }
846
847
848 if (validatorId.equals(BeanValidator.VALIDATOR_ID))
849 {
850 if (!ExternalSpecifications.isBeanValidationAvailable())
851 {
852
853
854
855 log.log(Level.WARNING, "Bean validation is not available on the " +
856 "classpath, thus the BeanValidator will not be added for " +
857 "the component " + component);
858 return false;
859 }
860 }
861
862
863 return true;
864 }
865
866 private void addEnclosingValidator(FacesContext context,
867 EditableValueHolder component, String validatorId,
868 EditableValueHolderAttachedObjectHandler attachedObjectHandler)
869 {
870 if (shouldAddEnclosingValidator(component, validatorId))
871 {
872 if (attachedObjectHandler != null)
873 {
874 attachedObjectHandler.applyAttachedObject(context, (UIComponent) component);
875 }
876 else
877 {
878 Validator validator = null;
879
880 validator = context.getApplication().createValidator(validatorId);
881
882
883 if (validator instanceof BeanValidator)
884 {
885 BeanValidator beanValidator = (BeanValidator) validator;
886
887
888 String validationGroups = beanValidator.getValidationGroups();
889 if (validationGroups == null
890 || validationGroups.matches(BeanValidator.EMPTY_VALIDATION_GROUPS_PATTERN))
891 {
892
893
894
895
896
897
898
899
900
901
902
903 validationGroups = javax.validation.groups.Default.class.getName();
904
905 beanValidator.setValidationGroups(validationGroups);
906 }
907 }
908
909
910 component.addValidator(validator);
911 }
912 }
913 }
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928 @SuppressWarnings("unchecked")
929 private boolean shouldAddEnclosingValidator(
930 EditableValueHolder component,
931 String validatorId)
932 {
933
934 List<String> exclusionList = (List<String>) ((UIComponent) component)
935 .getAttributes()
936 .get(ValidatorTagHandlerDelegate.VALIDATOR_ID_EXCLUSION_LIST_KEY);
937 if (exclusionList != null)
938 {
939 for (String excludedId : exclusionList)
940 {
941 if (excludedId.equals(validatorId))
942 {
943 return false;
944 }
945 }
946 }
947
948
949 if (validatorId.equals(BeanValidator.VALIDATOR_ID) &&
950 !ExternalSpecifications.isBeanValidationAvailable())
951 {
952
953
954
955 log.log(Level.WARNING,
956 "Bean validation is not available on the "
957 + "classpath, thus the BeanValidator will not be added for "
958 + "the component " + component);
959 return false;
960 }
961
962
963 return true;
964 }
965
966 private static class PublishFaceletDynamicComponentRefreshTransientBuildCallback implements VisitCallback
967 {
968 public VisitResult visit(VisitContext context, UIComponent target)
969 {
970 context.getFacesContext().getApplication().publishEvent(
971 context.getFacesContext(), FaceletDynamicComponentRefreshTransientBuildEvent.class,
972 target.getClass(), target);
973 return VisitResult.ACCEPT;
974 }
975 }
976 }