public void doTag()
            throws JspException
    {
        JspTag parentTag = SimpleTagSupport.findAncestorWithClass(this, IFormattable.class);

        // if there are errors we need to either add these to the parent AbstractBastTag or report an error.
        if (hasErrors()) {
            if (parentTag instanceof IFormattable) {
                IFormattable parent = (IFormattable) parentTag;
                parent.formatterHasError();
            }
            reportErrors();
            return;
        }

        if (parentTag instanceof IFormattable) {
            StringFormatter formatter = new StringFormatter();
            formatter.setPattern(_pattern);
            formatter.setTruncate(truncate);
            IFormattable parent = (IFormattable) parentTag;
            parent.addFormatter(formatter);
        }
        else {
            String s = Bundle.getString("Tags_FormattableParentRequired");
            registerTagError(s, null);
            reportErrors();
        }
    }
public void doTag ( ) throws JspException { JspTag parentTag = SimpleTagSupport . findAncestorWithClass ( this , IFormattable . class ) ; if ( hasErrors ( ) ) { if ( parentTag instanceof IFormattable ) { IFormattable parent = ( IFormattable ) parentTag ; parent . formatterHasError ( ) ; } reportErrors ( ) ; return ; } if ( parentTag instanceof IFormattable ) { StringFormatter formatter = new StringFormatter ( ) ; formatter . setPattern ( _pattern ) ; formatter . setTruncate ( truncate ) ; IFormattable parent = ( IFormattable ) parentTag ; parent . addFormatter ( formatter ) ; } else { String s = Bundle . getString ( "Tags_FormattableParentRequired" ) ; registerTagError ( s , null ) ; reportErrors ( ) ; } }
Create the internal Formatter instance and perform the formatting.
@throws JspException if a JSP exception has occurred