Class ClassificationAttributeValueTranslator


  • public class ClassificationAttributeValueTranslator
    extends SingleValueTranslator
    Translates a String to a ClassificationAttributeValue and vice versa. For translating the String to an attribute value, all assigned values of the specified classification attribute in respect to the classification class will be checked for a matching of code or name. In case of translating an attribute value to a String simply the code of the value is used.
    • Constructor Detail

      • ClassificationAttributeValueTranslator

        public ClassificationAttributeValueTranslator​(ClassAttributeAssignment assignment)
        Creates a new translator specifying the assignment which can be used for retrieving all assigned values as well as the calling translator for retrieving of context information.
        Parameters:
        assignment - will be used for retrieving all assigned values
    • Method Detail

      • convertToJalo

        protected java.lang.Object convertToJalo​(java.lang.String string,
                                                 Item item)
        Description copied from class: SingleValueTranslator
        Converts a non-null and non-empty string into a jalo attribute value.
        Specified by:
        convertToJalo in class SingleValueTranslator
        Parameters:
        string - string to translate
        item - item instance the translated value will be set to as attribute
        Returns:
        Object translated value
      • convertToString

        protected java.lang.String convertToString​(java.lang.Object obj)
        Description copied from class: SingleValueTranslator
        Converts a non-null jalo attribute value into its string representation.
        Specified by:
        convertToString in class SingleValueTranslator
        Parameters:
        obj - value to translate
        Returns:
        translated value