pbwest      2003/01/20 06:55:02

  Added:       src/documentation/content/design/alt.design/properties
  Code documentation
  Revision  Changes    Path
  Index: getInitialValue.html
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
      <title>Generating Initial Values</title>
      <style type= "text/css" >
        span.codeDisplay {font:italic bold}
        body {
        font-family: Verdana, Helvetica, sans-serif;
        .note { border: solid 1px #7099C5; background-color: #f0f0ff; }
        .note .label { background-color: #7099C5; color: #ffffff; }
        .content {
        padding: 5px 5px 5px 10px;
        font : Verdana, Helvetica, sans-serif;  font-size : 90%;
    <body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" text="#000000" 
      <div class="content">
        <h1>Generating Initial Values</h1>
          <font size="-2">by&nbsp;Peter B. West</font>
        <ul class="minitoc">
            <a href="#N10014">Introduction</a>
            <a href="#N10021">
              Generating &amp; Accessing Initial Values
            <ul class="minitoc">
                <a href="#N10062">Properties without
        <a name="N10014"></a>
          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.
        <a name="N10021"></a>
          Generating &amp; Accessing Initial Values
          <a href= "javascript:parent.displayCode( 'AutoRestore.html' )"
          ><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.
          The method <a href= "javascript:parent.displayCode(
          'AutoRestore.html#getInitialValue' )" ><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 <a href=
          'PropertyConsts.html#PropertyConstsClass' )" ><span
          class="codefrag">PropertyConsts</span></a> singleton <a href=
          "javascript:parent.displayCode( 'PropertyConsts.html#pconsts'
          )" ><span class="codefrag">pconsts</span></a>.` As with the
          fields, the first invocation of the method <a href=
          'PropertyConsts.html#setupProperty' )" ><span
          class="codefrag">setupProperty</span></a> on the property
          instantiates the singleton instance of the class, and stores
          that instance in the in the <a href=
          'PropertyConsts.html#properties' )" ><span
          class="codefrag">Property[] properties</span></a> array of <a
          href= "javascript:parent.displayCode(
          'PropertyConsts.html#pconsts' )" ><span
          Unlike the static data fields, however, the initial value is
          not immediately generated.  It is generated by a call to <a
          href= "javascript:parent.displayCode(
          'PropertyConsts.html#getInitialValue' )" ><span
          class="codefrag">PropertyValue getInitialValue(int)</span></a>
          in <a href= "javascript:parent.displayCode(
          'PropertyConsts.html#pconsts' )" ><span
          class="codefrag">pconsts</span></a>.  This call, in turn,
          locates the relevant instance of the particular property class
          in the <a href= "javascript:parent.displayCode(
          'PropertyConsts.html#properties' )" ><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 <a
          href= "javascript:parent.displayCode(
          'PropertyConsts.html#initialValues' )" ><span
          class="codefrag">PropertyValue[] initialValues</span></a>.
        <a name="N10062"></a>
        <h4>Properties without
          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
          <a href= "javascript:parent.displayCode(
          'Property.html#PropertyClass' )" ><span
          class="codefrag">Property</span></a> provides a base <a href=
          'Property.html#getInitialValue' )" ><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.
          <strong>Previous:</strong> <a href = "simple-properties.html"
          >Simple property classes</a>
          <strong>Next:</strong> <a href= "enumerated-values.html"
                                    >Enumerated values</a>
      <table summary="footer" cellspacing="0" cellpadding="0" width="100%" height="20" 
            <td colspan="2" height="1" bgcolor="#4C6C8F"><img height="1"
            width="1" alt="" src="../../../skin/images/spacer.gif"><a
            <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>
            <td align="left" bgcolor="#CFDCED" class="logos"></td><td
            align="right" bgcolor="#CFDCED" class="logos"></td>

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

Reply via email to