/** * Check a given 'attribute' has a value and throw the corresponding * exception if it doesn't * * @param attribute the attribute to check * @param message the message to pass in with the exception * @throws MissingAttributeException when the attribute is null */ protected void checkAttribute( Object attribute, String message ) throws MissingAttributeException { if ( attribute == null ) { throw new MissingAttributeException( message ); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if (xpCmp == null) { throw new MissingAttributeException( "xpCmp" ); } if (list == null) { throw new MissingAttributeException( "list" ); } Collections.sort(list, xpCmp); }
throw new MissingAttributeException("a_mandatory_attr"); throw new InvalidAttributeValueException("some_attr", badValue);
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if ( script == null ) { throw new MissingAttributeException("script"); } script.run(context, output); } }
/** * Checks whether the {@code name} attribute is set. If this is not the * case, an exception is thrown. This method is called by {@link #process()} * . If derived classes need to check the existence of a {@code name} * attribute at an earlier point of time, they can use this method. * * @throws MissingAttributeException if no {@code name} attribute is * specified */ protected void checkName() throws MissingAttributeException { if (getName() == null) { throw new MissingAttributeException("name"); } }
public void doTag(XMLOutput output) throws MissingAttributeException { if (var != null) { context.removeVariable( var.evaluateAsString(context) ); } else { throw new MissingAttributeException("var"); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if (test != null) { if (test.evaluateAsBoolean(context)) { invokeBody(output); } } else { throw new MissingAttributeException( "test" ); } }
public void doTag(XMLOutput output) throws MissingAttributeException { if (var != null) { context.removeVariable( var.evaluateAsString(context) ); } else { throw new MissingAttributeException("var"); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { this.defaultEncountered = false; this.someCaseMatched = false; this.fallingThru = false; if(null == on) { throw new MissingAttributeException("on"); } else { value = on.evaluate(context); invokeBody(output); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { this.defaultEncountered = false; this.someCaseMatched = false; this.fallingThru = false; if(null == on) { throw new MissingAttributeException("on"); } else { value = on.evaluate(context); invokeBody(output); } }
public void doTag(XMLOutput output) throws MissingAttributeException { if (var != null) { context.removeVariable( var.evaluateAsString(context) ); } else { throw new MissingAttributeException("var"); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if (test != null) { if (test.evaluateAsBoolean(context)) { invokeBody(output); } } else { throw new MissingAttributeException( "test" ); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { this.defaultEncountered = false; this.someCaseMatched = false; this.fallingThru = false; if(null == on) { throw new MissingAttributeException("on"); } else { value = on.evaluate(context); invokeBody(output); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { this.defaultEncountered = false; this.someCaseMatched = false; this.fallingThru = false; if(null == on) { throw new MissingAttributeException("on"); } else { value = on.evaluate(context); invokeBody(output); } }
public void doTag(XMLOutput output) throws MissingAttributeException { if (var != null) { context.removeVariable( var.evaluateAsString(context) ); } else { throw new MissingAttributeException("var"); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if (test != null) { if (test.evaluateAsBoolean(context)) { invokeBody(output); } } else { throw new MissingAttributeException( "test" ); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { if (test != null) { if (test.evaluateAsBoolean(context)) { invokeBody(output); } } else { throw new MissingAttributeException( "test" ); } }
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException { invokeBody(output); if (name == null) { throw new MissingAttributeException("name"); } if (dynaClass == null) { throw new MissingAttributeException("dynaClass"); } final DynaClass theDynaClass = dynaClass; final Map beanAttributes = (attributes != null) ? attributes : EMPTY_MAP; TagFactory factory = new TagFactory() { public Tag createTag(String name, Attributes attributes) { return new DynamicDynaBeanTag(theDynaClass, beanAttributes, varAttribute); } }; getTagLibrary().registerBeanTag(name, factory); // now lets clear the attributes for next invocation and help the GC attributes = null; }
/** * Checks if all mandatory attributes are defined. * * @throws MissingAttributeException if attributes are missing */ protected void checkAttributes() throws MissingAttributeException { if (!getTextIconData().isDefined()) { throw new MissingAttributeException("text or icon"); } /* if */ } }
/** * Creates the constraints object. This implementation returns the string * that was passed in through the <code>name</code> attribute. * * @param manager the component manager * @return the constraints object * @throws FormBuilderException if an error occurs * @throws MissingAttributeException if a required attribute is missing */ protected Object createConstraints(ComponentManager manager) throws FormBuilderException, MissingAttributeException { if (StringUtils.isEmpty(getName())) { throw new MissingAttributeException("name"); } /* if */ return getName(); } }