Ejemplo n.º 1
0
 /**
  * This will invoke the <code>ContentHandler.processingInstruction</code> callback when a
  * processing instruction is encountered.
  *
  * @param pi <code>ProcessingInstruction</code> containing target and data.
  */
 private void processingInstruction(ProcessingInstruction pi) throws JDOMException {
   if (pi != null) {
     String target = pi.getTarget();
     String data = pi.getData();
     try {
       contentHandler.processingInstruction(target, data);
     } catch (SAXException se) {
       throw new JDOMException("Exception in processingInstruction", se);
     }
   }
 }
  /**
   * This will return a clone of this <code>ProcessingInstruction</code>.
   *
   * @return <code>Object</code> - clone of this <code>ProcessingInstruction</code>.
   */
  @Override
  public ProcessingInstruction clone() {
    ProcessingInstruction pi = (ProcessingInstruction) super.clone();

    // target and rawdata are immutable and references copied by
    // Object.clone()

    // Create a new Map object for the clone (since Map isn't Cloneable)
    if (mapData != null) {
      pi.mapData = parseData(rawData);
    }
    return pi;
  }