選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

PlanElementMapping.java 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.plan;
  19. import org.w3c.dom.DOMImplementation;
  20. import org.apache.fop.fo.ElementMapping;
  21. import org.apache.fop.fo.FONode;
  22. /**
  23. * This class provides the element mapping for FOP.
  24. */
  25. public class PlanElementMapping extends ElementMapping {
  26. /** Plan Namespace */
  27. public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/plan";
  28. /** Main constructor. */
  29. public PlanElementMapping() {
  30. this.namespaceURI = NAMESPACE;
  31. }
  32. /** {@inheritDoc} */
  33. public DOMImplementation getDOMImplementation() {
  34. return getDefaultDOMImplementation();
  35. }
  36. /** {@inheritDoc} */
  37. protected void initialize() {
  38. if (foObjs == null) {
  39. foObjs = new java.util.HashMap<String, Maker>();
  40. foObjs.put("plan", new PE());
  41. foObjs.put(DEFAULT, new PlanMaker());
  42. }
  43. }
  44. static class PlanMaker extends ElementMapping.Maker {
  45. public FONode make(FONode parent) {
  46. return new PlanObj(parent);
  47. }
  48. }
  49. static class PE extends ElementMapping.Maker {
  50. public FONode make(FONode parent) {
  51. return new PlanElement(parent);
  52. }
  53. }
  54. }