You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PSExtensionElementMapping.java 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.render.ps.extensions;
  19. import org.apache.fop.fo.ElementMapping;
  20. import org.apache.fop.fo.FONode;
  21. /**
  22. * This class provides the element mapping for the PostScript-specific extensions.
  23. */
  24. public class PSExtensionElementMapping extends ElementMapping {
  25. /** Namespace for the extension */
  26. public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/postscript";
  27. /** Main constructor */
  28. public PSExtensionElementMapping() {
  29. this.namespaceURI = NAMESPACE;
  30. }
  31. /** {@inheritDoc} */
  32. protected void initialize() {
  33. if (foObjs == null) {
  34. foObjs = new java.util.HashMap<String, Maker>();
  35. foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker());
  36. foObjs.put(PSPageSetupCodeElement.ELEMENT, new PSPageSetupCodeMaker());
  37. foObjs.put(PSPageTrailerCodeBefore.ELEMENT, new PSPageTrailerCodeBeforeMaker());
  38. foObjs.put(PSSetPageDeviceElement.ELEMENT, new PSSetPageDeviceMaker());
  39. foObjs.put(PSCommentBefore.ELEMENT, new PSCommentBeforeMaker());
  40. foObjs.put(PSCommentAfter.ELEMENT, new PSCommentAfterMaker());
  41. }
  42. }
  43. static class PSSetupCodeMaker extends ElementMapping.Maker {
  44. public FONode make(FONode parent) {
  45. return new PSSetupCodeElement(parent);
  46. }
  47. }
  48. static class PSPageSetupCodeMaker extends ElementMapping.Maker {
  49. public FONode make(FONode parent) {
  50. return new PSPageSetupCodeElement(parent);
  51. }
  52. }
  53. static class PSPageTrailerCodeBeforeMaker extends ElementMapping.Maker {
  54. public FONode make(FONode parent) {
  55. return new PSPageTrailerCodeBeforeElement(parent);
  56. }
  57. }
  58. static class PSSetPageDeviceMaker extends ElementMapping.Maker {
  59. public FONode make(FONode parent) {
  60. return new PSSetPageDeviceElement(parent);
  61. }
  62. }
  63. static class PSCommentBeforeMaker extends ElementMapping.Maker {
  64. public FONode make(FONode parent) {
  65. return new PSCommentBeforeElement(parent);
  66. }
  67. }
  68. static class PSCommentAfterMaker extends ElementMapping.Maker {
  69. public FONode make(FONode parent) {
  70. return new PSCommentAfterElement(parent);
  71. }
  72. }
  73. }