Class ComponentConfigDecorator
- java.lang.Object
-
- de.cuioss.test.jsf.config.decorator.ComponentConfigDecorator
-
public class ComponentConfigDecorator extends Object
- Author:
- Oliver Wolff
-
-
Constructor Summary
Constructors Constructor Description ComponentConfigDecorator(@NonNull Application application, @NonNull FacesContext facesContext)
-
Method Summary
-
-
-
Constructor Detail
-
ComponentConfigDecorator
public ComponentConfigDecorator(@NonNull @NonNull Application application, @NonNull @NonNull FacesContext facesContext)
-
-
Method Detail
-
registerValidator
public ComponentConfigDecorator registerValidator(String validatorId, Class<? extends Validator> validator)
Adds addValidatorto the given id.- Parameters:
validatorId- the id theValidatorshould be registered with, must not be nullvalidator- the actualValidatorclass, must not be null.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerValidator
public ComponentConfigDecorator registerValidator(Class<? extends Validator> validator)
Adds addValidatorthe needed validatorId is retrieved fromFacesValidator.- Parameters:
validator- the actualValidatorclass, must not be null. In order to work theValidatormust provide theFacesValidatorannotation in order to identify the the needed validatorId- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerConverter
public ComponentConfigDecorator registerConverter(Class<? extends Converter> converter, Class<?> targetClass)
Register aConverterfor a given target class.- Parameters:
converter- to be registered , must not be nulltargetClass- must not be null- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerConverter
public ComponentConfigDecorator registerConverter(Class<? extends Converter> converter)
Register aConverterfor a given target class.- Parameters:
converter- to be registered , must not be null and must provide aFacesConverterannotation for deriving targetType or converter.id- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerConverter
public ComponentConfigDecorator registerConverter(Class<? extends Converter> converter, String converterId)
Register aConverterto a given converterId.- Parameters:
converter- to be registered , must not be nullconverterId- must not be null- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerUIComponent
public ComponentConfigDecorator registerUIComponent(String componentType, Class<? extends UIComponent> component)
Registers aUIComponent- Parameters:
componentType- identifying the component, must not be nullcomponent- the actual component, must not be null- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerUIComponent
public ComponentConfigDecorator registerUIComponent(Class<? extends UIComponent> component)
Registers aUIComponent- Parameters:
component- the actual component, must not be null must provide theFacesComponentannotation to derive the componentId to be registered to.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerCuiMockComponentWithRenderer
public ComponentConfigDecorator registerCuiMockComponentWithRenderer()
Shorthand for registering aCuiMockComponentwith aCuiMockRenderer.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerMockRenderer
public ComponentConfigDecorator registerMockRenderer(String family, String rendererType)
Registers aCuiMockRendererfor the given attributes.- Parameters:
family- identifying the component-family the renderer is related to, must not be nullrendererType- identifying the type of the renderer is related to, must not be null- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerMockRendererForHtmlOutputText
public ComponentConfigDecorator registerMockRendererForHtmlOutputText()
Shorthand for registering aCuiMockRendererforHtmlOutputText.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerMockRendererForHtmlSelectBooleanCheckbox
public ComponentConfigDecorator registerMockRendererForHtmlSelectBooleanCheckbox()
Shorthand for registering aCuiMockRendererforHtmlSelectBooleanCheckbox.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerMockRendererForHtmlSelectOneRadio
public ComponentConfigDecorator registerMockRendererForHtmlSelectOneRadio()
Shorthand for registering aCuiMockRendererforHtmlSelectOneRadio.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerMockRendererForHtmlInputText
public ComponentConfigDecorator registerMockRendererForHtmlInputText()
Shorthand for registering aCuiMockRendererforHtmlInputText.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerMockRendererForHtmlForm
public ComponentConfigDecorator registerMockRendererForHtmlForm()
Shorthand for registering aCuiMockRendererforHtmlForm.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerMockRendererForCommandButton
public ComponentConfigDecorator registerMockRendererForCommandButton()
Shorthand for registering aCuiMockRendererforHtmlCommandButton.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerRenderer
public ComponentConfigDecorator registerRenderer(String family, String rendererType, Renderer renderer)
Registers aRenderer- Parameters:
family- identifying the component-family the renderer is related to, must not be nullrendererType- identifying the type of the renderer is related to, must not be nullrenderer- the actual renderer to be registered, must not be null- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerRenderer
public ComponentConfigDecorator registerRenderer(Class<? extends Renderer> renderer)
Registers aRendererThe family and rendererType will be derived by the mandatoryFacesRendererannotation- Parameters:
renderer- the actual renderer to be registered, must not be null, must provideFacesRendererannotation and a no arg public constructor.- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerBehavior
public ComponentConfigDecorator registerBehavior(String behaviorId, Class<? extends ClientBehavior> behaviorClass)
Register aClientBehaviorfor a given behaviorId- Parameters:
behaviorId- the id theClientBehaviorshould be registered with, must not be nullbehaviorClass- the actual type of theClientBehaviormust not be null- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerBehavior
public ComponentConfigDecorator registerBehavior(Class<? extends ClientBehavior> behaviorClass)
Register aClientBehavior. The behaviorId will be extracted by the mandatoryFacesBehaviorannotation- Parameters:
behaviorClass- the actual type of theClientBehaviormust not be null and provide theFacesBehaviorannotation in order to extract the correct behaviorId- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
registerCompositeComponent
public ComponentConfigDecorator registerCompositeComponent(String libraryName, String tagName, UIComponent uiComponent)
Register a composite component to be rendered.- Parameters:
libraryName- the library name like "http://xmlns.jcp.org/jsf/composite/" or "tagName- the tag nameuiComponent- the component that should be returned as mock / placeholder for the composite component- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
addUiComponent
public ComponentConfigDecorator addUiComponent(String expr, UIComponent component)
Add a component to the view root to be found when searching viaUIComponentBase.findComponent(String).- Parameters:
expr- the expression the component should be found withcomponent- the component- Returns:
- the
ComponentConfigDecoratoritself in order to enable a fluent-api style usage
-
-