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

org.jpmml.model.MisplacedAttributeException Maven / Gradle / Ivy

There is a newer version: 1.6.6
Show newest version
/*
 * Copyright (c) 2018 Villu Ruusmann
 */
package org.jpmml.model;

import java.lang.reflect.Field;

import org.dmg.pmml.PMMLObject;

public class MisplacedAttributeException extends InvalidAttributeException {

	public MisplacedAttributeException(PMMLObject object, Enum value){
		this(object, EnumUtil.getEnumField(object, value), EnumUtil.getEnumValue(value));
	}

	public MisplacedAttributeException(PMMLObject object, Field field, Object value){
		super(formatMessage(XPathUtil.formatAttribute(field, value)), object);
	}

	static
	public String formatMessage(String xPath){
		return "Attribute with value " + xPath + " is not permitted in this location";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy