Class AttributeGetter.AttributeGetterElaborator

  • Enclosing class:
    AttributeGetter

    public static class AttributeGetter.AttributeGetterElaborator
    extends ItemElaborator
    Elaborator for an AttributeGetter expression (which gets a named attribute of the context item and returns its value as an untyped atomic value)
    • Constructor Detail

      • AttributeGetterElaborator

        public AttributeGetterElaborator()
    • Method Detail

      • elaborateForItem

        public ItemEvaluator elaborateForItem()
        Description copied from class: Elaborator
        Get a function that evaluates the underlying expression in the form of a Item. This must only be called for expressions whose result has cardinality zero or one.
        Specified by:
        elaborateForItem in class ItemElaborator
        Returns:
        an evaluator for the expression that returns an Item, or null to represent an empty sequence.
      • elaborateForString

        public StringEvaluator elaborateForString​(boolean zeroLengthWhenAbsent)
        Get a function that evaluates the underlying expression in the form of a Java string, this being the result of applying fn:string() to the result of the expression; except that if the result of the expression is an empty sequence, the result is "" if zeroLengthWhenAbsent is set, or null otherwise.
        Overrides:
        elaborateForString in class Elaborator
        Parameters:
        zeroLengthWhenAbsent - if true, then when the result of the expression is an empty sequence, the result of the StringEvaluator should be a zero-length string. If false, the return value should be null.
        Returns:
        an evaluator for the expression that returns a string.