org.dmg.pmml.PMML Maven / Gradle / Ivy
package org.dmg.pmml;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
import org.xml.sax.Locator;
/**
* Java class for anonymous complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://www.dmg.org/PMML-4_2}Header"/>
* <element ref="{http://www.dmg.org/PMML-4_2}MiningBuildTask" minOccurs="0"/>
* <element ref="{http://www.dmg.org/PMML-4_2}DataDictionary"/>
* <element ref="{http://www.dmg.org/PMML-4_2}TransformationDictionary" minOccurs="0"/>
* <sequence maxOccurs="unbounded" minOccurs="0">
* <group ref="{http://www.dmg.org/PMML-4_2}MODEL-ELEMENT"/>
* </sequence>
* <element ref="{http://www.dmg.org/PMML-4_2}Extension" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"header",
"miningBuildTask",
"dataDictionary",
"transformationDictionary",
"models",
"extensions"
})
@XmlRootElement(name = "PMML")
public class PMML
extends PMMLObject
implements Locatable, HasExtensions
{
@XmlElement(name = "Header", required = true)
protected Header header;
@XmlElement(name = "MiningBuildTask")
protected MiningBuildTask miningBuildTask;
@XmlElement(name = "DataDictionary", required = true)
protected DataDictionary dataDictionary;
@XmlElement(name = "TransformationDictionary")
protected TransformationDictionary transformationDictionary;
@XmlElements({
@XmlElement(name = "AssociationModel", type = AssociationModel.class),
@XmlElement(name = "BaselineModel", type = BaselineModel.class),
@XmlElement(name = "ClusteringModel", type = ClusteringModel.class),
@XmlElement(name = "GeneralRegressionModel", type = GeneralRegressionModel.class),
@XmlElement(name = "MiningModel", type = MiningModel.class),
@XmlElement(name = "NaiveBayesModel", type = NaiveBayesModel.class),
@XmlElement(name = "NearestNeighborModel", type = NearestNeighborModel.class),
@XmlElement(name = "NeuralNetwork", type = NeuralNetwork.class),
@XmlElement(name = "RegressionModel", type = RegressionModel.class),
@XmlElement(name = "RuleSetModel", type = RuleSetModel.class),
@XmlElement(name = "SequenceModel", type = SequenceModel.class),
@XmlElement(name = "Scorecard", type = Scorecard.class),
@XmlElement(name = "SupportVectorMachineModel", type = SupportVectorMachineModel.class),
@XmlElement(name = "TextModel", type = TextModel.class),
@XmlElement(name = "TimeSeriesModel", type = TimeSeriesModel.class),
@XmlElement(name = "TreeModel", type = TreeModel.class)
})
protected List models;
@XmlElement(name = "Extension")
protected List extensions;
@XmlAttribute(name = "version", required = true)
protected String version;
@XmlLocation
@XmlTransient
protected Locator locator;
public PMML() {
super();
}
public PMML(final Header header, final DataDictionary dataDictionary, final String version) {
super();
this.header = header;
this.dataDictionary = dataDictionary;
this.version = version;
}
/**
* Gets the value of the header property.
*
* @return
* possible object is
* {@link Header }
*
*/
public Header getHeader() {
return header;
}
/**
* Sets the value of the header property.
*
* @param value
* allowed object is
* {@link Header }
*
*/
public void setHeader(Header value) {
this.header = value;
}
/**
* Gets the value of the miningBuildTask property.
*
* @return
* possible object is
* {@link MiningBuildTask }
*
*/
public MiningBuildTask getMiningBuildTask() {
return miningBuildTask;
}
/**
* Sets the value of the miningBuildTask property.
*
* @param value
* allowed object is
* {@link MiningBuildTask }
*
*/
public void setMiningBuildTask(MiningBuildTask value) {
this.miningBuildTask = value;
}
/**
* Gets the value of the dataDictionary property.
*
* @return
* possible object is
* {@link DataDictionary }
*
*/
public DataDictionary getDataDictionary() {
return dataDictionary;
}
/**
* Sets the value of the dataDictionary property.
*
* @param value
* allowed object is
* {@link DataDictionary }
*
*/
public void setDataDictionary(DataDictionary value) {
this.dataDictionary = value;
}
/**
* Gets the value of the transformationDictionary property.
*
* @return
* possible object is
* {@link TransformationDictionary }
*
*/
public TransformationDictionary getTransformationDictionary() {
return transformationDictionary;
}
/**
* Sets the value of the transformationDictionary property.
*
* @param value
* allowed object is
* {@link TransformationDictionary }
*
*/
public void setTransformationDictionary(TransformationDictionary value) {
this.transformationDictionary = value;
}
/**
* Gets the value of the models property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the models property.
*
*
* For example, to add a new item, do as follows:
*
* getModels().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link AssociationModel }
* {@link BaselineModel }
* {@link ClusteringModel }
* {@link GeneralRegressionModel }
* {@link MiningModel }
* {@link NaiveBayesModel }
* {@link NearestNeighborModel }
* {@link NeuralNetwork }
* {@link RegressionModel }
* {@link RuleSetModel }
* {@link SequenceModel }
* {@link Scorecard }
* {@link SupportVectorMachineModel }
* {@link TextModel }
* {@link TimeSeriesModel }
* {@link TreeModel }
*
*
*/
public List getModels() {
if (models == null) {
models = new ArrayList();
}
return this.models;
}
/**
* Gets the value of the extensions property.
*
*
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a set
method for the extensions property.
*
*
* For example, to add a new item, do as follows:
*
* getExtensions().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Extension }
*
*
*/
public List getExtensions() {
if (extensions == null) {
extensions = new ArrayList();
}
return this.extensions;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
public PMML withHeader(Header value) {
setHeader(value);
return this;
}
public PMML withMiningBuildTask(MiningBuildTask value) {
setMiningBuildTask(value);
return this;
}
public PMML withDataDictionary(DataDictionary value) {
setDataDictionary(value);
return this;
}
public PMML withTransformationDictionary(TransformationDictionary value) {
setTransformationDictionary(value);
return this;
}
public PMML withModels(Model... values) {
if (values!= null) {
for (Model value: values) {
getModels().add(value);
}
}
return this;
}
public PMML withModels(Collection values) {
if (values!= null) {
getModels().addAll(values);
}
return this;
}
public PMML withExtensions(Extension... values) {
if (values!= null) {
for (Extension value: values) {
getExtensions().add(value);
}
}
return this;
}
public PMML withExtensions(Collection values) {
if (values!= null) {
getExtensions().addAll(values);
}
return this;
}
public PMML withVersion(String value) {
setVersion(value);
return this;
}
public Locator sourceLocation() {
return locator;
}
public void setSourceLocation(Locator newLocator) {
locator = newLocator;
}
@Override
public VisitorAction accept(Visitor visitor) {
VisitorAction status = visitor.visit(this);
if ((status == VisitorAction.CONTINUE)&&(this.header!= null)) {
status = this.header.accept(visitor);
}
if ((status == VisitorAction.CONTINUE)&&(this.miningBuildTask!= null)) {
status = this.miningBuildTask.accept(visitor);
}
if ((status == VisitorAction.CONTINUE)&&(this.dataDictionary!= null)) {
status = this.dataDictionary.accept(visitor);
}
if ((status == VisitorAction.CONTINUE)&&(this.transformationDictionary!= null)) {
status = this.transformationDictionary.accept(visitor);
}
for (int i = 0; (((status == VisitorAction.CONTINUE)&&(this.models!= null))&&(i