From: William Victor Mote Date: Tue, 29 Apr 2003 15:47:10 +0000 (+0000) Subject: Start on consolidation and reorganization. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1514 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fc3d2adaa16e7d6e778ec69060280236df5102ad;p=xmlgraphics-fop.git Start on consolidation and reorganization. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196370 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/design/properties.xml b/src/documentation/content/xdocs/design/properties.xml index 8a7797555..047f9d780 100644 --- a/src/documentation/content/xdocs/design/properties.xml +++ b/src/documentation/content/xdocs/design/properties.xml @@ -3,54 +3,76 @@ "http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-forrest/src/resources/schema/dtd/document-v11.dtd">
- Properties - Properties overview + FOP Design: Properties
+
+ Introduction +

As the input XSL-FO is being parsed and the FO Tree is being built, the attributes of the FO elements are passed by the parser to the related FO object. +The java object that represent the FO object then converts the attributes into properties that are stored in the FO Tree.

+
+ +
+ Issues +

The following are some issues when dealing with properties:

+
    +
  • Initial Property Set
  • +
  • Inheritance: Some properties can be inherited from parent objects.
  • +
  • Adoption: The parentage for some elements can move around. +Markers are one example.
  • +
  • Multiple Namespaces: The properties for foreign namespaces must be handled.
  • +
  • Expressions: XSL-FO expressions can be included in properties.
  • +
+
-
- Properties -

The XML attributes on each element are passed to the object. The objects -that represent FO objects then convert the attributes into properties.

-

Since properties can be inherited the PropertyList class handles resolving -properties for a particular element. -All properties are specified in an XML file. Classes are created -automatically during the build process.

-

In some cases the element may be moved to have a different parent, for -example markers, or the inheritance could be different, for example -initial property set.

-

Properties (recall that FO's have properties, areas have traits, and XML -nodes have attributes) are also a concern of FOTreeBuilder. It -accomplishes this by using a PropertyListBuilder. There is a -separate PropertyListBuilder for each namespace encountered -while building the FO tree. Each Builder object contains a hash of -property names and their respective makers. It may also +

+ Overview of Processing +

The general flow of property processing is as follows:

+
    +
  • As part of FOTreeBuilder.startElement(), FObj.handleAttrs is passed a list of attributes to be processed for the new FObj.
  • +
  • FObj.handleAttrs gets a PropertyListBuilder and asks it to create a Property List from them. There is currently only one static PropertyListBuilder, which handles the fo: namespace.
  • +
  • FObj.handleAttrs then cross-references the PropertyList with the FObj.
  • +
+
+
+ PropertyListBuilder +

Each plb object contains a hash of +property names and their respective Makers. It may also contain element-specific property maker hashes; these are based on the local name of the flow object, ie. table-row, not fo:table-row. If an element-specific property mapping exists, it is preferred to the generic mapping.

-

The base class for all -properties is Property, and all the property makers extend -Property.Maker. A more complete discussion of the property -architecture may be found in Properties.

+

The PLB handles loops through each attribute in the list, finds an appropriate "Maker" for it, then calls the Maker to convert the attribute value into a Property object of the correct type, and stores that Property in the PropertyList.

- - -

The Refinement step is part of reading and using the properties which may happen immediately or during the layout process.

- -

During XML Parsing, the FO tree is constructed. For each FO object (some -subclass of FObj), the tree builder then passes the list of all -attributes specified on the FO element to the handleAttrs method. This -method converts the attribute specifications into a PropertyList.

-

The actual work is done by a PropertyListBuilder (PLB for short). The -basic idea of the PLB is to handle each attribute in the list in turn, -find an appropriate "Maker" for it, call the Maker to convert the -attribute value into a Property object of the correct type, and store -that Property in the PropertyList.

Property datatypes

The property datatypes are defined in the @@ -356,9 +378,16 @@ the result is a Property object, and the actual value may be accessed

Refinement +

The Refinement step is part of reading and using the properties which may happen immediately or during the layout process.

Refined FO Tree
+
+ Implementation Notes +
+

All properties are specified in src/codegen/foproperties.xml. +The related classes are created automatically during the build process.

+

The base class for all properties is fo.Property, and the base class for all the property makers is the inner class Property.Maker.