public static void htmlWriteObjectResponsePage(String modulename, String objectname, 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())));
          { Stella_Object instance = edu.isi.powerloom.PLI.getObject(objectname, null, null);

            if (instance != null) {
              { Surrogate testValue000 = Stella_Object.safePrimaryType(instance);

                if (Surrogate.subtypeOfP(testValue000, OntosaurusUtil.SGT_LOGIC_NAMED_DESCRIPTION)) {
                  { NamedDescription instance000 = ((NamedDescription)(instance));

                    OntosaurusUtil.htmlWriteRelationResponsePage(instance000, stream);
                  }
                }
                else if (Surrogate.subtypeOfP(testValue000, OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
                  { LogicObject instance000 = ((LogicObject)(instance));

                    OntosaurusUtil.htmlWriteInstanceResponsePage(instance000, stream);
                  }
                }
                else {
                  OntosaurusUtil.htmlWriteObjectResponsePageInternal(instance, stream);
                }
              }
            }
            else {
              OntosaurusUtil.htmlUnknownObjectResponse(OntosaurusUtil.KWD_OBJECT, objectname, stream);
            }
          }

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