/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfDictionary</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfDictionary</CODE>, it is cast down and returned as * such. Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfDictionary</CODE> object, * or <CODE>null</CODE> */ public PdfDictionary getAsDict(PdfName key) { PdfDictionary dict = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isDictionary()) dict = (PdfDictionary) orig; return dict; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfStream</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfStream</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfStream</CODE> object, * or <CODE>null</CODE> */ public PdfStream getAsStream(PdfName key) { PdfStream stream = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isStream()) stream = (PdfStream) orig; return stream; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfName</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfName</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfName</CODE> object, * or <CODE>null</CODE> */ public PdfName getAsName(PdfName key) { PdfName name = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isName()) name = (PdfName) orig; return name; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfArray</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfArray</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfArray</CODE> object, * or <CODE>null</CODE> */ public PdfArray getAsArray(PdfName key) { PdfArray array = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isArray()) array = (PdfArray) orig; return array; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfBoolean</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfBoolean</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfBoolean</CODE> object, * or <CODE>null</CODE> */ public PdfBoolean getAsBoolean(PdfName key) { PdfBoolean bool = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isBoolean()) bool = (PdfBoolean)orig; return bool; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfNumber</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfNumber</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfNumber</CODE> object, * or <CODE>null</CODE> */ public PdfNumber getAsNumber(PdfName key) { PdfNumber number = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isNumber()) number = (PdfNumber) orig; return number; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfNumber</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfNumber</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfNumber</CODE> object, * or <CODE>null</CODE> */ public PdfNumber getAsNumber(PdfName key) { PdfNumber number = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isNumber()) number = (PdfNumber) orig; return number; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfName</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfName</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfName</CODE> object, * or <CODE>null</CODE> */ public PdfName getAsName(PdfName key) { PdfName name = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isName()) name = (PdfName) orig; return name; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfDictionary</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfDictionary</CODE>, it is cast down and returned as * such. Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfDictionary</CODE> object, * or <CODE>null</CODE> */ public PdfDictionary getAsDict(PdfName key) { PdfDictionary dict = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isDictionary()) dict = (PdfDictionary) orig; return dict; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfString</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfString</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfString</CODE> object, * or <CODE>null</CODE> */ public PdfString getAsString(PdfName key) { PdfString string = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isString()) string = (PdfString) orig; return string; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfName</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfName</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfName</CODE> object, * or <CODE>null</CODE> */ public PdfName getAsName(PdfName key) { PdfName name = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isName()) name = (PdfName) orig; return name; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfStream</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfStream</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfStream</CODE> object, * or <CODE>null</CODE> */ public PdfStream getAsStream(PdfName key) { PdfStream stream = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isStream()) stream = (PdfStream) orig; return stream; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfString</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfString</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfString</CODE> object, * or <CODE>null</CODE> */ public PdfString getAsString(PdfName key) { PdfString string = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isString()) string = (PdfString) orig; return string; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfBoolean</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfBoolean</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfBoolean</CODE> object, * or <CODE>null</CODE> */ public PdfBoolean getAsBoolean(PdfName key) { PdfBoolean bool = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isBoolean()) bool = (PdfBoolean)orig; return bool; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfArray</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfArray</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfArray</CODE> object, * or <CODE>null</CODE> */ public PdfArray getAsArray(PdfName key) { PdfArray array = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isArray()) array = (PdfArray) orig; return array; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfStream</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfStream</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfStream</CODE> object, * or <CODE>null</CODE> */ public PdfStream getAsStream(PdfName key) { PdfStream stream = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isStream()) stream = (PdfStream) orig; return stream; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfBoolean</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfBoolean</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfBoolean</CODE> object, * or <CODE>null</CODE> */ public PdfBoolean getAsBoolean(PdfName key) { PdfBoolean bool = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isBoolean()) bool = (PdfBoolean)orig; return bool; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfString</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfString</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfString</CODE> object, * or <CODE>null</CODE> */ public PdfString getAsString(PdfName key) { PdfString string = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isString()) string = (PdfString) orig; return string; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfDictionary</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfDictionary</CODE>, it is cast down and returned as * such. Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfDictionary</CODE> object, * or <CODE>null</CODE> */ public PdfDictionary getAsDict(PdfName key) { PdfDictionary dict = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isDictionary()) dict = (PdfDictionary) orig; return dict; }
/** * Returns a <CODE>PdfObject</CODE> as a <CODE>PdfNumber</CODE>, * resolving indirect references. * * The object associated with the <CODE>PdfName</CODE> given is retrieved * and resolved to a direct object. * If it is a <CODE>PdfNumber</CODE>, it is cast down and returned as such. * Otherwise <CODE>null</CODE> is returned. * * @param key A <CODE>PdfName</CODE> * @return the associated <CODE>PdfNumber</CODE> object, * or <CODE>null</CODE> */ public PdfNumber getAsNumber(PdfName key) { PdfNumber number = null; PdfObject orig = getDirectObject(key); if (orig != null && orig.isNumber()) number = (PdfNumber) orig; return number; }