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.

AFPAttribute.java 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2006 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.afp.extensions;
  18. import org.apache.fop.apps.FOPException;
  19. import org.apache.fop.fo.PropertyList;
  20. import org.apache.fop.fo.properties.Property;
  21. import org.apache.fop.fo.properties.StringProperty;
  22. /**
  23. * This class extends the org.apache.fop.fo.StringProperty.Maker inner class
  24. * in order to provide a static property maker. The object faciliates
  25. * extraction of attributes from formatted objects based on the static list
  26. * as defined in the AFPElementMapping implementation.
  27. * <p/>
  28. */
  29. public class AFPAttribute extends StringProperty.Maker {
  30. /**
  31. * The attribute property.
  32. */
  33. private Property _property;
  34. /**
  35. * Constructor for the AFPAttribute.
  36. * @param name The attribute name
  37. */
  38. protected AFPAttribute(String name) {
  39. super(0);
  40. _property = null;
  41. }
  42. /**
  43. * Overide the make method to return the property object
  44. * @return property The property object.
  45. */
  46. public Property make(PropertyList propertyList) {
  47. if (_property == null) {
  48. _property = make(propertyList, "", propertyList.getParentFObj());
  49. }
  50. return _property;
  51. }
  52. }