Beispiel #1
0
  /**
   * Constructs a <code>DocFlavor</code> object with the given MIME type and representation class
   * name.
   *
   * @param mimeType the MIME type string.
   * @param className the fully-qualified name of the representation class.
   * @throws NullPointerException if mimeType or className are <code>null</code>.
   * @throws IllegalArgumentException if given mimeType has syntax errors.
   */
  public DocFlavor(String mimeType, String className) {
    if (mimeType == null || className == null) throw new NullPointerException();

    params = new TreeMap();
    parseMimeType(mimeType);

    myClassName = className;
  }
Beispiel #2
0
 // needs special treatment for serialization
 private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
   params = new TreeMap();
   myClassName = (String) stream.readObject();
   parseMimeType((String) stream.readObject());
 }