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 Details

    • SmartTypeManagerImpl

      @Inject public SmartTypeManagerImpl(io.vertigo.core.locale.LocaleManager localeManager)
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface io.vertigo.core.node.component.Activeable
    • stop

      public void stop()
      Specified by:
      stop in interface io.vertigo.core.node.component.Activeable
    • checkType

      public void checkType(SmartTypeDefinition smartTypeDefinition, io.vertigo.core.lang.Cardinality cardinality, Object value)
      Description copied from interface: SmartTypeManager
      Checks 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:
      checkType in interface SmartTypeManager
      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: SmartTypeManager
      Validates 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:
      validate in interface SmartTypeManager
      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

      public String valueToString(SmartTypeDefinition smartTypeDefinition, Object objValue)
      Description copied from interface: SmartTypeManager
      Converts the value to a string representation.
      Specified by:
      valueToString in interface SmartTypeManager
      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: SmartTypeManager
      Converts a string to a value of the type defined by the SmartTypeDefinition.
      Specified by:
      stringToValue in interface SmartTypeManager
      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

      public Map<Class,io.vertigo.core.lang.BasicTypeAdapter> getTypeAdapters(String adapterType)
      Description copied from interface: SmartTypeManager
      Retrieves the type adapters for a given adapter type.
      Specified by:
      getTypeAdapters in interface SmartTypeManager
      Parameters:
      adapterType - The type of the adapters to be retrieved.
      Returns:
      A map of classes to their corresponding basic type adapters.