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.

AFPExtensionAttachment.java 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.afp.extensions;
  19. import java.io.Serializable;
  20. import org.apache.xmlgraphics.util.XMLizable;
  21. import org.apache.fop.fo.extensions.ExtensionAttachment;
  22. /**
  23. * This is the pass-through value object for the AFP extension.
  24. */
  25. public abstract class AFPExtensionAttachment
  26. implements ExtensionAttachment, Serializable, XMLizable {
  27. private static final long serialVersionUID = 7190606822558332901L;
  28. /** The category URI for this extension attachment. */
  29. public static final String CATEGORY = "apache:fop:extensions:afp";
  30. /** name attribute */
  31. protected static final String ATT_NAME = "name";
  32. /**
  33. * the extension element name
  34. */
  35. protected String elementName;
  36. /**
  37. * the extension name attribute
  38. */
  39. protected String name;
  40. /**
  41. * Default constructor.
  42. *
  43. * @param elementName the name of the afp extension attachment, may be null
  44. */
  45. public AFPExtensionAttachment(String elementName) {
  46. this.elementName = elementName;
  47. }
  48. /** @return the name */
  49. public String getElementName() {
  50. return elementName;
  51. }
  52. /**
  53. * @return true if this element has a name attribute
  54. */
  55. protected boolean hasName() {
  56. return name != null;
  57. }
  58. /** @return the name */
  59. public String getName() {
  60. return name;
  61. }
  62. /**
  63. * Sets the name of the setup code object.
  64. * @param name The name to set.
  65. */
  66. public void setName(String name) {
  67. this.name = name;
  68. }
  69. /** {@inheritDoc} */
  70. public String getCategory() {
  71. return CATEGORY;
  72. }
  73. }