Package org.apache.fop.pdf
Class VersionController
- java.lang.Object
-
- org.apache.fop.pdf.VersionController
-
- Direct Known Subclasses:
VersionController.DynamicVersion
,VersionController.FixedVersion
public abstract class VersionController extends java.lang.Object
An abstraction that controls the mutability of the PDF version for a document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
VersionController.DynamicVersion
A class representing the version of a PDF document.private static class
VersionController.FixedVersion
A class representing the version of a PDF document.
-
Constructor Summary
Constructors Modifier Constructor Description private
VersionController(Version version)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract void
addTableHeaderScopeAttribute(PDFStructElem th, StandardStructureAttributes.Table.Scope scope)
static VersionController
getDynamicVersionController(Version initialVersion, PDFDocument doc)
Returns a controller that allows subsequent changes to the document's version.static VersionController
getFixedVersionController(Version version)
Returns a controller that disallows subsequent change to the document's version.Version
getPDFVersion()
Returns the PDF version of the document.abstract void
setPDFVersion(Version version)
Sets the PDF version of the document.java.lang.String
toString()
-
-
-
Field Detail
-
version
private Version version
-
-
Constructor Detail
-
VersionController
private VersionController(Version version)
-
-
Method Detail
-
getPDFVersion
public Version getPDFVersion()
Returns the PDF version of the document.- Returns:
- the PDF version
-
setPDFVersion
public abstract void setPDFVersion(Version version)
Sets the PDF version of the document.- Parameters:
version
- the PDF version- Throws:
java.lang.IllegalStateException
- if the PDF version is not allowed to change.
-
addTableHeaderScopeAttribute
abstract void addTableHeaderScopeAttribute(PDFStructElem th, StandardStructureAttributes.Table.Scope scope)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFixedVersionController
public static VersionController getFixedVersionController(Version version)
Returns a controller that disallows subsequent change to the document's version. The minimum allowed version is v1.4.- Parameters:
version
- the PDF version (must be >= v1.4)- Returns:
- the fixed PDF version controller
-
getDynamicVersionController
public static VersionController getDynamicVersionController(Version initialVersion, PDFDocument doc)
Returns a controller that allows subsequent changes to the document's version.- Parameters:
initialVersion
- the initial PDF versiondoc
- the document whose version is being set- Returns:
- the dynamic PDF version controller
-
-