Tests that the area is valid geojson, the style ref is valid or null and the display is non-null.
164475
public void postConstruct() {
        parseGeometry();

        Assert.isTrue(this.polygon != null, "Polygon is null. 'area' string is: '" + this.area + "'");
        Assert.isTrue(this.display != null, "'display' is null");

        Assert.isTrue(this.style == null || this.display == AoiDisplay.RENDER,
                      "'style' does not make sense unless 'display' == RENDER.  In this case 'display' == " +
                              this.display);
    }
708054
function _isValid(position, activeMaskset, c, strict) {
                    var testPos = determineTestPosition(position), loopend = c ? 1 : 0, chrs = '', buffer = activeMaskset["buffer"];
                    for (var i = activeMaskset['tests'][testPos].cardinality; i > loopend; i--) {
                        chrs += getBufferElement(buffer, testPos - (i - 1));
                    }

                    if (c) {
                        chrs += c;
                    }

                    //return is false or a json object => { pos: ??, c: ??} or true
                    return activeMaskset['tests'][testPos].fn != null ?
                        activeMaskset['tests'][testPos].fn.test(chrs, buffer, position, strict, opts)
                        : (c == getBufferElement(activeMaskset['_buffer'], position, true) || c == opts.skipOptionalPartCharacter) ?
                            { "refresh": true, c: getBufferElement(activeMaskset['_buffer'], position, true), pos: position }
                            : false;
                }
453956
public boolean isValid() {

        boolean valid = true;

        switch (shapeType) {

            case POLYLINE_MARKERS:
                valid = ((PolylineMarkers) shape).isValid();
                break;
            case POLYGON_MARKERS:
                valid = ((PolygonMarkers) shape).isValid();
                break;
            case MULTI_POLYLINE_MARKERS:
                valid = ((MultiPolylineMarkers) shape).isValid();
                break;
            case MULTI_POLYGON_MARKERS:
                valid = ((MultiPolygonMarkers) shape).isValid();
                break;
            case COLLECTION:
                @SuppressWarnings("unchecked")
                List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shape;
                for (GoogleMapShape shapeListItem : shapeList) {
                    valid = shapeListItem.isValid();
                    if (!valid) {
                        break;
                    }
                }
                break;
            default:
        }

        return valid;
    }
1180384
public void validate() {
        check("firstLine", this.firstLine);
        check("beforeEachLine", this.beforeEachLine);
        check("endLine", this.endLine);
        check("firstLineDetectionPattern", this.firstLineDetectionPattern);
        check("lastLineDetectionPattern", this.lastLineDetectionPattern);
        check("isMultiline", this.isMultiline);
        check("allowBlankLines", this.allowBlankLines);
        // skip line can be null
    }
235973
function isValidJSONPointer(pointer) {
  if (!_.isString(pointer)) {
      // If it's not a string, it obviously is not valid.
      return false;
  }

  // If it is string and is an empty string, it's valid.
  if ('' === pointer) {
      return true;
  }

  // If it is non-empty string, it must match spec defined format.
  // Check Section 3 of specification for concrete syntax.
  return validPointerRegex.test(pointer);
}
599805
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    if (pvalue == null) {
      return true;
    }
    try {
      String countryCode =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, fieldCountryCode);
      final String postalCode =
          BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, fieldPostalCode);
      if (StringUtils.isEmpty(postalCode)) {
        return true;
      }

      if (allowLowerCaseCountryCode) {
        countryCode = StringUtils.upperCase(countryCode);
      }

      final String regExCheck = POSTAL_CODE_MAP.postalCodes().get(countryCode);
      if (regExCheck == null) {
        return true;
      }
      if (postalCode.matches(regExCheck)) {
        return true;
      }
      switchContext(pcontext);
      return false;
    } catch (final Exception ignore) {
      switchContext(pcontext);
      return false;
    }
  }
667921
private void checkHover(HumanInputEvent<?> event) {
		// Check: editing state, selection (there must be 1 index selected, but not this one):
		if (service.getEditingState() == GeometryEditState.DRAGGING
				&& !service.getIndexStateService().isSelected(index)
				&& service.getIndexStateService().getSelection().size() == 1) {
			GeometryIndex selected = service.getIndexStateService().getSelection().get(0);

			// Check: is the selected index of the same type, and is it a neighbor?
			if (service.getIndexService().getType(index) == service.getIndexService().getType(selected)) {

				// see if there are enough vertices left to delete one:
				int siblingCount = service.getIndexService().getSiblingCount(service.getGeometry(), index);
				try {
					String geometryType = service.getIndexService().getGeometryType(service.getGeometry(), index);
					if (geometryType.equals(Geometry.LINE_STRING)) {
						if (siblingCount < 3) {
							return; // 2 vertices is the minimum for a LineString.
						}
					} else if (geometryType.equals(Geometry.LINEAR_RING)) {
						if (siblingCount < 5) {
							return; // 4 vertices is the minimum for a LinearRing.
						}
					} else {
						throw new IllegalStateException("Illegal type of geometry found.");
					}
				} catch (GeometryIndexNotFoundException e) {
					throw new IllegalStateException(e);
				}

				if (!allowMoreThanNeighbours &&
						!(service.getIndexService().isAdjacent(service.getGeometry(), index, selected))) {
					// only allow neighbours to remove point + hovering over a not-neighbour
					return;
				}

				// Mark the selected GeometryIndex for deletion:
				indexToDelete = selected;
				if (!service.getIndexStateService().isMarkedForDeletion(index)) {
					service.getIndexStateService().markForDeletionBegin(Collections.singletonList(index));
				}

				// Than snap the selected vertex/edge to this one:
				// if this where omitted, the selected vertex would not overlay index position.
				if (service.getIndexService().getType(index) == GeometryIndexType.TYPE_VERTEX) {
					try {
						Coordinate location = service.getIndexService().getVertex(service.getGeometry(), index);
						service.move(Collections.singletonList(selected),
								Collections.singletonList(Collections.singletonList(location)));
						event.stopPropagation();
					} catch (GeometryIndexNotFoundException e) {
						logger.log(Level.WARNING, "Index not found", e);
					} catch (GeometryOperationFailedException e) {
						logger.log(Level.WARNING, "Operation failed", e);
					}
				}
			}
		}
	}
