All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.reprezen.kaizen.oasparser.val.MapValidator Maven / Gradle / Ivy

/*******************************************************************************
 *  Copyright (c) 2017 ModelSolv, Inc. and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *     ModelSolv, Inc. - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.reprezen.kaizen.oasparser.val;

import java.util.Map;

import com.reprezen.jsonoverlay.MapOverlay;
import com.reprezen.jsonoverlay.Overlay;

public class MapValidator extends ValidatorBase> {

	private Validator valueValidator;

	public MapValidator(Validator valueValidator) {
		this.valueValidator = valueValidator;
	}

	@Override
	public void runValidations() {
		MapOverlay mapOverlay = Overlay.getMapOverlay(value);
		if (valueValidator != null) {
			for (String key : mapOverlay.keySet()) {
				valueValidator.validate(Overlay.of(mapOverlay, key));
			}
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy