pbwest      2003/03/05 21:23:01

  Added:       src/documentation/content/xdocs/design/alt.design/properties
                        book.xml classes-overview.ehtml
                        enumerated-values.ehtml getInitialValue.ehtml
                        index.xml PropertyConsts-class.ehtml
                        propertyExpressions.ehtml simple-properties.ehtml
  Log:
  Using .ehtml files
  
  Revision  Changes    Path
  1.4       +0 -0      
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/book.xml
  
  
  
  
  1.1                  
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/classes-overview.ehtml
  
  Index: classes-overview.ehtml
  ===================================================================
  <!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>Property classes overview</title>
      <script type="text/javascript" src="resources/codedisplay.js">
      </script>
    </head>
    <body marginheight= "0" marginwidth= "0" topmargin= "0" leftmargin= "0" text= 
"#000000" bgcolor= "#FFFFFF" >
      <div class= "content" >
        <h1>Property classes overview</h1>
        <p>
          <font size= "-2" >by&nbsp;Peter B. West</font>
        </p>
        <ul class= "minitoc" >
          <li>
            <a href = "#N10014" >Properties: packages</a>
            <ul class= "minitoc" >
              <li>
                <a href = "#N10019" >org.apache.fop.fo</a>
              </li>
              <li>
                <a href = "#N100AC" >org.apache.fop.fo.properties</a>
              </li>
              <li>
                <a href = "#N100EE" >org.apache.fop.fo.expr</a>
              </li>
              <li>
                <a href = "#N10134" >org.apache.fop.datatypes</a>
              </li>
              <li>
                <a href = "#N101A2"
                >org.apache.fop.datatypes.indirect</a>
              </li>
            </ul>
          </li>
        </ul>
        <a name= "N10014" ></a> <h3>Properties: packages</h3> <a name=
        "N10019" ></a> <h4>org.apache.fop.fo</h4>
        <dl>
          <dt>
            <span id="span00" ></span>
            <a href = "javascript:toggleCode('span00',
               'PropNames.html#PropNamesClass', '50%', '100%'
            )" ><em>PropNames</em></a>
          </dt>
          <dd>
            This class maintains an array of <span id="span01"
            ></span><a href= "javascript:toggleCode( 'span01',
            'PropNames.html#propertyNames', '50%', '100%' )" >property
            names</a>, synchronized to a complete set of property name
            <span id="span02" ></span><a href = "javascript:toggleCode(
            'span02', 'PropNames.html#NO_PROPERTY', '50%', '100%' )"
            >constants</a> for indexing property-based arrays.  It
            includes methods to <span id="span03" ></span><a href =
            "javascript:toggleCode( 'span03',
            'PropNames.html#getPropertyName', '50%', '100%' )" >convert
            an index to a name</a> and to <span id="span04" ></span><a
            href = "javascript:toggleCode( 'span04',
            'PropNames.html#getPropertyIndex', '50%', '100%' )" >convert
            a property name to an index</a>.
          </dd>
          <dt>
            <a href = "PropertyConsts-class.html" ><em>PropertyConsts</em></a>
          </dt>
          <dd>
            A singleton instance of <span class= "codefrag"
            >PropertyConsts</span> is created by the static initializer
            of the <span id="span05" ></span><a href =
            "javascript:toggleCode( 'span05',
            'PropertyConsts.html#pconsts', '50%', '100%' )" >pconsts</a>
            field.  Working from the property indices defined in
            PropNames, the methods in this class collect and supply the
            values of fields defined in property objects into
            arrays.<br> The heart of this class in the method <span
            id="span06" ></span><a href = "javascript:toggleCode(
            'span06', 'PropertyConsts.html#setupProperty', '50%', '100%'
            )" >setupProperty</a>, which constructs the property name
            from the index, instantiates a singleton of the appropriate
            class, and extracts static fields by reflection from that
            instance into the arrays of field values.
          </dd>
          <dt>
            <span id="span07" ></span><a href = "javascript:toggleCode(
            'span07', 'PropertySets.html#PropertySetsClass', '50%',
            '100%' )" ><em>PropertySets</em></a>
          </dt>
          <dd>
            This class provides a number of <span class= "codefrag"
            >ROBitSet</span>s representing many of the sets of
            properties defined in <em>Section 7</em> of the
            specification.  Note that the <span id="span08" ></span
            ><a href= "javascript:toggleCode( 'span08',
            'PropertySets.html#borderProps', '50%', '100%' )"
            ><em>Border</em></a>, <span id="span09" ></span ><a href=
            "javascript:toggleCode( 'span09',
            'PropertySets.html#paddingProps', '50%', '100%' )"
            ><em>Padding</em></a> and <span id="span10" ></span><a
            href= "javascript:toggleCode( 'span10',
            'PropertySets.html#backgroundProps', '50%', '100%'
            )"><em>Background</em></a> sets are defined separately.
          </dd>
          <dt>
            <span id="span11" ></span><a href = "javascript:toggleCode(
            'span11', '../FOPropertySets.html#FOPropertySetsClass',
            '50%', '100%' )"><em>FOPropertySets</em></a>
          </dt>
          <dd>
            This class provides a number of <span class= "codefrag"
            >ROBitSet</span>s representing sets of properties which are
            applicable in particular subtrees of the FO tree.  These
            sets are provided so that other properties can be ignored
            during processing of the subtrees.
          </dd>
          <dt>
            <span id="span12" ></span><a href = "javascript:toggleCode(
            'span12', 'ShorthandPropSets.html#ShorthandPropSetsClass',
            '50%', '100%' )"><em>ShorthandPropSets</em></a>
          </dt>
          <dd>
            This class contains arrays of <span id="span13" ></span><a
            href = "javascript:toggleCode( 'span13',
            'ShorthandPropSets.html#shorthands', '50%', '100%' )"
            >shorthand property indices</a> and <span id="span14"
            ></span><a href = "javascript:toggleCode( 'span14',
            'ShorthandPropSets.html#compounds', '50%', '100%' )"
            >compound property indices</a>, and <span class= "codefrag"
            >ROBitSet</span>s representing the expansion sets of these
            shorthands and compounds.  Various methods useful in the
            expansion of these properties are also included.
          </dd>
          <dt>
            <span id="span15" ></span><a href = "javascript:toggleCode(
            'span15', 'FOAttributes.html#FOAttributesClass', '50%',
            '100%' )"><em>FOAttributes</em></a>
          </dt>
          <dd>
            This class manages the attribute set that is associated with
            a SAX <span class= "codefrag" >startElement</span> event.
            <em>fo:</em> namespace attributes are entered into a <span
            id = "span16" ></span ><a href = "javascript:toggleCode(
            'span16', 'FOAttributes.html#foAttrMap', '50%', '100%' )"
            ><span class= "codefrag" >HashMap</span></a>, indexed by the
            <em>fo:</em> property index.  As other namespaces are
            encountered, the values are entered into namespace-specific
            <span id="span17" ></span><a href = "javascript:toggleCode(
            'span17', 'FOAttributes.html#nSpaceAttrMaps', '50%', '100%'
            )"><span class= "codefrag" >HashMap</span>s</a>, indexed by
            the <em>local name</em> of the attribute.
          </dd>
        </dl>
        <a name= "N100AC" ></a><a name= "property-classes" ></a>
        <h4>org.apache.fop.fo.properties</h4>
        <dl>
          <dt>
            <span id="span18" ></span><a href="javascript:toggleCode(
            'span18', 'Property.html#PropertyClass', '50%', '100%' )"
            ><em>Property</em></a>
          </dt>
          <dd>
            The base class for all individual property classes.
            There are 320 properties in all.
          </dd>
          <dt>
            <em>ColumnNumber</em>
          </dt>
          <dd>
            The actual property class with the lowest index
            number, followed in the index order by properties required
            for further processing, e.g. FontSize.
          </dd>
          <dt>
            <em>....</em>
          </dt>
          <dd>....</dd>
          <dt>
            <em>Background</em>
          </dt>
          <dd>
            First in index order of the remainining shorthand
            properties, followed in index order by all other remaining
            shorthands.
          </dd>
          <dt>
            <em>....</em>
          </dt>
          <dd>....</dd>
          <dt>
            <em>AbsolutePosition</em>
          </dt>
          <dd>
            First in index order of the remaining properties.  Within
            this ordering, compound properties precede their expansion
            properties, and corresponding relative properties precede
            corresponding absolute properties.
          </dd>
          <dt>
            <em>....</em>
          </dt>
          <dd>....</dd>
          <dt>
            <em>ZIndex</em>
          </dt>
          <dd>
            The property class with the highest index
            number.
          </dd>
        </dl>
        <a name= "N100EE" ></a>
        <h4>org.apache.fop.fo.expr</h4>
        <dl>
          <dt>
            <span id="span19" ></span><a href = "javascript:toggleCode(
            'span19', 'PropertyTokenizer.html#PropertyTokenizerClass',
            '50%', '100%' )"><em>PropertyTokenizer</em></a>
          </dt>
          <dd>
            The tokenizer for the property expression parser.  Defines a
            set of <span id="span20" ></span><a href =
            "javascript:toggleCode( 'span20',
            'PropertyTokenizer.html#EOF', '50%', '100%' )" >token
            constants</a> and returns these with associated token
            values.
          </dd>
          <dt>
            <span id="span21" ></span><a href = "javascript:toggleCode(
            'span21', 'PropertyParser.html#PropertyParserClass', '50%',
            '100%' )"><em>PropertyParser</em></a>
          </dt>
          <dd>
            This extends <span class= "codefrag"
            >PropertyTokenizer</span>.  It parses property
            expressions on the basis of the tokens passed to it by its
            superclass, generating <span class= "codefrag"
            >PropertyValue</span>s, including <span class= "codefrag"
            >PropertyValueList</span>s.
          </dd>
          <dt>
            <em>PropertyException</em>
          </dt>
          <dd>
            The basic class for all property-related exceptions.
            It extends <span class= "codefrag" >FOPException</span>. It
            is housed in this package by historical accident.
          </dd>
          <dt>
            <em>DataTypeNotImplementedException</em>
            <br>
            <em>FunctionNotImplementedException</em>
            <br>
            <em>PropertyNotImplementedException</em>
          </dt>
          <dd>
            A set of particular exceptions extending <span class=
            "codefrag" >PropertyException</span>.  Also in this package
            by accident.
          </dd>
        </dl>
        <a name= "N10134" ></a>
        <h4>org.apache.fop.datatypes</h4>
        <dl>
          <dt>
            <span id="span22" ></span><a href = "javascript:toggleCode(
            'span22', 'PropertyValue.html#PropertyValueInterface',
            '50%', '100%' )"><em>PropertyValue</em></a>
          </dt>
          <dd>
            An <em>interface</em> which all <span class= "codefrag"
            >PropertyValue</span> classes must implement.  In addition
            to a few methods, <span class= "codefrag"
            >PropertyValue</span> defines the set of <span id="span23"
            ></span><a href = "javascript:toggleCode( 'span23',
            'PropertyValue.html#NO_TYPE', '50%', '100%' )"
            >constants</a> which the <span class= "codefrag"
            >getType()</span> method may return; i.e. the valid set of
            <span class= "codefrag" >PropertyValue</span> types.
          </dd>
          <dt>
            <span id="span24" ></span><a href = "javascript:toggleCode(
            'span24',
            'AbstractPropertyValue.html#AbstractPropertyValueClass',
            '50%', '100%' )"><em>AbstractPropertyValue</em></a>
          </dt>
          <dd>
            An abstract implementation of the <span class= "codefrag"
            >PropertyValue</span> interface.  Most actual property value
            classes extend <span class= "codefrag"
            >AbstractPropertyValue</span>.
          </dd>
          <dt>
            <span id="span25" ></span><a href = "javascript:toggleCode(
            'span25', 'PropertyValueList.html#PropertyValueListClass',
            '50%', '100%' )"><em>PropertyValueList</em></a>
          </dt>
          <dd>
            This class extends <span class= "codefrag"
            >LinkedList</span> and implements <span class= "codefrag"
            >PropertyValue</span>.  It is used whenever the process of
            resolving a property expression yields a list of <span
            class= "codefrag" >PropertyValue</span> elements; notably
            during the processing of shorthands and "compound"
            properties.
          </dd>
          <dt>
            <em>StringType</em>
          </dt>
          <dd>
            A basic type extending <span class= "codefrag"
            >AbstractPropertyValue</span>.  Extended by <span class=
            "codefrag" >NCName</span>.
          </dd>
          <dt>
            <em>NCName</em>
          </dt>
          <dd>
            Extends <span class= "codefrag" >StringType</span> to represent
            NCName strings.
          </dd>
          <dt>
            <em>EnumType</em>
          </dt>
          <dd>
            Extends <span class= "codefrag"
            >AbstractPropertyValue</span> to represented enumerated
            types.
          </dd>
          <dt>
            <em>Other types</em>
          </dt>
          <dd>
            All other types extend one of the above classes.
          </dd>
        </dl>
        <a name= "N101A2" ></a>
        <h4>org.apache.fop.datatypes.indirect</h4>
        <dl>
          <dt>
            <em>IndirectValue</em>
          </dt>
          <dd>
            The base type for all indirect value types; extends
            <span class= "codefrag" >AbstractPropertyValue</span>.
          </dd>
        </dl>
        <p>
          <strong>Previous:</strong> <a href = "introduction.html"
          >Introduction</a>
        </p>
        <p>
          <strong>Next:</strong> <a href= "PropertyConsts-class.html"
                                       >The PropertyConsts class</a>
        </p>
      </div>
      
    </body>
  </html>
  
  
  
  1.1                  
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/enumerated-values.ehtml
  
  Index: enumerated-values.ehtml
  ===================================================================
  <!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>Enumerated Data Values</title>
      <script type="text/javascript" src="resources/codedisplay.js">
      </script>
    </head>
    <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" text="#000000" 
bgcolor="#FFFFFF">
      <div class="content">
        <h1>Enumerated Data Values</h1>
        <ul class="minitoc">
          <li>
            <a href="#N1000C">Enumerated Data Values</a>
            <ul class="minitoc">
              <li>
                <a href="#N10020">Array representation</a>
              </li>
              <li>
                <a href="#N1005C">HashMap representation</a>
              </li>
              <li>
                <a href="#N1009D">
                  Factoring Out Common Enumeration Values
                </a>
              </li>
              <li>
                <a href="#N100DD">Mapped Numeric Values</a>
              </li>
            </ul>
          </li>
        </ul>
        
        <a name="N1000C"></a>
        <h3>Enumerated Data Values</h3>
        <p>
          Property classes which allow enumerated data types must encode
          integer constants representing the enumeration tokens, and
          must provide a way of translating between the tokens and the
          integers, and <em>vice versa</em>.  Depending on the number of
          tokens in an enumeration set, the mapping from token to
          integer is maintained in an array or a <span
          class="codefrag">HashMap</span>.  The switch-over point from
          array to <span class="codefrag">HashMap</span> was determined
          by some highly implementation-dependent testing to be in the
          region of four to five elements.
        </p>
        <p>
          Many properties share common sets of enumeration tokens,
          e.g. those which allow color values, and those applying to
          borders and padding.  A special case of enumerated value is
          the mapped numeric enumeration, in which a token maps to a
          Numeric value.  These situations are discussed below.
        </p>
        <a name="N10020"></a>
        <h4>Array representation</h4>
        <p>
          
          <span id = "span00" ></span ><a href= "javascript:toggleCode(
          'span00', 'Direction.html#DirectionClass', '50%', '100%' )"
          ><span
          class="codefrag">org.apache.fop.fo.properties.Direction</span></a>
          is an example of a class which supports an enumerated value
          with a small set of tokens.  The <span id = "span01" ></span
          ><a href= "javascript:toggleCode( 'span01',
          'Direction.html#dataTypes', '50%', '100%' )" ><span
          class="codefrag">dataTypes</span></a> field contains the <span
          id = "span02" ></span ><a href= "javascript:toggleCode(
          'span02', 'Property.html#NOTYPE', '50%', '100%' )" ><span
          class="codefrag">ENUM</span> data type constant, defined in
          <span class="codefrag">Property</span></a>.  The enumeration
          integer constants are defined as <span class="codefrag">public
          static final int</span> values, <span id = "span03" ></span
          ><a href= "javascript:toggleCode( 'span03',
          'Direction.html#LTR', '50%', '100%') "><span class="codefrag'
          )" >LTR</span> and <span class="codefrag">RTL</span></a>.
          Associating enumeration tokens with these integer constants
          occurs in the array <a href=
          "javascript:window.top.displayCode( 'Direction.html#rwEnums'
          )" ><span class="codefrag">String[] rwEnums</span></a>, which
          is initialized with the token strings.  By convention, zero is
          never used to represent a valid enumeration constant, anywhere
          in this code.  It is, of course, critical that synchronization
          between <span class="codefrag">rwEnums</span> and the
          enumeration constants be maintained.
        </p>
        <p>
          The publicly accessible mapping from enumeration token to
          enumeration constant is achieved through the method <span id =
          "span04" ></span ><a href= "javascript:toggleCode( 'span04',
          'Direction.html#getEnumIndex', '50%', '100%' )" ><span
          class="codefrag">int getEnumIndex(String)</span></a>.  The
          corresponding mapping from enumeration constant to enumeration
          token is achieved through the method <span id = "span05"
          ></span ><a href= "javascript:toggleCode( 'span05',
          'Direction.html#getEnumText', '50%', '100%' )" ><span
          class="codefrag">String getEnumText(int)</span></a>.
        </p>
        <a name="N1005C"></a>
        <h4>HashMap representation</h4>
        <p>
          
          <span id = "span06" ></span ><a href= "javascript:toggleCode(
          'span06', 'RenderingIntent.html#RenderingIntentClass', '50%',
          '100%' )" ><span class="codefrag"
          >org.apache.fop.fo.properties.RenderingIntent</span ></a> is
          an example of a class which supports an enumerated value with
          a larger set of tokens.  The <span id = "span07" ></span ><a
          href= "javascript:toggleCode( 'span07',
          'RenderingIntent.html#dataTypes', '50%', '100%' )" ><span
          class="codefrag">dataTypes</span></a> field contains the <span
          id = "span08" ></span ><a href= "javascript:toggleCode(
          'span08', 'Property.html#NOTYPE', '50%', '100%' )" ><span
          class="codefrag">ENUM</span> data type constant, defined in
          <span class="codefrag">Property</span></a>.  Enumeration
          integer constants are defined as <span id = "span09" ></span
          ><a href= "javascript:toggleCode( 'span09',
          'RenderingIntent.html#PERCEPTUAL', '50%', '100%' )" ><span
          class="codefrag">public static final int</span></a> values.
          Zero is never used to represent a valid enumeration constant.
          The enumeration tokens are stored in the array <span id =
          "span10" ></span ><a href= "javascript:toggleCode( 'span10',
          'RenderingIntent.html#rwEnums', '50%', '100%' )" ><span
          class="codefrag">String[] rwEnums</span></a>, which is
          initialized with the token strings.  Association of
          enumeration tokens with the integer constants occurs in the
          <span class="codefrag">HashMap</span> <span id = "span11"
          ></span ><a href= "javascript:toggleCode( 'span11',
          'RenderingIntent.html#rwEnumHash"><span class="codefrag',
          '50%', '100%' )" > rwEnumHash</span></a>, which is initialized
          from the token array in a <span class="codefrag">static
          {}</span> initializer.  It is, of course, critical that
          synchronization between <span class="codefrag">rwEnums</span>
          and the enumeration constants be maintained.
        </p>
        <p>
          The publicly accessible mapping from enumeration token to
          enumeration constant is achieved through the method <span id =
          "span12" ></span ><a href= "javascript:toggleCode( 'span12',
          'RenderingIntent.html#getEnumIndex', '50%', '100%' )" ><span
          class="codefrag">int getEnumIndex(String)</span></a>.  The
          corresponding mapping from enumeration constant to enumeration
          token is achieved through the method <span id = "span13"
          ></span ><a href= "javascript:toggleCode( 'span13',
          'RenderingIntent.html#getEnumText', '50%', '100%' )" ><span
          class="codefrag">String getEnumText(int)</span></a>.
        </p>
        <a name="N1009D"></a>
        <h4 id="common-enum-values">
          Factoring Out Common Enumeration Values
        </h4>
        <p>
          When a number of properties support a common enumerated value,
          that value and its associated access methods may be factored
          out to a new class, which each of the properties then extends.
          An example of such a common super-class is <span id = "span14"
          ></span ><a href= "javascript:toggleCode( 'span14',
          'BorderCommonStyle.html#BorderCommonStyleClass', '50%', '100%'
          )" ><span class="codefrag">BorderCommonStyle</span></a>.  Like
          a property with a normal HashMap representation of an
          enumerated value, BorderCommonStyle defines <span id =
          "span15" ></span ><a href= "javascript:toggleCode( 'span15',
          'BorderCommonStyle.html#HIDDEN', '50%', '100%' )" ><span
          class="codefrag">public static final int</span></a>
          enumeration integer constants.  Similarly, the enumeration
          tokens are stored in the array <span id = "span16" ></span ><a
          href= "javascript:toggleCode( 'span16',
          'BorderCommonStyle.html#rwEnums', '50%', '100%' )" ><span
          class="codefrag">String[] rwEnums</span></a>, and the
          association of enumeration tokens with the integer constants
          occurs in the <span class="codefrag">HashMap</span> <span id =
          "span17" ></span ><a href= "javascript:toggleCode( 'span17',
          'BorderCommonStyle.html#rwEnumHash', '50%', '100%' )" ><span
          class="codefrag"> rwEnumHash</span></a>, initialized in a
          <span class="codefrag">static {}</span> initializer.  The
          mapping methods <span id = "span18" ></span ><a href=
          "javascript:toggleCode( 'span18',
          'BorderCommonStyle.html#getEnumIndex', '50%', '100%' )" ><span
          class="codefrag">int getEnumIndex(String)</span></a> and <span
          id = "span19" ></span ><a href= "javascript:toggleCode(
          'span19', 'BorderCommonStyle.html#getEnumText', '50%', '100%'
          )" ><span class="codefrag">String getEnumText(int)</span></a>
          are also present.
        </p>
        <p>
          Notice, however, that the class has none of the static data
          constants described in the discussion of <a
          href="simple-properties.html">simple properties</a>.  These
          values are defined in the individual sub-classes of this
          class, e.g. <span id = "span20" ></span ><a href=
          "javascript:toggleCode( 'span20',
          'BorderLeftStyle.html#BorderLeftStyleClass', '50%', '100%' )"
          ><span class="codefrag">BorderLeftStyle</span></a>.  None of
          the above fields or methods occur, and <span
          class="codefrag">BorderLeftStyle</span> is left looking like
          an example of a simple property.  The enumeration mapping
          methods are, however, available through the super-class <span
          class="codefrag">BorderCommonStyle</span>.
        </p>
        <a name="N100DD"></a>
        <h4>Mapped Numeric Values</h4>
        <p>
          In "normal" enumerated values, the token is, effectively,
          passed directly into the layout operation of the flow object
          to which the property is applied.  Some enumerated values,
          however, generate a <span class="codefrag">Numeric</span>
          result.  Their resolution involves mapping the token to the
          indicated <span class="codefrag">Numeric</span> value.
        </p>
        <p>
          An example is the <span id = "span21" ></span ><a href=
          "javascript:toggleCode( 'span21',
          'BorderCommonWidth.html#BorderCommonWidthClass', '50%', '100%'
          )" ><span class="codefrag">BorderCommonWidth</span></a>
          property.  This, like the example of <a
          href="#common-enum-values"><span
          class="codefrag">BorderCommonStyle</span></a> above, also
          represents common enumerated values which have been factored
          out to form a super-class for particular properties.  <span
          class="codefrag">BorderCommonWidth</span>, therefore, also
          defines <span id = "span22" ></span ><a href=
          "javascript:toggleCode( 'span22',
          'BorderCommonWidth.html#THIN', '50%', '100%' )" ><span
          class="codefrag">enumeration constant values</span></a> and an
          array of tokens.  In this case, there is no <span
          class="codefrag">HashMap</span>, because of the limited number
          of tokens, but the mapping methods <span id = "span23" ></span
          ><a href= "javascript:toggleCode( 'span23',
          'BorderCommonWidth.html#getEnumIndex', '50%', '100%' )" ><span
          class="codefrag">int getEnumIndex(String)</span></a> and <span
          id = "span24" ></span ><a href= "javascript:toggleCode(
          'span24', 'BorderCommonWidth.html#getEnumText', '50%', '100%'
          )" ><span class="codefrag">String getEnumText(int)</span></a>
          are present.
        </p>
        <p>
          The added element in this property is the array <span id =
          "span25" ></span ><a href= "javascript:toggleCode( 'span25',
          'BorderCommonWidth.html#mappedPoints', '50%', '100%' )" ><span
          class="codefrag">double[] mappedPoints</span></a>.  The
          entries in this array must by maintained in syncronization
          with the <span id = "span26" ></span ><a href=
          "javascript:toggleCode( 'span26',
          'BorderCommonWidth.html#rwEnums', '50%', '100%' )" ><span
          class="codefrag">String[] rwEnums</span></a> array of tokens
          and the set of <span id = "span27" ></span ><a href=
          "javascript:toggleCode( 'span27',
          'BorderCommonWidth.html#THIN', '50%', '100%' )" >enumeration
          constants</a>.  The mapping from token to Numeric value is
          achieved by the <span id = "span28" ></span ><a href=
          "javascript:toggleCode( 'span28',
          'BorderCommonWidth.html#getMappedLength', '50%', '100%' )"
          ><span class="codefrag">Numeric getMappedLength(FONode, int,
          int)</span></a> method.
        </p>
        <p>
          
          <span id = "span29" ></span ><a href= "javascript:toggleCode(
          'span29', 'BorderLeftWidth.html#BorderLeftWidthClass', '50%',
          '100%' )" ><span class="codefrag">BorderLeftWidth</span></a>
          extends <span id = "span30" ></span ><a href=
          "javascript:toggleCode( 'span30', 'BorderCommonWidth.html',
          '50%', '100%' )" ><span
          class="codefrag">BorderCommonWidth</span></a>.  It includes
          the basic static data, like <a
          href="simple-properties.html">simple properties</a>, and, in
          this case, the <span id = "span31" ></span ><a href=
          "javascript:toggleCode( 'span31',
          'BorderLeftWidth.html#getInitialValue', '50%', '100%' )"
          ><span class="codefrag">PropertyValue
          getInitialValue(int)</span></a> method to derive the initial
          value.
        </p>
        <a name="N10139"></a>
        <h4>Deriving Mapped Numeric Values</h4>
        <p>
          As usual with property values, the usual method of deriving a
          mapped numeric value is by calling the <span id = "span32"
          ></span ><a href= "javascript:toggleCode( 'span32',
          '../PropertyConsts.html#getMappedNumeric', '50%', '100%' )"
          ><span class="codefrag">Numeric getMappedNumeric(FONode, int,
          int)</span></a> method in <span id = "span33" ></span ><a
          href= "javascript:toggleCode( 'span33',
          '../PropertyConsts.html#pconsts', '50%', '100%' )" ><span
          class="codefrag">pconsts</span></a>.  All properties which
          support a mapped numeric value must have a <span
          class="codefrag">Numeric getMappedNumeric(FONode, int)</span>
          method, which will be called through its singleton instance,
          stored in the <span id = "span34" ></span ><a href=
          "javascript:toggleCode( 'span34',
          'PropertyConsts.html#properties', '50%', '100%' )" ><span
          class= "codefrag" >properties</span ></a> array, by the <span
          class="codefrag">PropertyConsts</span> method.
        </p>
  
        <p>
          <strong>Previous:</strong> <a href= "getInitialValue.html"
                                    >getInitialValue()</a>
        </p>
        <!--
        <p>
          <strong>Next:</strong> <a href= "getInitialValue.html"
                                    >getInitialValue()</a>
        </p>
  -->
        
      </div>
    </body>
  </HTML>
  
  
  
  1.1                  
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/getInitialValue.ehtml
  
  Index: getInitialValue.ehtml
  ===================================================================
  <!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>Generating Initial Values</title>
      <script type="text/javascript" src="resources/codedisplay.js">
      </script>
    </head>
    <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" text="#000000" 
