Interface TdomAttributeMissingSupplier<A>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TdomAttributeMissingSupplier<A>
Intended to match tdom element constructor calls as arguments for exception handler strategies.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <A> A
    Wrapper for a tdom element constructor invocation when the author knows that all #REQUIRED attributes are provided.
    get()
     
  • Method Details

    • get

      Throws:
      TdomAttributeMissingException
    • assertAttrsComplete

      static <A> A assertAttrsComplete(TdomAttributeMissingSupplier<? extends A> source)
      Wrapper for a tdom element constructor invocation when the author knows that all #REQUIRED attributes are provided. The typical usage pattern is to catch TdomAttributeMissingExceptions in the middle of a deep nested constructor invocation, which often arises in functional bottom-up programming style. Example:
         new Element_a 
          (... ,
           assertAttrsComplete(()->new Element_b(){
                                initAttrs(){ assertAttrSetValid(getAttr_x(), "y"); }}),
           ...)
         
      This example requires that Attr_x is the only required attribute in Element_b. Since it is required, its .setValue(..) function always throws an AttributeSyntaxException, since null is not allowed.

      (FIXME differenzierung zwischen TdomAttributeSyntaxException und TdomAttributeNullException gips noch nicht.)

      Throws:
      source - a supplier, mostly a lambda-wrapper ()->new E(..) round a constructor invocation
      AssertionError - if a TdomAttributeMissingException is caught