code: public static Transliterator getInstance(String ID,
                                               int dir) {
          StringBuffer canonID = new StringBuffer();
          List<SingleID> list = new ArrayList<SingleID>();
          UnicodeSet[] globalFilter = new UnicodeSet[1];
          if (!TransliteratorIDParser.parseCompoundID(ID, dir, canonID, list, globalFilter)) {
              throw new IllegalArgumentException("Invalid ID " + ID);
          }
  
          List<Transliterator> translits = TransliteratorIDParser.instantiateList(list);
  
          // assert(list.size() > 0);
          Transliterator t = null;
          if (list.size() > 1 || canonID.indexOf(";") >= 0) {
              // [NOTE: If it's a compoundID, we instantiate a CompoundTransliterator even if it only
              // has one child transliterator.  This is so that toRules() will return the right thing
              // (without any inactive ID), but our main ID still comes out correct.  That is, if we
              // instantiate "(Lower);Latin-Greek;", we want the rules to come out as "::Latin-Greek;"
              // even though the ID is "(Lower);Latin-Greek;".
              t = new CompoundTransliterator(translits);
          }
          else {
              t = translits.get(0);
          }
  
          t.setID(canonID.toString());
          if (globalFilter[0] != null) {
              t.setFilter(globalFilter[0]);
          }
          return t;
      }
docs: Returns a <code>Transliterator</code> object given its ID.
  The ID must be either a system transliterator ID or a ID registered
  using <code>registerClass()</code>.
  
  @param ID a valid ID, as enumerated by <code>getAvailableIDs()</code>
  @param dir either FORWARD or REVERSE.  If REVERSE then the
  inverse of the given ID is instantiated.
  @return A <code>Transliterator</code> object with the given ID
  @exception IllegalArgumentException if the given ID is invalid.
  @see #registerClass
  @see #getAvailableIDs
  @see #getID