Class StubReferenceFactory

  • All Implemented Interfaces:
    ReferenceFactory

    public final class StubReferenceFactory
    extends Object
    implements ReferenceFactory
    Look up models with same name among all visible models for a given module. Has nothing to do with stubs except for the fact its only use is in java stub resolution mechanism.
    • Constructor Detail

      • StubReferenceFactory

        public StubReferenceFactory​(@NotNull
                                    SModule module,
                                    @NotNull
                                    SModel model)
        Parameters:
        module - module we try to resolve references in, provides dependencies
        model - model we try to resolve references in, ensures priority of local nodes over those from dependencies
    • Method Detail

      • create

        @NotNull
        public SReference create​(SNode source,
                                 String pack,
                                 SNodeId targetNodeId,
                                 SReferenceLink role,
                                 String resolveInfo,
                                 SNodeId targetTopClassifier)
        Description copied from interface: ReferenceFactory
        For a given package name and id of target classifier(?), build a model reference (tailored for the given role in the source node)
        Specified by:
        create in interface ReferenceFactory
        Parameters:
        source - origin of the link
        pack - name of Java package
        targetNodeId - identifies classifier(?) we look up
        role - role of the link to populate
        resolveInfo - additional information that descripes the link
        targetTopClassifier - id of root classifier that holds target node (may be the same as targetNodeId). Hint value to pick best possible package and not to force complete model load. Since we load stub models in two steps, with roots available first, check for top classifier through SModel.getNode(SNodeId) doesn't trigger complete load.
        Returns:
        reference to add, never null