Package org.loboevolution.pdfview.action
Class PdfObjectParseUtil
java.lang.Object
org.loboevolution.pdfview.action.PdfObjectParseUtil
**************************************************************************
Utility class for parsing values from a PDFObject
Author Katja Sondermann
- Since:
- 08.07.2009 **************************************************************************
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
parseBooleanFromDict
(String key, PDFObject parent, boolean mandatory) ********************************************************************** Parse a Boolean value with the given key from parent object.static PDFDestination
parseDestination
(String key, PDFObject parent, PDFObject root, boolean mandatory) ********************************************************************** Parse a destination objectstatic int
parseIntegerFromDict
(String key, PDFObject parent, boolean mandatory) ********************************************************************** Parse a integer value with the given key from parent object.static String
parseStringFromDict
(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
- aString
object.parent
- aPDFObject
object.mandatory
- a boolean.- Returns:
- String - can be
null
if not mandatory - Throws:
IOException
- if any.
-
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
- aString
object.parent
- aPDFObject
object.mandatory
- a boolean.- Returns:
- boolean -
false
if not available and not mandatory - Throws:
IOException
- if any.
-
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
- aString
object.parent
- aPDFObject
object.mandatory
- a boolean.- Returns:
- int - returns "0" in case the value is not a number
- Throws:
IOException
- if any.
-
parseDestination
public static PDFDestination parseDestination(String key, PDFObject parent, PDFObject root, boolean mandatory) throws IOException ********************************************************************** Parse a destination object- Parameters:
key
- aString
object.parent
- aPDFObject
object.root
- aPDFObject
object.mandatory
- a boolean.- Returns:
- PDFDestination - can be
null
if not mandatory - Throws:
IOException
- if any.
-