bgcolor="#FFFFFF">
      <div class="content">
        <h1>Generating Initial Values</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="#N10021">
              Generating &amp; Accessing Initial Values
            </a>
            <ul class="minitoc">
              <li>
                <a href="#N10062">Properties without
                  getInitialValue()</a>
              </li>
            </ul>
          </li>
        </ul>
        
        <a name="N10014"></a>
        <h3>Introduction</h3>
        <p>
          The <a href="simple-properties.html">previous section</a>
          discussed the common data elements in the simplest examples of
          property classes.  This section discusses more complex classes
          whose facilities are accessed only through various methods.
        </p>
        
        <a name="N10021"></a>
        <h3>
          Generating &amp; Accessing Initial Values
        </h3>
        <p>
          
          <span id = "span00" ></span ><a href= "javascript:toggleCode(
          'span00', 'AutoRestore.html', '50%', '100%' )" ><span
          class="codefrag"
          >org.apache.fop.fo.properties.AutoRestore</span></a> is an
          example of the next most complex property class.  In addition
          to all of the common static fields, these classes have initial
          data value types which require the dynamic generation of a
          PropertyValue instance.
        </p>
        <p>
          The method <span id = "span01" ></span ><a href=
          "javascript:toggleCode( 'span01',
          'AutoRestore.html#getInitialValue', '50%', '100%' )" ><span
          class="codefrag">PropertyValue getInitialValue(int)</span></a>
          returns an instance of PropertyValue of the appropriate
          subclass containing the initial value for this property.  Like
          the static data fields, this value is, in turn, stored in the
          array of initial values maintained in the <span id = "span02"
          ></span ><a href= "javascript:toggleCode( 'span02',
          'PropertyConsts.html#PropertyConstsClass', '50%', '100%' )"
          ><span class="codefrag">PropertyConsts</span></a> singleton
          <span id = "span03" ></span ><a href= "javascript:toggleCode(
          'span03', 'PropertyConsts.html#pconsts', '50%', '100%' )"
          ><span class="codefrag">pconsts</span></a>.` As with the
          fields, the first invocation of the method <span id = "span04"
          ></span ><a href= "javascript:toggleCode( 'span04',
          'PropertyConsts.html#setupProperty', '50%', '100%' )" ><span
          class="codefrag">setupProperty</span></a> on the property
          instantiates the singleton instance of the class, and stores
          that instance in the in the <span id = "span05" ></span ><a
          href= "javascript:toggleCode( 'span05',
          'PropertyConsts.html#properties', '50%', '100%' )" ><span
          class="codefrag">Property[] properties</span></a> array of
          <span id = "span06" ></span ><a href= "javascript:toggleCode(
          'span06', 'PropertyConsts.html#pconsts', '50%', '100%' )"
          ><span class="codefrag">pconsts</span></a>.
        </p>
        <p>
          Unlike the static data fields, however, the initial value is
          not immediately generated.  It is generated by a call to <span
          id = "span07" ></span ><a href= "javascript:toggleCode(
          'span07', 'PropertyConsts.html#getInitialValue', '50%', '100%'
          )" ><span class="codefrag">PropertyValue
          getInitialValue(int)</span></a> in <span id = "span08" ></span
          ><a href= "javascript:toggleCode( 'span08',
          'PropertyConsts.html#pconsts', '50%', '100%' )" ><span
          class="codefrag">pconsts</span></a>.  This call, in turn,
          locates the relevant instance of the particular property class
          in the <span id = "span09" ></span ><a href=
          "javascript:toggleCode( 'span09',
          'PropertyConsts.html#properties', '50%', '100%' )" ><span
          class= "codefrag" >properties</span> array of <span class=
          "codefrag" >PropertyConsts</span></a>, and invokes the <span
          class= "codefrag" >getInitialValue()</span> of that instance.
          A side-effect of this call is to store the initial value in
          <span id = "span10" ></span ><a href= "javascript:toggleCode(
          'span10', 'PropertyConsts.html#initialValues', '50%', '100%'
          )" ><span class="codefrag">PropertyValue[]
          initialValues</span></a>.
        </p>
        <a name="N10062"></a>
        <h4>Properties without
          getInitialValue()</h4>
        <p>
          What about property classes which have no <span
          class="codefrag">getInitialValue()</span> method?  The
          simplest classes, e.g. <span
          class="codefrag">Character</span>, fall into this category.
          As <a href="classes-overview.html#property-classes">noted
          previously</a>, all of the property classes extend <span
          class="codefrag">org.apache.fop.fo.properties.Property</span>.
          <span id = "span11" ></span ><a href= "javascript:toggleCode(
          'span11', 'Property.html#PropertyClass', '50%', '100%' )"
          ><span class="codefrag">Property</span></a> provides a base
          <span id = "span12" ></span ><a href= "javascript:toggleCode(
          'span12', 'Property.html#getInitialValue', '50%', '100%' )"
          ><span class="codefrag">PropertyValue
          getInitialValue(int)</span></a> method to which the simple
          classes fall back.  Note that it is only valid for <span
          class="codefrag">NOTYPE_IT</span>, <span
          class="codefrag">AUTO_IT</span>, <span
          class="codefrag">NONE_IT</span> and <span
          class="codefrag">AURAL_IT</span> initial value types, so all
          classes which have any other initial value type must override
          this method.
        </p>
  
        <p>
          <strong>Previous:</strong> <a href = "simple-properties.html"
          >Simple property classes</a>
        </p>
        <p>
          <strong>Next:</strong> <a href= "enumerated-values.html"
                                    >Enumerated values</a>
        </p>
        
      </div>
    </body>
  </HTML>
  
  
  
  1.4       +7 -7      
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/index.xml
  
  
  
  
  1.1                  
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/PropertyConsts-class.ehtml
  
  Index: PropertyConsts-class.ehtml
  ===================================================================
  <!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>PropertyConsts Description</title>
    </head>
    <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"
          text="#000000" bgcolor="#FFFFFF">
      <div class="content">
        <h1>PropertyConsts Description</h1>
        <p>
          <font size="-2">by&nbsp;Peter B. West</font>
        </p>
        <ul class="minitoc">
          <li>
            <a href="#N10014">Introduction</a>
          </li>
        </ul>
        
        <a name="N10014"></a>
        <h3>Introduction</h3>
        <p>
          
          <a href="javascript:window.top.displayCode(
             'PropertyConsts.html#PropertyConstsClass'
          )">This class</a>, and the singleton object which is <a
          href="javascript:window.top.displayCode(
          'PropertyConsts.html#pconsts' )">generated by the static
          initializer</a>, is essentially a repository of
          &lt;property&gt; class instances and the static data from
          those classes of <span
          class="codefrag">org.apache.fop.fo.property</span>.
          The heart of this class is the method <a href=
          "javascript:window.top.displayCode(
          'PropertyConsts.html#setupProperty' )"><span class="codefrag"
          >setupProperty</span ></a>.  Whenever access to the data or
          methods of a property class is required, this method in the
          singleton must be called to ensure that an instance of the
          property exists and that the static data from that instance
          has been extracted.
        </p>
  
        <div class="frame note">
          <div class="label">Note</div>
          <div class="content">
            An alternative to this requirement would be to pre-load all
            of the individual property classes during the system
            initialization phase.  This is not done currently because of
            the start-up expense of the required class loading for over
            three hundred classes, and the relatively low added expense
            of checking for the existence of a property instance before
            every access.  Given that FOP is increasingly used in a
            server environment, it may prove acceptable in the long run
            to change to pre-loading.
          </div>
        </div>
  
        <p>
          The class name is generated and stored in the <a
          href="javascript:window.top.displayCode(
          'PropertyConsts.html#classNames' )"><span class="codefrag"
          >classNames</span ></a> array; a class instance is generated
          from the name and stored in the <a
          href="javascript:window.top.displayCode(
          'PropertyConsts.html#classes' )"><span class="codefrag"
          >classes</span ></a> array; and an instance of the class is
          generated from the class object and stored in the <a
          href="javascript:window.top.displayCode(
          'PropertyConsts.html#properties' )"><span class="codefrag"
          >properties</span ></a> array.
        </p>
  
        <p>
          The other data gathering facilities and access methods of this
          class will be examined in conjunction with the various types
          of property classes.
        </p>
  
        <p>
          <strong>Previous:</strong> <a href = "classes-overview.html"
          >Property classes overview</a>
        </p>
        <p>
          <strong>Next:</strong> <a href= "simple-properties.html"
                                    >Simple property classes</a>
        </p>
      </div>
    </body>
  </html>
  
  
  
  1.1                  
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/propertyExpressions.ehtml
  
  Index: propertyExpressions.ehtml
  ===================================================================
  <!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>Property Expression Parsing</title>
      <script type="text/javascript" src="resources/codedisplay.js">
      </script>
    </head>
    <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" text="#000000" 
bgcolor="#FFFFFF">
      <div class="content">
        <h1>Property Expression Parsing</h1>
        <p>
          <font size="-2">by&nbsp;Peter B. West</font>
        </p>
        <ul class="minitoc">
          <li>
            <a href="#N10014">Property expression parsing</a>
            <ul class="minitoc">
              <li>
                <a href="#N10044">Data types</a>
              </li>
              <li>
                <a href="#N10252">Tokenizer</a>
              </li>
              <li>
                <a href="#N1029C">Parser</a>
              </li>
            </ul>
          </li>
        </ul>
        
        <a name="N10014"></a>
        <h3>Property expression parsing</h3>
        <p>
          The parsing of property value expressions is handled by two
          closely related classes: <span id = "span00" ></span ><a href=
          "javascript:toggleCode( 'span00',
          'PropertyTokenizer.html#PropertyTokenizerClass', '50%', '100%'
          )" ><span class= "codefrag"
          >org.apache.fop.fo.expr.PropertyTokenizer</span></a> and its
          subclass, <span id = "span01" ></span ><a href=
          "javascript:toggleCode( 'span01',
          'PropertyParser.html#PropertyParserClass', '50%', '100%' )"
          ><span class= "codefrag"
          >org.apache.fop.fo.expr.PropertyParser</span></a>, and by
          <span class= "codefrag" >refineParsing(int, FONode,
          PropertyValue)</span> methods in the individual property
          classes.  <span class= "codefrag" >PropertyTokenizer</span>,
          as the name suggests, handles the tokenizing of the
          expression, handing <span id = "span02" ></span ><a href=
          "javascript:toggleCode( 'span02',
          'PropertyTokenizer.html#EOF', '50%', '100%' )"
          ><em>tokens</em></a> back to its subclass, <span class=
          "codefrag" >PropertyParser</span>. <span class= "codefrag"
          >PropertyParser</span>, in turn, returns a <span id = "span03"
          ></span ><a href= "javascript:toggleCode( 'span03',
          'PropertyValueList.html#PropertyValueListClass', '50%', '100%'
          )" ><span class= "codefrag">PropertyValueList</span></a>, a
          list of <span id = "span04" ></span ><a href=
          "javascript:toggleCode( 'span04',
          'PropertyValue.html#PropertyValueInterface', '50%', '100%' )"
          ><span class= "codefrag">PropertyValue</span></a>s.
        </p>
        <p>
          The tokenizer and parser rely in turn on the datatype
          definitions from the <span class= "codefrag"
          >org.apache.fop.datatypes</span> package, which include the
          <span id = "span05" ></span ><a href= "javascript:toggleCode(
          'span05', 'PropertyValue.html#NO_TYPE', '50%', '100%' )"
          ><span class= "codefrag" >PropertyValue</span> datatype
          constant definitions</a>.
        </p>
        <a name="N10044"></a>
        <h4>Data types</h4>
        <p>
          The data types currently defined in
          <span class= "codefrag" >org.apache.fop.datatypes</span> include:
        </p>
        <table class="ForrestTable" cellspacing="1" cellpadding="4">
          
            <tr>
              <th colspan="2" rowspan="1">Numbers and lengths</th>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">Numeric</th>
              <td colspan="3" rowspan="1">
                The fundamental length data type.  <em>Numerics</em> of
                various types are constructed by the classes listed
                below.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <th colspan="3"
                  rowspan="1">Constructor classes for <em>Numeric</em></th>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1">Ems</td>
              <td colspan="2" rowspan="1">Relative length in <em>ems</em></td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1">IntegerType</td>
              <td colspan="1" rowspan="1"></td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1">Length</td>
              <td colspan="2" rowspan="1">In centimetres(cm), millimetres(mm),
                inches(in), points(pt), picas(pc) or pixels(px)</td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1">Percentage</td>
              <td colspan="1" rowspan="1"></td>
            </tr>
  
            <tr>
              <th colspan="1" rowspan="1">Other Numeric</th>
              <td colspan="3" rowspan="1">
                Other numeric vaues which do not interact with the
                lengths represented by <em>Numeric</em> values.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1">Angle</td>
              <td colspan="2" rowspan="1">In degrees(deg), gradients(grad) or
                radians(rad)</td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1">Frequency</td>
              <td colspan="2" rowspan="1">In hertz(Hz) or kilohertz(kHz)</td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1">Time</td>
              <td colspan="1" rowspan="1">In seconds(s) or milliseconds(ms)</td>
            </tr>
            
            <tr>
              <th colspan="2" rowspan="1">Strings</th>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">StringType</th>
              <td colspan="3" rowspan="1">
                Base class for data types which result in a <em>String</em>.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">Literal</th>
              <td colspan="2" rowspan="1">
                A subclass of <em>StringType</em> for literals which
                exceed the constraints of an <em>NCName</em>.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">MimeType</th>
              <td colspan="2" rowspan="1">
                A subclass of <em>StringType</em> for literals which
                represent a mime type.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">UriType</th>
              <td colspan="2" rowspan="1">
                A subclass of <em>StringType</em> for literals which
                represent a URI, as specified by the argument to
                <em>url()</em>.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">NCName</th>
              <td colspan="2" rowspan="1">
                A subclass of <em>StringType</em> for literals which
                meet the constraints of an <em>NCName</em>.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">Country</th>
              <td colspan="1" rowspan="1">An RFC 3066/ISO 3166 country code.</td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">Language</th>
              <td colspan="1" rowspan="1">An RFC 3066/ISO 639 language code.</td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">Script</th>
              <td colspan="1" rowspan="1">An ISO 15924 script code.</td>
            </tr>
            
            <tr>
              <th colspan="2" rowspan="1">Enumerated types</th>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">EnumType</th>
              <td colspan="3" rowspan="1">
                An integer representing one of the tokens in a set of
                enumeration values.
              </td>
            </tr>
            
            <tr>
              <td colspan="1" rowspan="1"></td>
              <th colspan="1" rowspan="1">MappedNumeric</th>
              <td colspan="2" rowspan="1">
                A subclass of <em>EnumType</em>.  Maintains a
                <em>Numeric</em> with the value to which the associated
                "raw" enumeration token maps.  E.g., the
                <em>font-size</em> enumeration value "medium" maps to
                the <em>Numeric</em> "12pt".
              </td>
            </tr>
            
            <tr>
              <th colspan="2" rowspan="1">Colors</th>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">ColorType</th>
              <td colspan="3" rowspan="1">
                Maintains a four-element array of float, derived from
                the name of a standard colour, the name returned by a
                call to <em>system-color()</em>, or an RGB
                specification.
              </td>
            </tr>
            
            <tr>
              <th colspan="2" rowspan="1">Fonts</th>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">FontFamilySet</th>
              <td colspan="3" rowspan="1">
                Maintains an array of <em>String</em>s containing a
                prioritized list of possibly generic font family names.
              </td>
            </tr>
            
            <tr>
              <th colspan="2" rowspan="1">Pseudo-types</th>
            </tr>
            
            <tr>
              <td colspan="4" rowspan="1">
                A variety of pseudo-types have been defined as
                convenience types for frequently appearing enumeration
                token values, or for other special purposes.
              </td>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">Inherit</th>
              <td colspan="3" rowspan="1">
                For values of <em>inherit</em>.
              </td>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">Auto</th>
              <td colspan="3" rowspan="1">
                For values of <em>auto</em>.
              </td>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">None</th>
              <td colspan="3" rowspan="1">
                For values of <em>none</em>.
              </td>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">Bool</th>
              <td colspan="3" rowspan="1">
                For values of <em>true/false</em>.
              </td>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">FromNearestSpecified</th>
              <td colspan="3" rowspan="1">
                Created to ensure that, when associated with
                a shorthand, the <em>from-nearest-specified-value()</em>
                core function is the sole component of the expression.
              </td>
            </tr>
            
            <tr>
              <th colspan="1" rowspan="1">FromParent</th>
              <td colspan="3" rowspan="1">
                Created to ensure that, when associated with
                a shorthand, the <em>from-parent()</em>
                core function is the sole component of the expression.
              </td>
            </tr>
            
        </table>
        <a name="N10252"></a>
        <h4>Tokenizer</h4>
        <p>
          As mentioned above, the <span class= "codefrag"
          >PropertyTokenizer</span> hands <span id = "span06" ></span
          ><a href= "javascript:toggleCode( 'span06',
          'PropertyTokenizer.html#EOF', '50%', '100%' )"
          ><em>tokens</em></a> back to its subclass, <span class=
          "codefrag" >PropertyParser</span>.  Most of these tokens are
          self-explanatory, but a few need further comment.
        </p>
        <dl>
          
          <dt>AUTO</dt>
          
          <dd>
            Because of its frequency of occurrence, and the fact that it
            is always the <em>initial value</em> for any property which
            supports it, AUTO has been promoted into a pseudo-type with
            its on datatype class.  Therefore, it is also reported as a
            token.
          </dd>
          
          <dt>NONE</dt>
          
          <dd>
            Similarly to AUTO, NONE has been promoted to a pseudo-type
            because of its frequency.
          </dd>
          
          <dt>BOOL</dt>
          
          <dd>
            There is a <em>de facto</em> boolean type buried in the
            enumeration types for many of the properties.  It had been
            specified as a type in its own right in this code.
          </dd>
          
          <dt>MIMETYPE</dt>
          
          <dd>
            The property <span class= "codefrag" >content-type</span>
            introduces this complication.  It can have two values of the
            form <strong>content-type:</strong><em>mime-type</em>
            (e.g. <span class= "codefrag"
            >content-type="content-type:xml/svg"</span>) or
            <strong>namespace-prefix:</strong><em>prefix</em>
            (e.g. <span class= "codefrag"
            >content-type="namespace-prefix:svg"</span>).  The
            experimental code reduces these options to the payload in
            each case: an <span class= "codefrag" >NCName</span> in the
            case of a namespace prefix, and a MIMETYPE in the case of a
            content-type specification.  <span class= "codefrag"
            >NCName</span>s cannot contain a "/".
          </dd>
          
        </dl>
        <a name="N1029C"></a>
        <h4>Parser</h4>
        <p>
          The parser returns a <span id = "span07" ></span ><a href=
          "javascript:toggleCode( 'span07',
          'PropertyValueList.html#PropertyValueListClass', '50%', '100%'
          )" ><span class= "codefrag" >PropertyValueList</span ></a>,
          necessary because of the possibility that a list of <span id =
          "span08" ></span ><a href= "javascript:toggleCode( 'span08',
          'PropertyValue.html#PropertyValueInterface', '50%', '100%' )"
          ><span class= "codefrag" >PropertyValue</span ></a> elements
          may be returned from the expressions of some properties.
        </p>
        <p>
          
          <span class= "codefrag" >PropertyValueList</span>s may contain
          <span class= "codefrag" >PropertyValue</span>s or other <span
          class= "codefrag" >PropertyValueList</span>s.  This latter
          provision is necessitated by some of the more peculiar
          expression possibilities, <em>e.g.</em> <em>font</em> and
          <em>text-shadow</em>.  <em>text-shadow</em> may contain whitespace
          separated sublists of either two or three elements, separated
          from one another by commas.  To accommodate this peculiarity,
          comma separated elements are added to the top-level list,
          while whitespace separated values are always collected into
          sublists to be added to the top-level list.
        </p>
        <p>
          Other special cases include the processing of the core
          functions <span class= "codefrag" >from-parent()</span> and
          <span class= "codefrag" >from-nearest-specified-value()</span>
          when these function calls are assigned to a shorthand
          property, or used with a shorthand property name as an
          argument.  In these cases, the function call must be the sole
          component of the expression.  The pseudo-element classes <span
          class= "codefrag" >FromParent</span> and <span
          class= "codefrag" >FromNearestSpecified</span> are generated in
          these circumstances so that an exception will be thrown if
          they are involved in expression evaluation with other
          components. (See Rec. Section 5.10.4 Property Value
          Functions.)
        </p>
        <p>
          The experimental code is a simple extension of the existing
          parser code, which itself borrowed heavily from James
          Clark's XT processor.
        </p>
        
      </div>
    </body>
  </html>
  
  
  
  1.1                  
xml-fop/src/documentation/content/xdocs/design/alt.design/properties/simple-properties.ehtml
  
  Index: simple-properties.ehtml
  ===================================================================
  <!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>
      <script type="text/javascript" src="resources/codedisplay.js">
      </script>
    </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 <span id = "span00"
          ></span ><a href= "javascript:toggleCode( 'span00',
          'PropertyConsts.html#PropertyConstsClass', '50%', '100%' )"
          ><span class="codefrag">PropertyConsts</span></a> class and
          its singleton object.
        </p>
        
        <a name="N10026"></a>
        <h3>Common data</h3>
        <p>
          
          <span id = "span01" ></span ><a href= "javascript:toggleCode(
          'span01', 'Character.html', '50%', '100%' )" ><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 <span id = "span02" ></span ><a
            href= "javascript:toggleCode( 'span02',
            'Property.html#NOTYPE', '50%', '100%' )" ><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 <span id
            = "span03" ></span ><a href= "javascript:toggleCode(
            'span03', 'Property.html#NO_TRAIT', '50%', '100%' )" ><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 <span id = "span04"
            ></span ><a href= "javascript:toggleCode( 'span04',
            'Property.html#NOTYPE_IT', '50%', '100%' )" ><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 <span id = "span05" ></span ><a href=
            "javascript:toggleCode( 'span05', 'Property.html#NO', '50%',
            '100%' )" ><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 <span id = "span06" ></span ><a href=
          "javascript:toggleCode( 'span06',
          'PropertyConsts.html#PropertyConstsClass', '50%', '100%' )"
          ><span class="codefrag">PropertyConsts</span></a> singleton
          <span id = "span07" ></span ><a href= "javascript:toggleCode(
          'span07', 'PropertyConsts.html#pconsts', '50%', '100%' )"
          ><span class="codefrag">pconsts</span></a>.  The first
          invocation of the method <span id = "span08" ></span ><a href=
          "javascript:toggleCode( 'span08',
          'PropertyConsts.html#setupProperty', '50%', '100%' )" ><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 <span id = "span09"
          ></span ><a href= "javascript:toggleCode( 'span09',
          'PropertyConsts.html#classes', '50%', '100%' )" ><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 <span id = "span10" ></span ><a href=
          "javascript:toggleCode( 'span10',
          'PropertyConsts.html#properties', '50%', '100%' )" ><span
          class="codefrag">Property[] properties</span></a> array of
          <span id = "span11" ></span ><a href= "javascript:toggleCode(
          'span11', '../PropertyConsts.html#pconsts', '50%', '100%' )"
          ><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>
            
            <span id = "span12" ></span ><a href=
            "javascript:toggleCode( 'span12',
            'PropertyConsts.html#datatypes', '50%', '100%' )" ><span
            class="codefrag">int[] datatypes</span></a>
            
          </dt>
          
          <dd>
            
            <span id = "span13" ></span ><a href=
            "javascript:toggleCode( 'span13',
            'PropertyConsts.html#getDataTypes', '50%', '100%' )" ><span
            class="codefrag">int getDataTypes(int)</span></a>
            
          </dd>
          
          <dt>
            
            <span id = "span14" ></span ><a href=
            "javascript:toggleCode( 'span14',
            'PropertyConsts.html#traitMappings', '50%', '100%' )" ><span
            class="codefrag">int[] traitMappings</span></a>
            
          </dt>
          
          <dd>
            
            <em>No access method yet defined.</em>
            
          </dd>
          
          <dt>
            
            <span id = "span15" ></span ><a href=
            "javascript:toggleCode( 'span15',
            'PropertyConsts.html#initialValueTypes', '50%', '100%' )"
            ><span class="codefrag">int[] initialValueTypes</span></a>
            
          </dt>
          
          <dd>
            
            <span id = "span16" ></span ><a href=
            "javascript:toggleCode( 'span16',
            'PropertyConsts.html#getInitialValueType', '50%', '100%' )"
            ><span class="codefrag">int
            getInitialValueType(int)</span></a>
            
          </dd>
          
          <dt>
            
            <span id = "span17" ></span ><a href=
            "javascript:toggleCode( 'span17',
            'PropertyConsts.html#inherited', '50%', '100%' )" ><span
            class="codefrag">int[] inherited</span></a>
            
          </dt>
          
          <dd>
            
            <span id = "span18" ></span ><a href=
            "javascript:toggleCode( 'span18',
            'PropertyConsts.html#inheritance', '50%', '100%' )" ><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>
    </body>
  </HTML>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to