Class SingleValueTranslator

    • Constructor Detail

      • SingleValueTranslator

        public SingleValueTranslator()
    • Method Detail

      • isEmpty

        protected boolean isEmpty​(java.lang.String expr)
        Checks whether an expression is empty.
        Parameters:
        expr - expression to check
        Returns:
        true if it is recognized as empty, false otherwise
      • getEmptyValue

        protected java.lang.Object getEmptyValue()
        The representation of an empty value this translator uses.
        Returns:
        used null value
      • importValue

        public final java.lang.Object importValue​(java.lang.String valueExpr,
                                                  Item toItem)
                                           throws JaloInvalidParameterException
        Description copied from class: AbstractValueTranslator
        Translates a tokenized csv value for import usage. This means that the result object must be a instance of the expected attribute type.
        Specified by:
        importValue in class AbstractValueTranslator
        Parameters:
        valueExpr - expression to translate
        toItem - the target item in case it already exist, null otherwise (for partOf attributes!)
        Returns:
        Object translated value
        Throws:
        JaloInvalidParameterException - value can not be translated with this translator or is invalid
      • convertToJalo

        protected abstract java.lang.Object convertToJalo​(java.lang.String expr,
                                                          Item forItem)
        Converts a non-null and non-empty string into a jalo attribute value.
        Parameters:
        expr - string to translate
        forItem - item instance the translated value will be set to as attribute
        Returns:
        Object translated value
      • convertToString

        protected abstract java.lang.String convertToString​(java.lang.Object value)
        Converts a non-null jalo attribute value into its string representation.
        Parameters:
        value - value to translate
        Returns:
        translated value