Exemple #1
0
 /**
  * Add the DTD for the profileSet device
  *
  * @param profileSet Device Context
  * @param stream DTD data stream.
  */
 public static void addDTD(ProfileSet profileSet, InputStream stream) {
   try {
     com.wutka.dtd.DTDParser parser = new com.wutka.dtd.DTDParser(new InputStreamReader(stream));
     DTD dtd = parser.parse();
     dtds.put(profileSet, dtd);
   } catch (Exception excep) {
     IllegalStateException state =
         new IllegalStateException("Error parsing dtd for [" + profileSet.getBaseProfile() + "].");
     state.initCause(excep);
     throw state;
   }
 }
Exemple #2
0
  /**
   * Get the DTD for the profile.
   *
   * @param profileSet Profile set.
   * @return The DTD for the deviceContext device.
   */
  private static DTD getDTD(ProfileSet profileSet) {
    DTD dtd;

    if (profileSet == null) {
      throw new IllegalArgumentException("null 'profileSet' arg in method call.");
    }

    dtd = dtds.get(profileSet);
    if (dtd == null) {
      throw new IllegalStateException(
          "Error loading device dtd for [" + profileSet.getBaseProfile() + "].");
    }

    return dtd;
  }