Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.JellyTagException


     */
    protected void setBeanProperties(Object bean, Map attributes) throws JellyTagException {
        try {
            BeanUtils.populate(bean, attributes);
        } catch (IllegalAccessException e) {
            throw new JellyTagException("could not set the properties on a bean",e);
        } catch (InvocationTargetException e) {
            throw new JellyTagException("could not set the properties on a bean",e);
        }
    }
View Full Code Here


            handler.startDocument();
            invokeBody(newOutput);
            handler.endDocument();
        }
        catch (SAXException e) {
            throw new JellyTagException(e);
        }
    }
View Full Code Here

        try {
            getXMLReader().parse( new InputSource( new StringReader( text ) ) );
        }
        catch (Exception e) {
            throw new JellyTagException(e);
        }
    }
View Full Code Here

            context.setVariable(var, result);

        } catch(Throwable t) {
            throw
                new JellyTagException("Could not access " + className + "." +
                                      var + ".  Original exception message: " +
                                      t.getMessage(), t);
        }
    }
View Full Code Here

            log.trace( "Caught exception: " + e, e );
        }

        applyLocation(e);

        throw new JellyTagException(e);
    }
View Full Code Here

        if ( e instanceof JellyException ) {
            e.fillInStackTrace();
        }

        if ( e instanceof InvocationTargetException) {
            throw new JellyTagException( ((InvocationTargetException)e).getTargetException(),
                                      fileName,
                                      elementName,
                                      columnNumber,
                                      lineNumber );
        }

        throw new JellyTagException(e, fileName, elementName, columnNumber, lineNumber);
    }
View Full Code Here

        if (e instanceof LocationAware) {
            applyLocation((LocationAware) e);
        }

        throw new JellyTagException(e, fileName, elementName, columnNumber, lineNumber);
    }
View Full Code Here

    // Tag interface
    //-------------------------------------------------------------------------
    public void doTag(XMLOutput output) throws JellyTagException {
        ChooseTag tag = (ChooseTag) findAncestorWithClass( ChooseTag.class );
        if ( tag == null ) {
            throw new JellyTagException( "This tag must be enclosed inside a <choose> tag" );
        }
        if ( ! tag.isBlockEvaluated() && test != null ) {
            if ( test.evaluateAsBoolean( context ) ) {
                tag.setBlockEvaluated(true);
                invokeBody(output);
View Full Code Here

    //-------------------------------------------------------------------------
    public void doTag(XMLOutput output) throws JellyTagException {
        // perform validation up front to fail fast
        if ( var != null ) {
            if ( target != null || property != null ) {
                throw new JellyTagException( "The 'target' and 'property' attributes cannot be used in combination with the 'var' attribute" );
            }
        }
        else {
            if ( target == null ) {
                throw new JellyTagException( "Either a 'var' or a 'target' attribute must be defined for this tag" );
            }
            if ( property == null ) {
                throw new JellyTagException( "The 'target' attribute requires the 'property' attribute" );
            }
        }

        Object answer = null;
        if ( value != null ) {
View Full Code Here

            invokeBody(output);

            processBean(var, bean);
        }
        catch (ClassNotFoundException e) {
            throw new JellyTagException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.jelly.JellyTagException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.