Strategy ONE

The Transform Interface and AbstractTransform Class

Transform and AbstractTransform contain methods shared by all transforms for accessing formal parameters, determining component support, and previewing information. AbstractTransform provides methods to add formal parameter definitions to the transform definition.

All transforms extend the Transform interface and inherit its methods. These methods, which are common to all transforms, are described below (the support methods check if the transform supports a particular class or object):

  • transform— Renders specified bean in specified MarkupOutput. For this method to work the transform must be resolved and the bean must be of the type supported by this transform.

  • getSupportedBeanType— Returns a root class/interface supported by this transform. An assumption is made that each transform supports only beans belonging to one class hierarchy.  

  • getDescription— Returns a textual description of this transform.  

  • getFormalParams— Returns an interface, FormalParameters, which is a collection of transform parameters associated with this transform. If this transform has no parameters, the method returns a null pointer.  

  • isResolved— Determines whether all required formal parameters have values and whether transform() can be used for rendering.  

The abstract base class, AbstractTransform, implements the Transform interface and provides additional methods for creating and accessing formal parameters.