222724
private void validate() {
        if (host.isEmpty()) {
            throw new IllegalArgumentException("host cannot be null");
        }
        if (catalog == null) {
            throw new IllegalArgumentException("namespace cannot be null");
        }
        if (table == null) {
            throw new IllegalArgumentException("set cannot be null");
        }
        if (portList.isEmpty()) {
            if(port>0){
                port(port);
            }else{
                throw new IllegalArgumentException("port cannot be null");
            }

        }
        if (host.size() != portList.size()) {
            throw new IllegalArgumentException("Host and ports cardinality must be the same");
        }

    }
973795
private void validateAttributes() {
    if (content == null) {
      throw new NullContentException("RendererBuilder needs content to create Renderer instances");
    }

    if (parent == null) {
      throw new NullParentException("RendererBuilder needs a parent to inflate Renderer instances");
    }

    if (layoutInflater == null) {
      throw new NullLayoutInflaterException(
          "RendererBuilder needs a LayoutInflater to inflate Renderer instances");
    }
  }
297938
public static boolean validateSign(Map<String,String> map,String key){
		return validateSign(map, null, key);
	}
226727
public void validate()
    {
        Dimension size = desktopPane.getSize();
        size.height -= computeDesktopIconsSpace();
        layoutInternalFrames(size);
    }
180559
function verifySpacing(node, lineOptions) {
            const actual = getPropertyWhitespace(node);

            if (actual) { // Object literal getters/setters lack colons
                report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode);
                report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode);
            }
        }
755536
public static boolean isValidJson(String s) {
		try {
			new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(s, FakeMapper.DEFAULT);
			return true;
		} catch (ParseException e) {
			return false;
		}
	}
1205882
function(el) {
    if (!el) {
      return false;
    }
    var styles = _getComputedStyle(el, null);
    if (!styles) {
      return false;
    }
    var hasCssHeight = _parseFloat(styles.height) > 0;
    var hasCssWidth = _parseFloat(styles.width) > 0;
    var hasCssTop = _parseFloat(styles.top) >= 0;
    var hasCssLeft = _parseFloat(styles.left) >= 0;
    var cssKnows = hasCssHeight && hasCssWidth && hasCssTop && hasCssLeft;
    var rect = cssKnows ? null : _getElementPosition(el);
    var isVisible = styles.display !== "none" && styles.visibility !== "collapse" && (cssKnows || !!rect && (hasCssHeight || rect.height > 0) && (hasCssWidth || rect.width > 0) && (hasCssTop || rect.top >= 0) && (hasCssLeft || rect.left >= 0));
    return isVisible;
  }
486443
function validateInputAsJson() {
  if (this.value) {
    try {
      JSON.parse(this.value);
      setValidationClasses(this, true);
    }
    catch(e) {
      setValidationClasses(this, false);
    }
  }
  else {
    setValidationClasses(this, false)
  }
}
1321708
@Override
  public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
    final String valueAsString = Objects.toString(pvalue, null);
    if (StringUtils.isEmpty(valueAsString)) {
      // empty field is ok
      return true;
    }
    if (valueAsString.length() < IBAN_LENGTH_MIN || valueAsString.length() > IBAN_LENGTH_MAX) {
      // to short or to long, but it's handled by size validator!
      return true;
    }
    final String countryCode = valueAsString.substring(0, 2);
    final IbanLengthDefinition validIbanLength = IBAN_LENGTH_MAP.ibanLengths().get(countryCode);
    if (validIbanLength == null || valueAsString.replaceAll("\\s", StringUtils.EMPTY)
        .length() != validIbanLength.getLength()) {
      // unknown country or wrong length for the country!
      return false;
    }
    if (!valueAsString.matches("^[A-Z]{2}[0-9A-Z]{2} ([0-9A-Z]{4}[ ])+[0-9A-Z]{1,4}$")) {
      // wrong format
      return false;
    }

    return CHECK_IBAN.isValid(IbanUtil.ibanCompress(valueAsString));
  }
592973
def valid?
      return false if @document_page_number.nil?
      location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
      return false unless location_measure_type_validator.valid?(@location_measure_type)
      size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
      return false unless size_measure_type_validator.valid?(@size_measure_type)
      horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
      return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
      vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
      return false unless vertical_alignment_validator.valid?(@vertical_alignment)
      margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
      return false unless margin_measure_type_validator.valid?(@margin_measure_type)
      background_color_crop_type_validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
      return false unless background_color_crop_type_validator.valid?(@background_color_crop_type)
      background_image_crop_type_validator = EnumAttributeValidator.new('String', ["None", "OuterArea", "MiddleArea", "InnerArea"])
      return false unless background_image_crop_type_validator.valid?(@background_image_crop_type)
      return true
    end