aboutsummaryrefslogtreecommitdiffstats
path: root/src/documentation/content/xdocs/design/alt.design/properties-classes.xml
blob: ac8f52f25d44b4f688e1dcd2f65b5cd747c24dab (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
<?xml version="1.0" standalone="no"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN"
    "http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-forrest/src/resources/schema/dtd/document-v11.dtd">

<document>
  <header>
    <title>Properties classes</title>
    <authors>
      <person name="Peter B. West" email="pbwest@powerup.com.au"/>
    </authors>
  </header>
  <body>
    <section>
      <title>The <em>org.apache.fop.fo.properties</em> classes</title>
      <section>
        <title>Introduction</title>
        <p>
          In respect of their fields and data structures, the
          &lt;property&gt; classes have a <em>virtual</em>
          instantiation in the arrays of the <em>singleton</em> <fork
          href= "PropertyConsts.html"
          ><code>PropertyConsts</code></fork> object, created during
          the <fork href= "PropertyConsts.html#pconsts" >static
          initialization</fork> of the class.  The methods of these
          classes are accessed through an array of <em>singelton</em>
          instances of the individual &lt;property&gt; classes, which
          is maintained in <fork href=
          "PropertyConsts.html#properties" >PropertyConsts</fork>.


          these classes are intended to
          remain as repositories of static data and methods.  The name
          of each property is entered in the
          <code>PropNames.propertyNames</code> array of
          <code>String</code>s, and each has a unique integer constant
          defined, corresponding to the offset of the property name in
          that array.
        </p>
        <section>
          <title>Fields common to all classes</title>
          <dl> 
            <dt><code>final int dataTypes</code></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 <code>Properties</code>, and
              may consist of more than one of those constants,
              bit-ORed together.
            </dd>
            <dt><code>final int traitMapping</code></dt>
            <dd>
              This field defines the mapping of properties to traits
              in the <code>Area tree</code>. The value is chosen from the
              trait mapping constants defined in <code>Properties</code>,
              and may consist of more than one of those constants,
              bit-ORed together.
            </dd>
            <dt><code>final int initialValueType</code></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
              <code>Properties</code>.
            </dd>
            <dt><code>final int inherited</code></dt>
            <dd>
              This field defines the kind of inheritance applicable to
              the property.  The value is chosen from the inheritance
              constants defined in <code>Properties</code>. 
            </dd>
          </dl>
        </section>
        <section>
          <title>Datatype dependent fields</title>
          <dl>
            <dt>Enumeration types</dt>
            <dd>
              <strong><code>final String[] enums</code></strong><br/>
              This array contains the <code>NCName</code>  text
              values of the enumeration.  In the current
              implementation, it always contains a null value at
              <code>enum[0]</code>.<br/> <br/>

              <strong><code>final String[]
                  enumValues</code></strong><br/> When the number of
              enumeration values is small,
              <code>enumValues</code>  is a reference to the
              <code>enums</code>  array.<br/> <br/>

              <strong><code>final HashMap
                  enumValues</code></strong><br/> When the number of
              enumeration values is larger,
              <code>enumValues</code>  is a
              <code>HashMap</code>  statically initialized to
              contain the integer constant values corresponding to
              each text value, indexed by the text
              value.<br/> <br/>

              <strong><code>final int</code></strong>
              <em><code>enumeration-constants</code></em><br/> A
              unique integer constant is defined for each of the
              possible enumeration values.<br/> <br/>
            </dd>
            <dt>Many types:
              <code>final</code>  <em>datatype</em>
              <code>initialValue</code></dt>
            <dd>
              When the initial datatype does not have an implicit
              initial value (as, for example, does type
              <code>AUTO</code>) the initial value for the property is
              assigned to this field.  The type of this field will
              vary according to the <code>initialValueType</code>
              field.
            </dd>
            <dt>AUTO: <code>PropertyValueList auto(property,
                list)></code></dt>
            <dd>
              When <em>AUTO</em>  is a legal value type, the
              <code>auto()</code>  method must be defined in the property
              class.<br/>
              <em>NOT YET IMPLEMENTED.</em>
            </dd>
            <dt>COMPLEX: <code>PropertyValueList complex(property,
                list)></code></dt>
            <dd>
              <em>COMPLEX</em>  is specified as a value type when complex
              conditions apply to the selection of a value type, or
              when lists of values are acceptable.  To process and
              validate such a property value assignment, the
              <code>complex()</code>  method must be defined in the
              property class.
            </dd>
          </dl>
        </section>
      </section>
      <section>
        <title>Nested property pseudo-classes</title>
        <p>
          The property pseudo-classes are classes, like
          <code>ColorCommon</code>  which contain values, particularly
          <em>enums</em>, which are common to a number of actual
          properties.
        </p>
      </section>
      <p>
        <strong>Previous:</strong> <link href= "classes-overview.html"
                                         >property classes overview.</link>
      </p>
    </section>
  </body>
</document>