Class PdfObjectParseUtil
java.lang.Object
org.openpdf.renderer.action.PdfObjectParseUtil
Utility class for parsing values from a PDFObject
- Since:
- 08.07.2009
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanparseBooleanFromDict(String key, PDFObject parent, boolean mandatory) Parse a Boolean value with the given key from parent object.static PDFDestinationparseDestination(String key, PDFObject parent, PDFObject root, boolean mandatory) Parse a destination objectstatic intparseIntegerFromDict(String key, PDFObject parent, boolean mandatory) Parse a integer value with the given key from parent object.static StringparseStringFromDict(String key, PDFObject parent, boolean mandatory) Parse a String value with the given key from parent object.
-
Constructor Details
-
PdfObjectParseUtil
public PdfObjectParseUtil()
-
-
Method Details
-
parseStringFromDict
public static String parseStringFromDict(String key, PDFObject parent, boolean mandatory) throws IOException Parse a String value with the given key from parent object. If it's mandatory and not available, an exception will be thrown.- Parameters:
key-parent-mandatory-- Returns:
- String - can be
nullif not mandatory - Throws:
IOException- - in case of a parsing error
-
parseBooleanFromDict
public static boolean parseBooleanFromDict(String key, PDFObject parent, boolean mandatory) throws IOException Parse a Boolean value with the given key from parent object. If it's mandatory and not available, an exception will be thrown.- Parameters:
key-parent-mandatory-- Returns:
- boolean -
falseif not available and not mandatory - Throws:
IOException
-
parseIntegerFromDict
public static int parseIntegerFromDict(String key, PDFObject parent, boolean mandatory) throws IOException Parse a integer value with the given key from parent object. If it's mandatory and not available, an exception will be thrown.- Parameters:
key-parent-mandatory-- Returns:
- int - returns "0" in case the value is not a number
- Throws:
IOException
-
parseDestination
public static PDFDestination parseDestination(String key, PDFObject parent, PDFObject root, boolean mandatory) throws IOException Parse a destination object- Parameters:
key-parent-root-mandatory-- Returns:
- PDFDestination - can be
nullif not mandatory - Throws:
IOException
-