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

SequenceSpecifierSingle.java 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package org.apache.xml.fop.fo.pagination;
  2. // FOP
  3. import org.apache.xml.fop.fo.*;
  4. import org.apache.xml.fop.fo.properties.*;
  5. import org.apache.xml.fop.layout.PageMasterFactory;
  6. import org.apache.xml.fop.layout.SinglePageMasterFactory;
  7. import org.apache.xml.fop.layout.PageMaster;
  8. import org.apache.xml.fop.apps.FOPException;
  9. public class SequenceSpecifierSingle extends SequenceSpecifier {
  10. public static class Maker extends FObj.Maker {
  11. public FObj make(FObj parent, PropertyList propertyList)
  12. throws FOPException {
  13. return new SequenceSpecifierSingle(parent, propertyList);
  14. }
  15. }
  16. public static FObj.Maker maker() {
  17. return new SequenceSpecifierSingle.Maker();
  18. }
  19. private SequenceSpecification sequenceSpecification;
  20. private LayoutMasterSet layoutMasterSet;
  21. private SinglePageMasterFactory pageMasterFactory;
  22. protected SequenceSpecifierSingle(FObj parent, PropertyList propertyList)
  23. throws FOPException {
  24. super(parent, propertyList);
  25. this.name = "fo:sequence-specifer-single";
  26. if (parent.getName().equals("fo:sequence-specification")) {
  27. this.sequenceSpecification = (SequenceSpecification) parent;
  28. this.layoutMasterSet = this.sequenceSpecification.getLayoutMasterSet();
  29. } else {
  30. throw new FOPException("sequence-specifier-single must be "
  31. + "child of fo:sequence-specification, "
  32. + "not " + parent.getName());
  33. }
  34. String pageMasterName = this.properties.get("page-master-name").getString();
  35. try {
  36. this.pageMasterFactory = new SinglePageMasterFactory(this.layoutMasterSet.getLayoutMaster(pageMasterName).getPageMaster());
  37. } catch (java.lang.NullPointerException e) {
  38. throw new FOPException("page-master-name " +
  39. pageMasterName + " must be in layout-master-set");
  40. }
  41. this.sequenceSpecification.addSequenceSpecifier(this);
  42. }
  43. public PageMasterFactory getPageMasterFactory() {
  44. return this.pageMasterFactory;
  45. }
  46. public String getPageMasterName() {
  47. return this.properties.get("page-master-name").getString();
  48. }
  49. }