Interface ReferenceResolver

  • All Known Implementing Classes:
    RefResolver

    public interface ReferenceResolver
    Everything one needs to know about reference macro and its resolution.

    New alternative to original ReferenceResolver, taking its approach to extreme, with all relevant parameters being part of the resolver. Another possible approach is to abstract with resolver execution code only, and pass relevant parameters (e.g. output node, reference, etc) as a separate context object. While latter approach is better from general perspective (code reuse), present way to define reference macros is tightly bound to output node, reference role and template node (in fact, it's the only way to define RM now), that there's little sense to escape this fact. However, once (and if) we introduce external utility functions, we might need to re-consider this approach (i.e. of few RM would happen to use same function, we'd need abstraction for execution code to be separate from RM's context). The reason I wrote this here is that there are ReferenceInfo implementations that mirror most of this ReferenceResolver2 stuff, and perhaps should be merged into a common approach.

    • Method Detail

      • getDefaultResolveInfo

        @Nullable
        String getDefaultResolveInfo()
        Returns:
        text of link target under the macro, if any.
      • resolve

        Object resolve()
        FIXME perhaps, shall get a typed return value? SNode or <T> or a join of (SNode|String|SNodeReference)?