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 LayoutConfig
bind(Object bindingContext)
Binds the given object ad binding context to the layoutLayoutConfig
bindBeanOfType(Class<?> bindingContextType)
PURPLE Binds a bean of the given type, loading it from the dependency injection container.<T> LayoutConfig
bindBeanOfType(Class<T> bindingContextType, Qualifier<T> qualifier)
PURPLE Binds a bean of the given type and qualifier, loading it from the dependency injection container.LayoutConfig
bindTestObject()
Sets the flag to bind to the test object given in the layout resource.Object
getBindingContext()
Gets the binding context.String
getLayoutResource()
Gets the layout resource.Map<String,Object>
getTemplateExtVars()
Gets the template ext vars.boolean
isBindTestObject()
Returns the flag for the testObject usage.LayoutConfig
setTemplateExtVar(String name, Boolean bool)
Sets aBoolean
that will be available in the template underext.[name]
.LayoutConfig
setTemplateExtVar(String name, Character character)
Sets aCharacter
that will be available in the template underext.[name]
.LayoutConfig
setTemplateExtVar(String name, Number number)
Sets aNumber
that will be available in the template underext.[name]
.LayoutConfig
setTemplateExtVar(String name, String string)
Sets aString
that will be available in the template underext.[name]
.static LayoutConfig
with(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 aNumber
that 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 aString
that 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 aCharacter
that 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 aBoolean
that 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
-
-