Package io.nevernull.mobileui
Class LayoutConfig
- java.lang.Object
-
- io.nevernull.mobileui.LayoutConfig
-
public class LayoutConfig extends Object
Configuration for MobileUILayouts on Android and iOS. This configuration has a builder-api and can be used for the MobileUILayout constructors on both platforms.- Since:
- 0.4.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LayoutConfigbind(Object bindingContext)Binds the given object ad binding context to the layoutLayoutConfigbindBeanOfType(Class<?> bindingContextType)PURPLE Binds a bean of the given type, loading it from the dependency injection container.<T> LayoutConfigbindBeanOfType(Class<T> bindingContextType, Qualifier<T> qualifier)PURPLE Binds a bean of the given type and qualifier, loading it from the dependency injection container.LayoutConfigbindTestObject()Sets the flag to bind to the test object given in the layout resource.ObjectgetBindingContext()Gets the binding context.StringgetLayoutResource()Gets the layout resource.Map<String,Object>getTemplateExtVars()Gets the template ext vars.booleanisBindTestObject()Returns the flag for the testObject usage.LayoutConfigsetTemplateExtVar(String name, Boolean bool)Sets aBooleanthat will be available in the template underext.[name].LayoutConfigsetTemplateExtVar(String name, Character character)Sets aCharacterthat will be available in the template underext.[name].LayoutConfigsetTemplateExtVar(String name, Number number)Sets aNumberthat will be available in the template underext.[name].LayoutConfigsetTemplateExtVar(String name, String string)Sets aStringthat will be available in the template underext.[name].static LayoutConfigwith(String layout)Constructs a configuration for the layout resource given here.
-
-
-
Method Detail
-
with
@Nonnull public static LayoutConfig with(@Nonnull String layout)
Constructs a configuration for the layout resource given here.- Parameters:
layout- the layout resource- Returns:
- the layout config
-
bind
@Nonnull public LayoutConfig bind(@Nonnull Object bindingContext)
Binds the given object ad binding context to the layout- Parameters:
bindingContext- the binding context- Returns:
- the layout config
-
bindBeanOfType
@Nonnull public LayoutConfig bindBeanOfType(@Nonnull Class<?> bindingContextType)
PURPLE Binds a bean of the given type, loading it from the dependency injection container. This method is only available, if you have mobileui-inject on your classpath.- Parameters:
bindingContextType- the type of bean that should be bound. It will be loaded from the dependency injection container.- Returns:
- the layout config
-
bindBeanOfType
@Nonnull public <T> LayoutConfig bindBeanOfType(@Nonnull Class<T> bindingContextType, @Nonnull Qualifier<T> qualifier)
PURPLE Binds a bean of the given type and qualifier, loading it from the dependency injection container. This method is only available, if you have mobileui-inject on your classpath.- Type Parameters:
T- the type parameter- Parameters:
bindingContextType- the type of bean that should be bound. It will be loaded from the dependency injection container.qualifier- the qualifier of the bean- Returns:
- the layout config
-
bindTestObject
@Nonnull public LayoutConfig bindTestObject()
Sets the flag to bind to the test object given in the layout resource.- Returns:
- the layout config
-
setTemplateExtVar
@Nonnull public LayoutConfig setTemplateExtVar(@Nonnull String name, @Nonnull Number number)
Sets aNumberthat will be available in the template underext.[name].- Parameters:
name- the namenumber- the number- Returns:
- the layout config
-
setTemplateExtVar
@Nonnull public LayoutConfig setTemplateExtVar(@Nonnull String name, @Nonnull String string)
Sets aStringthat will be available in the template underext.[name].- Parameters:
name- the namestring- the string- Returns:
- the layout config
-
setTemplateExtVar
@Nonnull public LayoutConfig setTemplateExtVar(@Nonnull String name, @Nonnull Character character)
Sets aCharacterthat will be available in the template underext.[name].- Parameters:
name- the namecharacter- the character- Returns:
- the layout config
-
setTemplateExtVar
@Nonnull public LayoutConfig setTemplateExtVar(@Nonnull String name, @Nonnull Boolean bool)
Sets aBooleanthat will be available in the template underext.[name].- Parameters:
name- the namebool- the boolean- Returns:
- the layout config
-
getTemplateExtVars
@Nonnull public Map<String,Object> getTemplateExtVars()
Gets the template ext vars.- Returns:
- the template ext vars
-
getLayoutResource
@Nonnull public String getLayoutResource()
Gets the layout resource.- Returns:
- the layout resource
-
getBindingContext
@Nonnull public Object getBindingContext()
Gets the binding context.- Returns:
- the binding context
-
isBindTestObject
public boolean isBindTestObject()
Returns the flag for the testObject usage.- Returns:
- the boolean
-
-