This method validates all the selected and is responsible
 for calling invalid/valid events

 @return [Boolean] false if any validations fail
490994
def valid?
      result = true

      selected.each do |view|
        view.rmq_data.validations.each do |validation|

          has_events = view.rmq_data.events

          if validation.valid?(rmq(view).data)
            if has_events && view.rmq_data.events.has_event?(:valid)
              view.rmq_data.events[:valid].fire!
            end
          else
            if has_events && view.rmq_data.events.has_event?(:invalid)
              view.rmq_data.events[:invalid].fire!
            end
            result = false
          end
        end
      end
      return result
    end
462977
function validate() {

    logger.logEnter('validate');

    for (var i = 0; i < buffer.length; i++) {

      var eventData = buffer[i],
        typeName = eventData[0],
        typeKeys = eventTypes[typeName];

      if (!typeKeys) {

        emitter.emit('error', typeName + ' is not a known event type.');

        // Remove these events.
        eventCount -= eventData.length - 1;
        buffer.splice(i, 1);
        i--;

      } else {

        for (var j = 1; j < eventData.length; j++) {

          if (!validEvent(Object.keys(eventData[j]), typeKeys, emitter, typeName)) {

            // Remove this event.
            eventCount--;
            if (eventData.length === 2) {
              buffer.splice(i, 1);
              i--;
              break;
            } else {
              eventData.splice(j, 1);
              j--;
            }
          }
        }
      }
    }

    logger.logExit('validate');
  }
678865
def clear_selection
      return if @selected_indices.nil? || @selected_indices.empty?
      @selected_indices = []
      @selected_index = nil
      @old_selected_index = nil
      # Not sure what event type I should give, DELETE or a new one, user should
      #  understand that selection has been cleared, and ignore first two params
      lse = ListSelectionEvent.new(0, @list.size, self, :CLEAR)
      fire_handler :LIST_SELECTION_EVENT, lse
      @repaint_required = true
      @widget_scrolled = true # FIXME we need a better name
    end
254777
def valid?(format=@config[:local_format]||:conventional)
      if @config[:mailbox_validator].is_a?(Proc)
        @config[:mailbox_validator].call(self.mailbox, self.tag)
      elsif format.is_a?(Proc)
        format.call(self)
      elsif format == :conventional
        self.conventional?
      elsif format == :relaxed
        self.relaxed?
      elsif format == :redacted
        self.redacted?
      elsif format == :standard
        self.standard?
      elsif format == :none
        true
      else
        raise "Unknown format #{format}"
      end
    end
364619
function areSelectorsValid(selectors, token) {
	return lodash.every(selectors, function(selector) {
		if (lodash.isRegExp(token)) {
			return token.test(lodash.trim(selector));
		} else {
			return lodash.startsWith(lodash.trim(selector), token);
		}
	});
}
463270
def options=(options)
      if options
        options.each_pair do |option, value|
          Validators::Option.validate(option)
          send("#{option}=", value)
        end
      end
    end
854470
private function __validate()
    {
        $blnReturn = true;

        foreach ($this->__elements as $element) {
            if (! $element->isValid()) {
                $blnReturn = false;
                break;
            }
        }

        return $blnReturn;
    }
1282501
def validate_casted_arrays
      result = true
      array_casted_properties = self.class.properties.select { |property| property.casted && property.type.instance_of?(Array) }
      array_casted_properties.each do |property|
        casted_values = self.send(property.name)
        next unless casted_values.is_a?(Array) && casted_values.first.respond_to?(:valid?)
        casted_values.each do |value|
          result = (result && value.valid?) if value.respond_to?(:valid?)
        end
      end
      result
    end
241662
def valid?
      return false if @attribute_name.nil?
      return false if @attribute_name.to_s.length < 1
      sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
      return false unless sort_order_validator.valid?(@sort_order)
      return true
    end
93177
@SuppressWarnings("unchecked")
    private boolean isValid() {

        for (Field<?> field : m_fields) {
            if (!field.isValid()) {
                field.focus();

                return false;
            }
        }
        for (Component c : m_resources) {
            if (c instanceof CmsRemovableFormRow<?>) {
                if (!((CmsRemovableFormRow<CmsPathSelectField>)c).getInput().isValid()) {
                    ((CmsRemovableFormRow<CmsPathSelectField>)c).getInput().focus();
                    return false;
                }
            }
        }
        return true;
    }
147456
def valid?
      @errors = []
      @critical_keys.each do |k|
        any_error = public_send(k).nil?
        @errors << k if any_error
      end

      @errors.size == 0
    end
1178430
def validate_values(values)
      values.each do |key, value|
        if value.kind_of?(Hash)
          validate_values(value) # recursive call
        else
          validate_key(key, value)
        end
      end
    end
795859
def valid?
      @errors = []

      if !bank_transaction_id.nil? && bank_transaction_id !~ GUID_REGEX
        @errors << ['bank_transaction_id', 'must be blank or a valid Xero GUID']
      end

      if type && !TYPES[type]
        @errors << ['type', "must be one of #{TYPES.keys.join('/')}"]
      end

      if status && !STATUSES[status]
        @errors << ['status', "must be one of #{STATUSES.keys.join('/')}"]
      end

      unless date
        @errors << ['date', "can't be blank"]
      end

      # Make sure contact is valid.
      unless @contact && @contact.valid?
        @errors << ['contact', 'is invalid']
      end

      # Make sure all line_items are valid.
      unless line_items.all? { | line_item | line_item.valid? }
        @errors << ['line_items', "at least one line item invalid"]
      end

      @errors.size == 0
    end
1107760
def valid?
      return false if @sync.nil?
      sync_validator = EnumAttributeValidator.new('String', ["true", "false"])
      return false unless sync_validator.valid?(@sync)
      return true
    end
949079
def valid_state?(event_name)
      current_states = events_map.states_for(event_name)
      current_states.any? { |state| state == current || state == ANY_STATE }
    end
1280311
def validate_associations_many
      self.class.associations(:many).each do |name|
        values = attributes[name] || []
        values.each.with_index do |value, index|
          import_errors("#{name}[#{index}]", value)
        end
      end
    end
1289076
def validate(input)
      (check_exists(required_inputs, input) &&
        check_format(input_formats, input)) || 
      (raise Errors::InvalidInput, "Invalid input for #{self.class.name}")
    end