code: @Override
      public Dialect createCustomDialect(KamInfo kamInfo,
              List<Namespace> geneNamespaces, List<Namespace> bpNamespaces,
              List<Namespace> chemicalNamespaces, BELSyntax form,
              boolean removeNamespacePrefix) throws KAMStoreException {
  
          // cache all namespaces of the kam by prefix
          Map<String, Namespace> kamNamespaces = new HashMap<String, Namespace>();
          Map<String, NamespaceDomain> domains =
                  new HashMap<String, NamespaceDomain>();
          for (org.openbel.framework.api.internal.KAMStoreDaoImpl.Namespace ns : kAMStore.getNamespaces(kamInfo)) {
              Namespace cns = new Namespace(ns.getPrefix(),
                      ns.getResourceLocation());
              kamNamespaces.put(cns.getPrefix(), cns);
              NamespaceHeader hdr = namespaceResourceService.getHeader(cns
                      .getResourceLocation());
              domains.put(cns.getPrefix(), NamespaceDomain.forDomainString(hdr
                      .getNamespaceBlock().getDomainString()));
          }
  
          CustomDialect pd = new CustomDialect(kAMStore);
          pd.setKamNamespaces(kamNamespaces);
          pd.setNsDomains(domains);
          pd.setGeneNamespaces(geneNamespaces);
          pd.setBpNamespaces(bpNamespaces);
          pd.setChemNamespaces(chemicalNamespaces);
          if (BELSyntax.LONG_FORM.equals(form)) {
              pd.setDisplayLongForm(true);
          }
          pd.setRemoveNamespacePrefix(removeNamespacePrefix);
  
          pd.initialize();
          return pd;
      }
docs: {@inheritDoc}