Package org.apache.commons.jelly

Examples of org.apache.commons.jelly.JellyTagException


    protected Object newInstance(Class theClass, Map attributes, XMLOutput output)
    throws JellyTagException {
        try {
            return theClass.newInstance();
        } catch (IllegalAccessException e) {
            throw new JellyTagException(e.toString());
        } catch (InstantiationException e) {
            throw new JellyTagException(e.toString());
        }
    }
View Full Code Here


        validateBeanProperties(bean, attrsToUse);

        try {
            BeanUtils.populate(bean, attrsToUse);
        } catch (IllegalAccessException e) {
            throw new JellyTagException("could not set the properties of the bean",e);
        } catch (InvocationTargetException e) {
            throw new JellyTagException("could not set the properties of the bean",e);
        }
    }
View Full Code Here

    protected void validateBeanProperties(Object bean, Map attributes) throws JellyTagException {
        if (!isIgnoreUnknownProperties()) {
            for (Iterator i=attributes.keySet().iterator();i.hasNext();) {
                String attrName = (String)i.next();
                if (! PropertyUtils.isWriteable(bean, attrName)) {
                    throw new JellyTagException("No bean property found: " + attrName);
                }
            }
        }
    }
View Full Code Here

        if(null == this.valueExpression) {
            throw new MissingAttributeException("value");
        }
        SwitchTag tag = (SwitchTag)findAncestorWithClass(SwitchTag.class);
        if(null == tag) {
            throw new JellyTagException("This tag must be enclosed inside a <switch> tag" );
        }
        if(tag.hasDefaultBeenEncountered()) {
            throw new JellyTagException("<default> should be the last tag within a <switch>" );
        }
        Object value = valueExpression.evaluate(context);
        if(tag.isFallingThru() ||
           (null == tag.getValue() && null == value) ||
           (null != tag.getValue() && tag.getValue().equals(value))) {
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() ) {
            tag.setBlockEvaluated(true);
            invokeBody(output);
        }
View Full Code Here

                try {
                    output.write(text);
                }
                catch (SAXException e) {
                    throw new JellyTagException("could not write the XMLOutput",e);
                }
            }
        }
    }
View Full Code Here

                text = file.toString();
                context.runScript(file, output, isExport(), isInherit());
            }
        }
        catch (JellyException e) {
            throw new JellyTagException("could not include jelly script: " + text + ". Reason: " + e, e);
        }
    }
View Full Code Here

                context.runScript(new java.io.File(file), output, true,
                  isInherit());
            }
        }
        catch (JellyException e) {
            throw new JellyTagException("could not import script",e);
        }
    }
View Full Code Here

        if ( xmlOutput == null ) {
            // lets default to system.out
            try {
                xmlOutput = XMLOutput.createXMLOutput( System.out );
            } catch (UnsupportedEncodingException e) {
                throw new JellyTagException(e);
            }
        }

        // lets create a child context
        final JellyContext newContext = context.newJellyContext();
View Full Code Here

    {
        ConcatTag tag = (ConcatTag) findAncestorWithClass( ConcatTag.class );

        if ( tag == null )
        {
            throw new JellyTagException( "no current concatenation" );
        }

        tag.addFile( file );
    }
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.