You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Peter B. West" <pb...@powerup.com.au> on 2001/09/25 04:30:42 UTC

Experiments with properties

For anyone interested in such matters, I was to attach the files that 
contain my tinkering with the expression of FO properties.  My first cut 
of this encoded virtually all of the property information in static 
final arrays.  FOPropertyConsts.java still contains an example of this 
in the dataTypes array, which I have not got around to changing yet.

When I discovered how to access array elements dynamically, I was able 
to take a more Java-esque approach and code the details in the 
individual property classes which are nested classes of 
FOProperties.java.  The arrays still exist in FOPropertyConsts.java, but 
they are now initialized by means of static initializers.  Only the 
propertyNames and propertyClassNames need to be kept in sync with one 
another and the set of class name constants.  The latter will, I expect, 
prove to be redundant given that the basic information in the arrays now 
comes from the classes, and the property class names are derived in a 
predictable manner from the property names.

The advantage that I see to this approach is that all of the property 
information can be kept in one place without resorting to XML, XSL, code 
generation and the consequent build shenanigans.

One disadvantage is that I cannot edit FOProperties.java in JDE under 
XEmacs - it's just appallingly slow.  vim has no problems.

Unfortunately, FOProperties.java is bigger than 100,000 bytes, so I 
cannot send it.  If anyone is interested, let me know and I will mail it 
to you.

Peter

-- 
Peter B. West  pbwest@powerup.com.au  http://powerup.com.au/~pbwest
"Lord, to whom shall we go?"

Re: Experiments with properties

Posted by "Peter B. West" <pb...@powerup.com.au>.
One side-effect of the approach I have been looking at with properties 
is that the Class objects for all of the properties are available in an 
array.  The property classes are so far static, containing on class 
fields, arrays and methods, but if they were to go live, the 
Class.newInstance or Constructor.newInstance methods provide direct ways 
of generating instances of the classes.


Peter
-- 
Peter B. West  pbwest@powerup.com.au  http://powerup.com.au/~pbwest
"Lord, to whom shall we go?"


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org