您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TXTFOEventHandlerMaker.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2005 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. /* $Id$ */
  17. package org.apache.fop.render.txt;
  18. import java.io.OutputStream;
  19. import org.apache.fop.apps.FOPException;
  20. import org.apache.fop.apps.FOUserAgent;
  21. import org.apache.fop.apps.MimeConstants;
  22. import org.apache.fop.fo.FOEventHandler;
  23. import org.apache.fop.render.AbstractFOEventHandlerMaker;
  24. /**
  25. * Maker class for the special FOEventHandler for TXT support.
  26. */
  27. public class TXTFOEventHandlerMaker extends AbstractFOEventHandlerMaker {
  28. private static final String[] MIMES = new String[] {
  29. MimeConstants.MIME_PLAIN_TEXT};
  30. /** @see org.apache.fop.render.AbstractFOEventHandlerMaker */
  31. public FOEventHandler makeFOEventHandler(FOUserAgent ua, OutputStream out) throws FOPException {
  32. return new TXTHandler(ua, out);
  33. }
  34. /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#needsOutputStream() */
  35. public boolean needsOutputStream() {
  36. return true;
  37. }
  38. /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#getSupportedMimeTypes() */
  39. public String[] getSupportedMimeTypes() {
  40. return MIMES;
  41. }
  42. }