/** * Sets the name of the element that this Element definition defines. * * @param name the name of the defined element **/ public void setName(String name) { if ((name == null) || (ValidationUtils.isNCName(name))) { _name = name; } else { String err = "error: '" + name + "' is not a valid NCName."; throw new IllegalArgumentException(err); } } // -- setName
/** * Sets the name of the element that this Element definition defines. * * @param name the name of the defined element **/ public void setName(String name) { if ((name == null) || (ValidationUtils.isNCName(name))) { _name = name; } else { String err = "error: '" + name + "' is not a valid NCName."; throw new IllegalArgumentException(err); } } //-- setName
/** * Checks the validity of this Schema defintion. * * @exception ValidationException when this Schema definition is invalid. **/ public void validate() throws ValidationException { String err = null; // -- name must be a NCName if (!ValidationUtils.isNCName(_name)) { err = "The name of an IdentityConstraint must be an NCName."; } // -- selector must exist else if (_selector == null) { err = "Selector for IdentityConstraint cannot be null."; } // -- at least 1 (one) field must exist else if (_fields.size() < 1) { err = "There must be at least one 'field' in an " + "identity constraint."; } if (err != null) throw new ValidationException(err); } // -- validate
/** * Checks the validity of this Schema defintion. * @exception ValidationException when this Schema definition * is invalid. **/ public void validate() throws ValidationException { String err = null; //-- name must be a NCName if (!ValidationUtils.isNCName(_name)) { err = "The name of an IdentityConstraint must be an NCName."; } //-- selector must exist else if (_selector == null) { err = "Selector for IdentityConstraint cannot be null."; } //-- at least 1 (one) field must exist else if (_fields.size() < 1) { err = "There must be at least one 'field' in an " + "identity constraint."; } if (err != null) throw new ValidationException(err); } //-- validate
if (!ValidationUtils.isNCName(value)) { String err = "Name '" + value + "' is not a valid NCName."; throw new ValidationException(err);
if (!ValidationUtils.isNCName(value)) { String err = "Name '" + value + "' is not a valid NCName."; throw new ValidationException(err);