/** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. * Because of the higher quality validation messages possible, * this is the preferred way to do validation (although isValid() * still works). * * <p>JSP 2.0 and higher containers call validate() instead of isValid(). * The default implementation of this method is to call isValid(). If * isValid() returns false, a generic ValidationMessage[] is returned * indicating isValid() returned false.</p> * * @param data The TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since JSP 2.0 */ public ValidationMessage[] validate( TagData data ) { ValidationMessage[] result = null; if( !isValid( data ) ) { result = new ValidationMessage[] { new ValidationMessage( data.getId(), "isValid() == false" ) }; } return result; }
/** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. * Because of the higher quality validation messages possible, * this is the preferred way to do validation (although isValid() * still works). * * <p>JSP 2.0 and higher containers call validate() instead of isValid(). * The default implementation of this method is to call isValid(). If * isValid() returns false, a generic ValidationMessage[] is returned * indicating isValid() returned false.</p> * * @param data The TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since JSP 2.0 */ public ValidationMessage[] validate( TagData data ) { ValidationMessage[] result = null; if( !isValid( data ) ) { result = new ValidationMessage[] { new ValidationMessage( data.getId(), "isValid() == false" ) }; } return result; }
public VariableInfo[] getVariableInfo(TagData data) { String varName = data.getId(); if (varName == null) return new VariableInfo[0]; else return (new VariableInfo[]{ new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }); } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.util.Locale", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
public VariableInfo [] getVariableInfo (TagData data) { String varName = data.getId(); if ( varName == null ) { return new VariableInfo[] {}; } else { return new VariableInfo [] { new VariableInfo(varName, "java.lang.String", true, VariableInfo.AT_END) }; } }
@Override public ValidationMessage[] validate(TagData data) { final List<ValidationMessage> messages = new ArrayList<ValidationMessage>(); Object o = data.getAttribute("fname"); if (o == null) { messages.add(new ValidationMessage(data.getId(), "fname cannot be null.")); } if (messages.size() == 0) { return null; } return messages.toArray(new ValidationMessage[messages.size()]); } }
/** * Checks to ensure that where the tag supports providing one of two attributes * that one and only one is provided. */ @Override public ValidationMessage[] validate(final TagData tag) { Collection<ValidationMessage> errors = new ArrayList<ValidationMessage>(); Object beanclass = tag.getAttribute("beanclass"); Object binding = tag.getAttribute("binding"); if (!(beanclass != null ^ binding != null)) { errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'beanclass' or 'binding' must be supplied.")); } String var = tag.getAttributeString("var"); String id = tag.getAttributeString("id"); if (!(var != null ^ id != null)) { errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'var' or 'id' must be supplied.")); } return errors.toArray(new ValidationMessage[errors.size()]); } }
/** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. * Because of the higher quality validation messages possible, * this is the preferred way to do validation (although isValid() * still works). * * <p>JSP 2.0 and higher containers call validate() instead of isValid(). * The default implementation of this method is to call isValid(). If * isValid() returns false, a generic ValidationMessage[] is returned * indicating isValid() returned false.</p> * * @param data The TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since JSP 2.0 */ public ValidationMessage[] validate( TagData data ) { ValidationMessage[] result = null; if( !isValid( data ) ) { result = new ValidationMessage[] { new ValidationMessage( data.getId(), "isValid() == false" ) }; } return result; }
/** * Checks to ensure that where the tag supports providing one of two * attributes that one and only one is provided. * @param tag * @return */ @Override public ValidationMessage[] validate(final TagData tag) { Collection<ValidationMessage> errors = new ArrayList<ValidationMessage>(); Object beanclass = tag.getAttribute("beanclass"); Object binding = tag.getAttribute("binding"); if (!(beanclass != null ^ binding != null)) { errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'beanclass' or 'binding' must be supplied.")); } String var = tag.getAttributeString("var"); String id = tag.getAttributeString("id"); if (!(var != null ^ id != null)) { errors.add(new ValidationMessage(tag.getId(), "Exactly one of 'var' or 'id' must be supplied.")); } return errors.toArray(new ValidationMessage[errors.size()]); } }
/** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. * Because of the higher quality validation messages possible, * this is the preferred way to do validation (although isValid() * still works). * * <p>JSP 2.0 and higher containers call validate() instead of isValid(). * The default implementation of this method is to call isValid(). If * isValid() returns false, a generic ValidationMessage[] is returned * indicating isValid() returned false.</p> * * @param data The TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since 2.0 */ public ValidationMessage[] validate( TagData data ) { ValidationMessage[] result = null; if( !isValid( data ) ) { result = new ValidationMessage[] { new ValidationMessage( data.getId(), "isValid() == false" ) }; } return result; }
/** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. * Because of the higher quality validation messages possible, * this is the preferred way to do validation (although isValid() * still works). * * <p>JSP 2.0 and higher containers call validate() instead of isValid(). * The default implementation of this method is to call isValid(). If * isValid() returns false, a generic ValidationMessage[] is returned * indicating isValid() returned false.</p> * * @param data The TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since 2.0 */ public ValidationMessage[] validate( TagData data ) { ValidationMessage[] result = null; if( !isValid( data ) ) { result = new ValidationMessage[] { new ValidationMessage( data.getId(), "isValid() == false" ) }; } return result; }
/** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. * Because of the higher quality validation messages possible, * this is the preferred way to do validation (although isValid() * still works). * * <p>JSP 2.0 and higher containers call validate() instead of isValid(). * The default implementation of this method is to call isValid(). If * isValid() returns false, a generic ValidationMessage[] is returned * indicating isValid() returned false.</p> * * @param data The TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since JSP 2.0 */ public ValidationMessage[] validate( TagData data ) { ValidationMessage[] result = null; if( !isValid( data ) ) { result = new ValidationMessage[] { new ValidationMessage( data.getId(), "isValid() == false" ) }; } return result; }
/** * Translation-time validation of the attributes. * Request-time attributes are indicated as such in the TagData parameter. * Because of the higher quality validation messages possible, * this is the preferred way to do validation (although isValid() * still works). * * <p>JSP 2.0 and higher containers call validate() instead of isValid(). * The default implementation of this method is to call isValid(). If * isValid() returns false, a generic ValidationMessage[] is returned * indicating isValid() returned false.</p> * * @param data The TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since 2.0 */ public ValidationMessage[] validate( TagData data ) { ValidationMessage[] result = null; if( !isValid( data ) ) { result = new ValidationMessage[] { new ValidationMessage( data.getId(), "isValid() == false" ) }; } return result; }