1. // $Id: TransformerHandler.java,v 1.2.26.1 2004/07/13 22:27:51 jsuttor Exp $
  2. /*
  3. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  4. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  5. */
  6. /*
  7. * @(#)TransformerHandler.java 1.13 04/07/13
  8. */
  9. package javax.xml.transform.sax;
  10. import javax.xml.transform.Result;
  11. import javax.xml.transform.Transformer;
  12. import org.xml.sax.ContentHandler;
  13. import org.xml.sax.DTDHandler;
  14. import org.xml.sax.ext.LexicalHandler;
  15. /**
  16. * A TransformerHandler
  17. * listens for SAX ContentHandler parse events and transforms
  18. * them to a Result.
  19. */
  20. public interface TransformerHandler
  21. extends ContentHandler, LexicalHandler, DTDHandler {
  22. /**
  23. * <p>Set the <code>Result</code> associated with this
  24. * <code>TransformerHandler</code> to be used for the transformation.</p>
  25. *
  26. * @param result A <code>Result</code> instance, should not be
  27. * <code>null<code>.
  28. *
  29. * @throws IllegalArgumentException if result is invalid for some reason.
  30. */
  31. public void setResult(Result result) throws IllegalArgumentException;
  32. /**
  33. * Set the base ID (URI or system ID) from where relative
  34. * URLs will be resolved.
  35. * @param systemID Base URI for the source tree.
  36. */
  37. public void setSystemId(String systemID);
  38. /**
  39. * Get the base ID (URI or system ID) from where relative
  40. * URLs will be resolved.
  41. * @return The systemID that was set with {@link #setSystemId}.
  42. */
  43. public String getSystemId();
  44. /**
  45. * <p>Get the <code>Transformer</code> associated with this handler, which
  46. * is needed in order to set parameters and output properties.</p>
  47. *
  48. * @return <code>Transformer</code> associated with this
  49. * <code>TransformerHandler</code>.
  50. */
  51. public Transformer getTransformer();
  52. }