1. /*
  2. * Copyright 2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.betwixt.io;
  17. import org.apache.commons.betwixt.ElementDescriptor;
  18. /**
  19. * <p>Context against which content should be written.</p>
  20. * <p>
  21. * <strong>Usage:</strong>
  22. * This (logical) interface is a <em>Parameter Object</em>
  23. * allowing additional, <code>Betwixt</code>-specific information
  24. * to be passed through the SAX-inspired writing API.
  25. * </p>
  26. * <p>
  27. * It is likely that access will be required to methods in the
  28. * <code>Context</code> used by the {@link AbstractBeanWriter}
  29. * but it seems better to add these as neccessary using delegation
  30. * rather than extending {@link Context}.
  31. * </p>
  32. * @author <a href='http://jakarta.apache.org/'>Jakarta Commons Team</a>
  33. * @since 0.5
  34. */
  35. public abstract class WriteContext {
  36. /**
  37. * Gets the descriptor for the element who content
  38. * is currently being created.
  39. *
  40. * @return the <code>ElementDescriptor</code> for the
  41. * current element (or null if there is no current element)
  42. */
  43. public abstract ElementDescriptor getCurrentDescriptor();
  44. }