Class DefaultPreferenceScopeTypes
- java.lang.Object
-
- org.uberfire.preferences.shared.impl.DefaultPreferenceScopeTypes
-
- All Implemented Interfaces:
PreferenceScopeTypes
@ApplicationScoped public class DefaultPreferenceScopeTypes extends Object implements PreferenceScopeTypes
Default implementation forPreferenceScopeTypes. To override it, just provide a default CDI bean that implementsPreferenceScopeTypes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceDefaultPreferenceScopeTypes.DefaultKey
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultPreferenceScopeTypes()DefaultPreferenceScopeTypes(UsernameProvider usernameProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDefaultKeyFor(String type)Returns the default key for a type.protected booleanisEmpty(String str)booleantypeRequiresKey(String type)Checks if a scope type requires a custom key.protected voidvalidateType(String type)
-
-
-
Constructor Detail
-
DefaultPreferenceScopeTypes
protected DefaultPreferenceScopeTypes()
-
DefaultPreferenceScopeTypes
@Inject public DefaultPreferenceScopeTypes(UsernameProvider usernameProvider)
-
-
Method Detail
-
typeRequiresKey
public boolean typeRequiresKey(String type) throws InvalidPreferenceScopeException
Description copied from interface:PreferenceScopeTypesChecks if a scope type requires a custom key.- Specified by:
typeRequiresKeyin interfacePreferenceScopeTypes- Parameters:
type- Type to check.- Returns:
- true if the type requires a custom key or false if it has a default one.
- Throws:
InvalidPreferenceScopeException- if the type passed is invalid.
-
getDefaultKeyFor
public String getDefaultKeyFor(String type) throws InvalidPreferenceScopeException
Description copied from interface:PreferenceScopeTypesReturns the default key for a type. Throws a exception if the type requires a custom one.- Specified by:
getDefaultKeyForin interfacePreferenceScopeTypes- Parameters:
type- Type to check.- Returns:
- Default key for the type (or null if there is not one).
- Throws:
InvalidPreferenceScopeException- if the type passed is invalid.
-
validateType
protected void validateType(String type) throws InvalidPreferenceScopeException
- Throws:
InvalidPreferenceScopeException
-
isEmpty
protected boolean isEmpty(String str)
-
-