| java.lang.Object de.intarsys.pdf.cos.COSBasedObject
All known Subclasses: de.intarsys.pdf.cds.CDSBase, de.intarsys.pdf.cos.COSTrailer, de.intarsys.pdf.pd.PDObject, de.intarsys.pdf.font.CMap, de.intarsys.pdf.font.CIDSystemInfo, de.intarsys.pdf.fd.FDObject, de.intarsys.pdf.st.COSObjectStream, de.intarsys.pdf.cos.COSInfoDict, de.intarsys.pdf.crypt.COSEncryption, de.intarsys.pdf.font.CIDToGIDMap, de.intarsys.pdf.cos.COSCatalog,
COSBasedObject | abstract public class COSBasedObject implements IAttributeSupport,ICOSObjectListener(Code) | | The abstract superclass for all objects/data structures that are build on the
basic COSObject types.
The base
COSObject will represent the state while this wrapper will
provide the behavior.
The
COSBasedObject and its base
COSObject are always closely
related, all changes are immediately reflected in both objects.
The
COSBasedObject uses a META framework that ensures identity (you
will always get the identical
COSBasedObject for a
COSObject created via META) and defines the lifecycle of the
COSBasedObject .
A
COSBasedObject should always be created using
META.createNew or META.createFromCos .
A
COSBasedObject based on a
COSDictionary can use some
convenience methods for generic access to its fields. As a convention, filed
names are always declared with the associated
COSBasedObject as
public static final COSName DK_ .
The
COSBasedObject implements
IAttributeSupport . Client code
can use this feature to transparently associate objects with objects from
client code, for example for caching or client defined relationships.
|
Method Summary | |
public void | changed(COSObject pObject, Object slot, Object oldValue, Object newValue) | public COSArray | cosGetArray() Get the base object as a
COSArray . | public COSDictionary | cosGetDict() Get the base object as a
COSDictionary . | public COSDocument | cosGetDoc() The
COSDocument for this. | public COSObject | cosGetField(COSName name) The
COSObject associated with name in the receiver
or
COSNull . | public COSObject | cosGetObject() The base
COSObject for this. | public COSStream | cosGetStream() Get the base object as a
COSStream . | public boolean | cosHasField(COSName name) Answer true if this has a field named name . | public COSObject | cosRemoveField(COSName name) Remove a field in this. | public COSObject | cosSetField(COSName name, COSObject cosObj) Set a field value in this. | public Object | getAttribute(Object key) | public boolean | getFieldBoolean(COSName name, boolean defaultValue) The value of a field within this as a boolean or the
defaultValue if not found or not a
COSBoolean .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. | public CDSDate | getFieldDate(COSName name, CDSDate defaultValue) The value of a field within this as a
CDSDate or the
defaultValue if not found or not a
COSString .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. | public float | getFieldFixed(COSName name, float defaultValue) The value of a field within this as a float or the
defaultValue if not found or not a
COSNumber .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. | public float[] | getFieldFixedArray(COSName name, float[] defaultValue) The value of a field within this as a float[] or the
defaultValue if not found or not a
COSArray .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. | public int | getFieldInt(COSName name, int defaultValue) The value of a field within this as a int or the
defaultValue if not found or not a
COSNumber .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. | public String | getFieldMLString(COSName name, String defaultValue) The value of a field within this as a String or the
defaultValue if not found or not a
COSString . | public String | getFieldString(COSName name, String defaultValue) The value of a field within this as a String or the
defaultValue if not found or not a
COSString .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. | protected void | initializeFromCos() | protected void | initializeFromScratch() | public void | invalidateCaches() Invalidate all local caches as the base object may have changed. | public Object | removeAttribute(Object key) | public Object | setAttribute(Object key, Object value) | public void | setFieldBoolean(COSName name, boolean value) Set the value of field name within this. | public void | setFieldFixed(COSName name, float value) Set the value of field name within this. | protected void | setFieldFixedArray(COSName key, float[] array) Set the value of field name within this. | public void | setFieldInt(COSName name, int value) Set the value of field name within this. | public void | setFieldMLString(COSName name, String value) Set the value of field name within this. | public void | setFieldName(COSName name, String value) Set the value of field name within this. | public void | setFieldObject(COSName name, COSBasedObject value) Set the value of field name within this. | public void | setFieldString(COSName name, String value) Set the value of field name within this. | public String | toString() |
cosHasField | public boolean cosHasField(COSName name)(Code) | | Answer true if this has a field named name .
This method requires the base object to be a
COSDictionary .
Parameters: name - the field to check Answer true if this has a field namedname . |
cosRemoveField | public COSObject cosRemoveField(COSName name)(Code) | | Remove a field in this. The previously associated object is returned.
This method requires the base object to be a
COSDictionary .
Parameters: name - the field to remove from the receiver The previously associated object is returned. |
cosSetField | public COSObject cosSetField(COSName name, COSObject cosObj)(Code) | | Set a field value in this. The previously associated object is returned.
This method requires the base object to be a
COSDictionary .
Parameters: name - The field to set Parameters: cosObj - The object to set in the field The previously associated object is returned. |
getFieldBoolean | public boolean getFieldBoolean(COSName name, boolean defaultValue)(Code) | | The value of a field within this as a boolean or the
defaultValue if not found or not a
COSBoolean .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. The value of a field within this as a boolean |
getFieldDate | public CDSDate getFieldDate(COSName name, CDSDate defaultValue)(Code) | | The value of a field within this as a
CDSDate or the
defaultValue if not found or not a
COSString .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. The value of a field within this as a CDSDate |
getFieldFixed | public float getFieldFixed(COSName name, float defaultValue)(Code) | | The value of a field within this as a float or the
defaultValue if not found or not a
COSNumber .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. The value of a field within this as a float |
getFieldFixedArray | public float[] getFieldFixedArray(COSName name, float[] defaultValue)(Code) | | The value of a field within this as a float[] or the
defaultValue if not found or not a
COSArray .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. The value of a field within this as a float[] |
getFieldInt | public int getFieldInt(COSName name, int defaultValue)(Code) | | The value of a field within this as a int or the
defaultValue if not found or not a
COSNumber .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. The value of a field within this as a int |
getFieldMLString | public String getFieldMLString(COSName name, String defaultValue)(Code) | | The value of a field within this as a String or the
defaultValue if not found or not a
COSString . The
String is "expanded" to containn the correct new line characters.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. The value of a field within this as a String |
getFieldString | public String getFieldString(COSName name, String defaultValue)(Code) | | The value of a field within this as a String or the
defaultValue if not found or not a
COSString .
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: defaultValue - The default value to return if field is not found or not ofappropriate type. The value of a field within this as a String |
initializeFromCos | protected void initializeFromCos()(Code) | | |
initializeFromScratch | protected void initializeFromScratch()(Code) | | |
invalidateCaches | public void invalidateCaches()(Code) | | Invalidate all local caches as the base object may have changed.
|
setFieldBoolean | public void setFieldBoolean(COSName name, boolean value)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
setFieldFixed | public void setFieldFixed(COSName name, float value)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
setFieldFixedArray | protected void setFieldFixedArray(COSName key, float[] array)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
setFieldInt | public void setFieldInt(COSName name, int value)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
setFieldMLString | public void setFieldMLString(COSName name, String value)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
setFieldName | public void setFieldName(COSName name, String value)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
setFieldObject | public void setFieldObject(COSName name, COSBasedObject value)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
setFieldString | public void setFieldString(COSName name, String value)(Code) | | Set the value of field name within this.
This method requires the base object to be a
COSDictionary .
Parameters: name - The name of the field. Parameters: value - The new value of the field. |
|
|