output.endElement(tagName); } catch (SAXException x) { throw new JellyTagException(x);
/** * Factory method to create a new JellyTagException instance from a given * failure exception * @param e is the exception which occurred attempting to load the class * @return JellyTagException */ protected JellyTagException createLoadClassFailedException(Exception e) { return new JellyTagException( "Could not load class: " + className + ". Reason: " + e, e ); } }
private void assertNotNull(Object value) throws JellyTagException { if(null == value) { throw new JellyTagException("A " + typeString + " instance cannot be null."); } }
/** * Factory method to create a new JellyTagException instance from a given * failure exception * @param e is the exception which occurred attempting to load the class * @return JellyTagException */ protected JellyTagException createLoadClassFailedException(Exception e) { return new JellyTagException( "Could not load class: " + className + ". Reason: " + e, e ); } }
/** * Factory method to create a new JellyTagException instance from a given * failure exception * @param e is the exception which occurred attempting to load the class * @return JellyTagException */ protected JellyTagException createLoadClassFailedException(Exception e) { return new JellyTagException( "Could not load class: " + className + ". Reason: " + e, e ); } }
public void beforeSetAttributes() throws JellyTagException { // create a new dynabean before the attributes are set try { setDynaBean( beanClass.newInstance() ); } catch (IllegalAccessException e) { throw new JellyTagException("Could not instantiate dynabean",e); } catch (InstantiationException e) { throw new JellyTagException("Could not instantiate dynabean",e); } setAttributesSet.clear(); }
/** Evaluates the body of a tag */ public void run(JellyContext context, XMLOutput output) throws JellyTagException { if ( text != null ) { try { output.write(text); } catch (SAXException e) { throw new JellyTagException("could not write to XMLOutput",e); } } } }
/** * A helper method to handle this Jelly exception. * This method adorns the JellyException with location information * such as adding line number information etc. */ protected void handleException(JellyException e) throws JellyTagException { if (log.isTraceEnabled()) { log.trace( "Caught exception: " + e, e ); } applyLocation(e); throw new JellyTagException(e); }
public void beforeSetAttributes() throws JellyTagException { // create a new dynabean before the attributes are set try { bean = beanClass.newInstance(); setDynaBean( new ConvertingWrapDynaBean( bean ) ); } catch (InstantiationException e) { throw new JellyTagException("Could not instantiate dynabean",e); } catch (IllegalAccessException e) { throw new JellyTagException("Could not instantiate dynabean",e); } setAttributesSet.clear(); }
/** * A helper method to handle this Jelly exception. * This method adorns the JellyException with location information * such as adding line number information etc. */ protected void handleException(JellyException e) throws JellyTagException { if (log.isTraceEnabled()) { log.trace( "Caught exception: " + e, e ); } applyLocation(e); throw new JellyTagException(e); }
public void beforeSetAttributes() throws JellyTagException { // create a new dynabean before the attributes are set try { setDynaBean( beanClass.newInstance() ); } catch (IllegalAccessException e) { throw new JellyTagException("Could not instantiate dynabean",e); } catch (InstantiationException e) { throw new JellyTagException("Could not instantiate dynabean",e); } setAttributesSet.clear(); }
public void beforeSetAttributes() throws JellyTagException { // create a new dynabean before the attributes are set try { setDynaBean( beanClass.newInstance() ); } catch (IllegalAccessException e) { throw new JellyTagException("Could not instantiate dynabean",e); } catch (InstantiationException e) { throw new JellyTagException("Could not instantiate dynabean",e); } setAttributesSet.clear(); }
public void beforeSetAttributes() throws JellyTagException { // create a new dynabean before the attributes are set try { bean = beanClass.newInstance(); setDynaBean( new ConvertingWrapDynaBean( bean ) ); } catch (InstantiationException e) { throw new JellyTagException("Could not instantiate dynabean",e); } catch (IllegalAccessException e) { throw new JellyTagException("Could not instantiate dynabean",e); } setAttributesSet.clear(); }
public void doTag(XMLOutput output) throws JellyTagException { try { getResponse().getOutputStream().println("<!DOCTYPE html PUBLIC \""+publicId+"\" \""+systemId+"\">"); } catch (IOException e) { throw new JellyTagException(e); } } }
/** Evaluates the body of a tag */ public void run(JellyContext context, XMLOutput output) throws JellyTagException { Object result = expression.evaluate(context); if ( result != null ) { try { output.objectData(result); } catch (SAXException e) { throw new JellyTagException("Could not write to XMLOutput",e); } } } }
public void doTag(XMLOutput output) throws JellyTagException { StructuredMessageFormatTag tag = (StructuredMessageFormatTag)findAncestorWithClass(StructuredMessageFormatTag.class); if(tag == null) throw new JellyTagException("This tag must be enclosed inside a <structuredMessageFormat> tag" ); StringWriter sw = new StringWriter(); XMLOutput o = XMLOutput.createXMLOutput(sw); invokeBody(o); tag.addArgument(sw); } }
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); } } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if (name == null) { throw new MissingAttributeException( "name" ); } try { output.startDTD(name, publicId, systemId); invokeBody(output); output.endDTD(); } catch (SAXException e) { throw new JellyTagException(e); } }
public void doTag(XMLOutput output) throws JellyTagException { try { output.startElement(uri, localName, qname, attributes); invokeBody(output); output.endElement(uri, localName, qname); } catch (SAXException e) { throw new JellyTagException(e); } finally { attributes.clear(); context = null; } }
public void doTag(XMLOutput output) throws JellyTagException { ElementTag tag = (ElementTag) findAncestorWithClass( ElementTag.class ); if (tag == null) { throw new JellyTagException( "<attribute> tag must be enclosed inside an <element> tag" ); } tag.setAttributeValue(getName(), getBodyText(false), getURI()); }