public static void htmlWriteFindObjectResponsePage(String modulename, String objectname, String objecttype, Keyword matchtype, org.powerloom.PrintableStringWriter stream) {
    { Module module = Stella.getStellaModule(modulename, false);

      if (module == null) {
        OntosaurusUtil.htmlUnknownModuleResponse(OntosaurusUtil.KWD_RELATION, objectname, modulename, stream);
        return;
      }
      { Object old$Module$000 = Stella.$MODULE$.get();
        Object old$Context$000 = Stella.$CONTEXT$.get();

        try {
          Native.setSpecial(Stella.$MODULE$, module);
          Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
          { List candidateobjects = OntosaurusUtil.findCandidateObjects(objectname, objecttype, matchtype);

            switch (candidateobjects.length()) {
              case 0:
                OntosaurusUtil.htmlUnknownObjectResponse((Stella.stringEqlP(objecttype, "instance") ? OntosaurusUtil.KWD_OBJECT : OntosaurusUtil.KWD_RELATION), objectname, stream);
              break;
              case 1:
                { Surrogate testValue000 = Stella_Object.safePrimaryType(((LogicObject)(candidateobjects.first())));

                  if (Surrogate.subtypeOfP(testValue000, OntosaurusUtil.SGT_LOGIC_NAMED_DESCRIPTION)) {
                    OntosaurusUtil.htmlWriteRelationResponsePage(((NamedDescription)(OntosaurusUtil.resolveSynonyms(((LogicObject)(candidateobjects.first()))))), stream);
                  }
                  else if (Surrogate.subtypeOfP(testValue000, OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
                    OntosaurusUtil.htmlWriteInstanceResponsePage(OntosaurusUtil.resolveSynonyms(((LogicObject)(candidateobjects.first()))), stream);
                  }
                  else {
                    throw ((StellaException)(StellaException.newStellaException("Can't handle object in html-write-find-object-response-page").fillInStackTrace()));
                  }
                }
              break;
              default:
                OntosaurusUtil.htmlWriteMultipleChoicePage(objectname, candidateobjects, stream);
              break;
            }
          }

        } finally {
          Stella.$CONTEXT$.set(old$Context$000);
          Stella.$MODULE$.set(old$Module$000);
        }
      }
    }
  }