Class SmartTypeManagerImpl
java.lang.Object
io.vertigo.datamodel.impl.smarttype.SmartTypeManagerImpl
- All Implemented Interfaces:
io.vertigo.core.node.component.Activeable,io.vertigo.core.node.component.Component,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Manager,SmartTypeManager
public class SmartTypeManagerImpl
extends Object
implements SmartTypeManager, io.vertigo.core.node.component.Activeable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckType(SmartTypeDefinition smartTypeDefinition, io.vertigo.core.lang.Cardinality cardinality, Object value) Checks the type of a given value.getTypeAdapters(String adapterType) Retrieves the type adapters for a given adapter type.voidstart()voidstop()stringToValue(SmartTypeDefinition smartTypeDefinition, String strValue) Converts a string to a value of the type defined by the SmartTypeDefinition.voidvalidate(SmartTypeDefinition smartTypeDefinition, io.vertigo.core.lang.Cardinality cardinality, Object value) Validates the value by checking all the constraints.valueToString(SmartTypeDefinition smartTypeDefinition, Object objValue) Converts the value to a string representation.
-
Constructor Details
-
SmartTypeManagerImpl
@Inject public SmartTypeManagerImpl(io.vertigo.core.locale.LocaleManager localeManager)
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceio.vertigo.core.node.component.Activeable
-
stop
public void stop()- Specified by:
stopin interfaceio.vertigo.core.node.component.Activeable
-
checkType
public void checkType(SmartTypeDefinition smartTypeDefinition, io.vertigo.core.lang.Cardinality cardinality, Object value) Description copied from interface:SmartTypeManagerChecks the type of a given value. This method is used to verify if the provided value matches the expected type defined by the SmartTypeDefinition. The Cardinality parameter is used to determine if the value can be a collection (multiple values) or a single value.- Specified by:
checkTypein interfaceSmartTypeManager- Parameters:
smartTypeDefinition- The definition of the smart type, which includes the expected type of the value.cardinality- The cardinality of the value, which can be either single or multiple.value- The value to be checked.
-
validate
public void validate(SmartTypeDefinition smartTypeDefinition, io.vertigo.core.lang.Cardinality cardinality, Object value) throws ConstraintException Description copied from interface:SmartTypeManagerValidates the value by checking all the constraints. This method is used to verify if the provided value satisfies all the constraints defined by the SmartTypeDefinition. The Cardinality parameter is used to determine if the value can be a collection (multiple values) or a single value.- Specified by:
validatein interfaceSmartTypeManager- Parameters:
smartTypeDefinition- The definition of the smart type, which includes the constraints of the value.cardinality- The cardinality of the value, which can be either single or multiple.value- The value to be validated.- Throws:
ConstraintException- If the value does not satisfy the constraints.
-
valueToString
Description copied from interface:SmartTypeManagerConverts the value to a string representation.- Specified by:
valueToStringin interfaceSmartTypeManager- Parameters:
smartTypeDefinition- The definition of the smart type, which includes the expected type of the value.objValue- The value to be converted to a string.- Returns:
- The string representation of the value.
-
stringToValue
public Object stringToValue(SmartTypeDefinition smartTypeDefinition, String strValue) throws FormatterException Description copied from interface:SmartTypeManagerConverts a string to a value of the type defined by the SmartTypeDefinition.- Specified by:
stringToValuein interfaceSmartTypeManager- Parameters:
smartTypeDefinition- The definition of the smart type, which includes the expected type of the value.strValue- The string to be converted to a value.- Returns:
- The value converted from the string.
- Throws:
FormatterException- If the string cannot be converted to the expected type.
-
getTypeAdapters
Description copied from interface:SmartTypeManagerRetrieves the type adapters for a given adapter type.- Specified by:
getTypeAdaptersin interfaceSmartTypeManager- Parameters:
adapterType- The type of the adapters to be retrieved.- Returns:
- A map of classes to their corresponding basic type adapters.
-