Class ConstraintsTag

  • All Implemented Interfaces:
    ConditionalTag, org.apache.commons.jelly.Tag
    Direct Known Subclasses:
    BorderConstraintsTag, PercentConstraintsTag

    public abstract class ConstraintsTag
    extends FormBaseTag

    An abstract base class for creating layout constraints objects.

    The task of this tag and its concrete sub classes is to create and initialize a layout constraints object of a specific type and to pass this object to the component tag this tag is nested into. From there it will be used when the corresponding component is added into a container.

    This base class already implements functionality for searching the associated component tag and for calling the setter method for the constraints object. Concrete sub classes only have to implement the logic for creating the constraints object.

    Version:
    $Id: ConstraintsTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • ConstraintsTag

        public ConstraintsTag()
    • Method Detail

      • process

        protected void process()
                        throws org.apache.commons.jelly.JellyTagException,
                               FormBuilderException
        Executes this tag. Searches for the corresponding component tag. Calls createConstraints() to create the constraints. Then the new constraints object is passed to the component tag.
        Specified by:
        process in class FormBaseTag
        Throws:
        org.apache.commons.jelly.JellyTagException - if there is a jelly specific error
        FormBuilderException - if an error occurs
      • createConstraints

        protected abstract Object createConstraints​(ComponentManager manager)
                                             throws FormBuilderException,
                                                    org.apache.commons.jelly.MissingAttributeException
        Creates the constraints object. This method must be implemented in concrete sub classes to create an object of the specific layout constraints class.
        Parameters:
        manager - the component manager
        Returns:
        the layout constraints object
        Throws:
        FormBuilderException - if an error occurs
        org.apache.commons.jelly.MissingAttributeException - if required attributes are missing