aboutsummaryrefslogtreecommitdiffstats
path: root/src/documentation/content/design/alt.design/properties/simple-properties.html
blob: 1cb4aa0f1c7688ad9972542c14a786cc5ef9d31c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Simple &lt;property&gt; Classes</title>
    <link type="text/css" href="../../../page.css" rel="stylesheet">
  </head>
  <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" text="#000000" bgcolor="#FFFFFF">
    <div class="content">
      <h1>Simple &lt;property&gt; Classes</h1>
      <p>
        <font size="-2">by&nbsp;Peter B. West</font>
      </p>
      <ul class="minitoc">
        <li>
          <a href="#N10014">Introduction</a>
        </li>
        <li>
          <a href="#N10026">Common data</a>
        </li>
        <li>
          <a href="#N10075">Accessing &lt;property&gt; Data Constants</a>
        </li>
      </ul>
      
      <a name="N10014"></a>
      <h3>Introduction</h3>
      <p>
        An <a href="classes-overview.html">overview of the properties
        and classes</a> involved in handling properties has already
        been given.  This discussion will go in detail into the way
        data are represented within properties.  Iit is important to
        keep in mind that the primary avenue of access to the data and
        the methods of property classes is the <a href=
        "javascript:window.top.displayCode(
        'PropertyConsts.html#PropertyConstsClass' )" ><span
        class="codefrag">PropertyConsts</span></a> class and its
        singleton object.
      </p>
      
      <a name="N10026"></a>
      <h3>Common data</h3>
      <p>
        
        <a href= "javascript:window.top.displayCode( 'Character.html' )" ><span
        class="codefrag">org.apache.fop.fo.properties.Character</span></a>
        is an example of a basic property class.  The data fields
        common to all properties are:
      </p>
      <dl>
        
        <dt>
          
          <span class="codefrag">final int dataTypes</span>
          
        </dt>
        
        <dd>
          This field defines the allowable data types which may be
          assigned to the property.  The value is chosen from the data
          type constants defined in <a href=
          "javascript:window.top.displayCode( 'Property.html#NOTYPE' )"
          ><span
          class="codefrag">org.apache.fop.fo.properties.Property</span></a>,
          and may consist of more than one of those constants,
          bit-ORed together.
        </dd>
        
        <dt>
          
          <span class="codefrag">final int traitMapping</span>
          
        </dt>
        
        <dd>
          This field defines the mapping of properties to traits in
          the <span class="codefrag">Area tree</span>. The value is
          chosen from the trait mapping constants defined in <a href=
          "javascript:window.top.displayCode( 'Property.html#NO_TRAIT' )"
          ><span
          class="codefrag">org.apache.fop.fo.properties.Property</span></a>,
          and may consist of more than one of those constants,
          bit-ORed together.
        </dd>
        
        <dt>
          
          <span class="codefrag">final int initialValueType</span>
          
        </dt>
        
        <dd>
          This field defines the data type of the initial value
          assigned to the property.  The value is chosen from the
          initial value type constants defined in <a href=
          "javascript:window.top.displayCode( 'Property.html#NOTYPE_IT' )"
          ><span
          class="codefrag">org.apache.fop.fo.properties.Property</span></a>.
          In the simplest property classes, such as <span
          class="codefrag">Character</span>, there is no defined
          initial value type.
        </dd>
        
        <dt>
          
          <span class="codefrag">final int inherited</span>
          
        </dt>
        
        <dd>
          This field defines the kind of inheritance applicable to the
          property.  The value is chosen from the inheritance
          constants defined in <a href=
          "javascript:window.top.displayCode( 'Property.html#NO' )" ><span
          class="codefrag">org.apache.fop.fo.properties.Property</span></a>.
        </dd>
        
      </dl>
      
      <a name="N10075"></a>
      <h3>Accessing &lt;property&gt; Data Constants</h3>
      <p>
        The constants above are generally accessed through the arrays
        maintained in the <a href= "javascript:window.top.displayCode(
        'PropertyConsts.html#PropertyConstsClass' )" ><span
        class="codefrag">PropertyConsts</span></a> singleton <a href=
        "javascript:window.top.displayCode( 'PropertyConsts.html#pconsts'
        )" ><span class="codefrag">pconsts</span></a>.  The first
        invocation of the method <a href=
        "javascript:window.top.displayCode(
        'PropertyConsts.html#setupProperty' )" ><span
        class="codefrag">setupProperty</span></a> on the property
        generates a <span class="codefrag">Class</span> instance for
        the class, and stores it in the array <a href=
        "javascript:window.top.displayCode( 'PropertyConsts.html#classes'
        )" ><span class="codefrag">classes</span></a>.  This <span
        class="codefrag">Class</span> object is used, in turn, to
        instantiate the singleton instance of the class, which is
        stored in the <a href= "javascript:window.top.displayCode(
        'PropertyConsts.html#properties' )" ><span
        class="codefrag">Property[] properties</span></a> array of <a
        href= "javascript:window.top.displayCode(
        '../PropertyConsts.html#pconsts' )" ><span
        class="codefrag">pconsts</span></a>.
      </p>
      <p>
        
        <em>Reflection</em> methods are then used, via the same <span
        class="codefrag">Class</span> instance, to extract and store
        the static data fields.  These arrays and associated access
        methods are:
      </p>
      <dl>
        
        <dt>
          
          <a href= "javascript:window.top.displayCode(
          'PropertyConsts.html#datatypes' )" ><span
          class="codefrag">int[] datatypes</span></a>
          
        </dt>
        
        <dd>
          
          <a href= "javascript:window.top.displayCode(
          'PropertyConsts.html#getDataTypes' )" ><span
          class="codefrag">int getDataTypes(int)</span></a>
          
        </dd>
        
        <dt>
          
          <a href= "javascript:window.top.displayCode(
          'PropertyConsts.html#traitMappings' )" ><span
          class="codefrag">int[] traitMappings</span></a>
          
        </dt>
        
        <dd>
          
          <em>No access method yet defined.</em>
          
        </dd>
        
        <dt>
          
          <a href= "javascript:window.top.displayCode(
          'PropertyConsts.html#initialValueTypes' )" ><span
          class="codefrag">int[] initialValueTypes</span></a>
          
        </dt>
        
        <dd>
          
          <a href= "javascript:window.top.displayCode(
          'PropertyConsts.html#getInitialValueType' )" ><span
          class="codefrag">int getInitialValueType(int)</span></a>
          
        </dd>
        
        <dt>
          
          <a href= "javascript:window.top.displayCode(
          'PropertyConsts.html#inherited' )" ><span
          class="codefrag">int[] inherited</span></a>
          
        </dt>
        
        <dd>
          
          <a href= "javascript:window.top.displayCode(
          'PropertyConsts.html#inheritance' )" ><span
          class="codefrag">int inheritance(int)</span></a>
          
        </dd>
        
      </dl>

      <p>
        <strong>Previous:</strong> <a href = "PropertyConsts-class.html"
        >PropertyConsts class</a>
      </p>
      <p>
        <strong>Next:</strong> <a href= "getInitialValue.html"
                                  >getInitialValue()</a>
      </p>
      
    </div>
    <table summary="footer" cellspacing="0" cellpadding="0" width="100%" height="20" border="0">
        <tr>
          <td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1"
          width="1" alt="" src="../../../skin/images/spacer.gif"><a
          href="../../../skin/images/label.gif"></a><a
          href="../../../skin/images/page.gif"></a><a
          href="../../../skin/images/chapter.gif"></a><a
          href="../../../skin/images/chapter_open.gif"></a><a
          href="../../../skin/images/current.gif"></a><a
          href="../../..//favicon.ico"></a></td>
        </tr>
        <tr>
          <td colspan="2" bgcolor="#CFDCED" class="copyright"
          align="center"><font size="2" face="Arial, Helvetica,
          Sans-Serif">Copyright &copy; 1999-2002&nbsp;The Apache
          Software Foundation. All rights reserved.<script
          type="text/javascript" language="JavaScript"><!--
          document.write(" - "+"Last Published: " +
          document.lastModified); // --></script></font></td>
        </tr>
        <tr>
          <td align="left" bgcolor="#CFDCED" class="logos"></td><td
          align="right" bgcolor="#CFDCED" class="logos"></td>
        </tr>
    </table>
  </body>
</html>