public final class COSUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOGGER |
Modifier | Constructor and Description |
---|---|
private |
COSUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
closeDocumentQuietly(COSDocument document)
Close the given Document.
|
static void |
closeDocumentQuietly(PDDocument document)
Close the given Document.
|
static COSArray |
getAsArray(COSBase cbase,
COSDocument cDoc)
Return the COSBase object as COSArray if the COSBase object is an instance of COSArray or a reference to a
COSArray object.
|
static COSDictionary |
getAsDictionary(COSBase cbase,
COSDocument cDoc)
Return the COSBase object as COSDictionary if the COSBase object is an instance of COSDictionary or a reference
to a COSDictionary object.
|
static java.lang.Float |
getAsFloat(COSBase cbase,
COSDocument cDoc)
Return the COSBase object as Float if the COSBase object is an instance of COSFloat or a reference to a COSFloat
object.
|
static java.lang.Integer |
getAsInteger(COSBase cbase,
COSDocument cDoc)
Return the COSBase object as Integer if the COSBase object is an instance of COSInteger or a reference to a
COSInteger object.
|
static COSStream |
getAsStream(COSBase cbase,
COSDocument cDoc)
Return the COSBase object as COSStream if the COSBase object is an instance of COSStream or a reference to a
COSStream object.
|
static java.lang.String |
getAsString(COSBase cbase,
COSDocument cDoc)
Return the COSBase object as String if the COSBase object is an instance of COSString or
COSName or a reference to it.
|
private static COSBase |
getCOSObjectAsClass(COSObject cosObject,
COSDocument cDoc,
java.lang.Class claz)
Return the COSObject object as class if the COSObject object is a reference to an object of
that class.
|
static boolean |
isArray(COSBase elt,
COSDocument doc)
return true if the elt is a COSArray or a reference to a COSArray
|
private static boolean |
isClass(COSBase elt,
COSDocument doc,
java.lang.Class claz)
return true if the elt is of class or a reference to a that class.
|
static boolean |
isDictionary(COSBase elt,
COSDocument doc)
return true if the elt is a COSDictionary or a reference to a COSDictionary
|
static boolean |
isFloat(COSBase elt,
COSDocument doc)
return true if the elt is a COSFloat or a reference to a COSFloat
|
static boolean |
isInteger(COSBase elt,
COSDocument doc)
return true if the elt is a COSInteger or a reference to a COSInteger
|
static boolean |
isNumeric(COSBase elt,
COSDocument doc)
return true if elt is COSInteger or COSFloat
|
static boolean |
isStream(COSBase elt,
COSDocument doc)
return true if the elt is a COSStream or a reference to a COSStream
|
static boolean |
isString(COSBase elt,
COSDocument doc)
return true if the elt is a COSString or a COSName or a reference to it.
|
public static boolean isDictionary(COSBase elt, COSDocument doc)
elt
- the object to check.doc
- the document.public static boolean isString(COSBase elt, COSDocument doc)
elt
- the object to check.doc
- the document.public static boolean isStream(COSBase elt, COSDocument doc)
elt
- the object to check.doc
- the document.public static boolean isInteger(COSBase elt, COSDocument doc)
elt
- the object to check.doc
- the document.private static boolean isClass(COSBase elt, COSDocument doc, java.lang.Class claz)
elt
- the object to check.doc
- the document.claz
- the class.public static boolean isNumeric(COSBase elt, COSDocument doc)
elt
- the object to check.doc
- the document.public static boolean isFloat(COSBase elt, COSDocument doc)
elt
- the object to check.doc
- the document.public static boolean isArray(COSBase elt, COSDocument doc)
elt
- the object to check.doc
- the document.public static COSArray getAsArray(COSBase cbase, COSDocument cDoc)
cbase
- the object to get.cDoc
- the document.public static java.lang.String getAsString(COSBase cbase, COSDocument cDoc)
cbase
- the object to get.cDoc
- the document.public static COSDictionary getAsDictionary(COSBase cbase, COSDocument cDoc)
cbase
- the object to get.cDoc
- the document.public static COSStream getAsStream(COSBase cbase, COSDocument cDoc)
cbase
- the object to get.cDoc
- the document.public static java.lang.Float getAsFloat(COSBase cbase, COSDocument cDoc)
cbase
- the object to get.cDoc
- the document.public static java.lang.Integer getAsInteger(COSBase cbase, COSDocument cDoc)
cbase
- the object to get.cDoc
- the document.public static void closeDocumentQuietly(COSDocument document)
document
- the document.public static void closeDocumentQuietly(PDDocument document)
document
- the document.private static COSBase getCOSObjectAsClass(COSObject cosObject, COSDocument cDoc, java.lang.Class claz)
cosObject
- the object to get.cDoc
- the document.claz
- the class.