Difference between revisions of "Granule Code"
From DocDataFlow
(Created page with "The Granule class is the root class from which all granule types are derived. It has a ''class identifier'' of <code>com.rorohiko.granule</code>.") |
|||
Line 1: | Line 1: | ||
The Granule class is the root class from which all granule types are derived. | The Granule class is the root class from which all granule types are derived. | ||
− | It has a [[Class identifier|''class identifier'']] of <code>com.rorohiko.granule</code>. | + | It has a [[Class identifier|''class identifier'']] of <code>com.rorohiko.granule</code> |
+ | |||
+ | Granules are 'constant': once created they don't change. Any 'live' data related to the granule is carried in the associated [[Context|''context'']] data structure. | ||
+ | |||
+ | It has the following methods: | ||
+ | |||
+ | * <code>granule.getId()</code>: get the unique identifier for this granule. | ||
+ | |||
+ | * <code>granule.getContext()</code>: retrieve the context for this granule. | ||
+ | |||
+ | * <code>granule.getData()</code>: retrieve the core data for this granule. In most cases this is a reference to the document-specific data structure for the granule. E.g. if the granule is an InDesignTextFrameGranule, the granule.getData() will retrieve the associated InDesign TextFrame object (or a proxy thereof). |
Revision as of 01:56, 30 December 2013
The Granule class is the root class from which all granule types are derived.
It has a class identifier of com.rorohiko.granule
Granules are 'constant': once created they don't change. Any 'live' data related to the granule is carried in the associated context data structure.
It has the following methods:
-
granule.getId()
: get the unique identifier for this granule.
-
granule.getContext()
: retrieve the context for this granule.
-
granule.getData()
: retrieve the core data for this granule. In most cases this is a reference to the document-specific data structure for the granule. E.g. if the granule is an InDesignTextFrameGranule, the granule.getData() will retrieve the associated InDesign TextFrame object (or a proxy thereof).