Package org.kie.pmml.compiler.api.dto
Class CommonCompilationDTO<T extends org.dmg.pmml.Model>
- java.lang.Object
-
- org.kie.pmml.compiler.api.dto.CommonCompilationDTO<T>
-
- All Implemented Interfaces:
Serializable,CompilationDTO<T>
public class CommonCompilationDTO<T extends org.dmg.pmml.Model> extends Object implements CompilationDTO<T>
DTO meant to bring around all information needed for compilation, embedding/hiding helper methods- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringpackageName
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>compileAndLoadClass(Map<String,String> sourcesMap)Compile the given sources and add them to givenClassloaderof the current instance.static <T extends org.dmg.pmml.Model>
CommonCompilationDTO<T>fromGeneratedPackageNameAndFields(String packageName, org.dmg.pmml.PMML pmml, T model, org.kie.pmml.commons.model.HasClassLoader hasClassloader)Builder that create the packageName name from the given one and retrieve fields from pmml and modelstatic <T extends org.dmg.pmml.Model>
CommonCompilationDTO<T>fromPackageNameAndFields(org.dmg.pmml.PMML pmml, T model, org.kie.pmml.commons.model.HasClassLoader hasClassloader, String packageName, List<org.dmg.pmml.Field<?>> fields)Builder that preserve given packageName and fieldsCompilationDTOList<org.dmg.pmml.Field<?>>getFields()Should contain all fields retrieved from model, i.e.org.kie.pmml.commons.model.HasClassLoadergetHasClassloader()org.dmg.pmml.LocalTransformationsgetLocalTransformations()org.kie.pmml.api.enums.MINING_FUNCTIONgetMINING_FUNCTION()org.dmg.pmml.MiningFunctiongetMiningFunction()org.dmg.pmml.MiningSchemagetMiningSchema()TgetModel()StringgetModelName()Returns the model name of the underlyingModelorg.dmg.pmml.OpTypegetOpType()org.dmg.pmml.OutputgetOutput()List<org.dmg.pmml.OutputField>getOutputFields()StringgetPackageCanonicalClassName()Returns the full, canonical, sanitized class nameStringgetPackageName()The sanitized base package nameorg.dmg.pmml.PMMLgetPmml()The originalPMMLorg.kie.pmml.api.enums.PMML_MODELgetPMML_MODEL()StringgetSimpleClassName()Returns the simple, sanitized class nameorg.dmg.pmml.DataFieldgetTargetDataField()StringgetTargetFieldName()org.dmg.pmml.TargetsgetTargets()org.dmg.pmml.TransformationDictionarygetTransformationDictionary()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.kie.pmml.compiler.api.dto.CompilationDTO
getKieMiningFields, getKieOutputFields, getKieTargetFields
-
-
-
-
Field Detail
-
packageName
protected final String packageName
-
-
Method Detail
-
fromGeneratedPackageNameAndFields
public static <T extends org.dmg.pmml.Model> CommonCompilationDTO<T> fromGeneratedPackageNameAndFields(String packageName, org.dmg.pmml.PMML pmml, T model, org.kie.pmml.commons.model.HasClassLoader hasClassloader)
Builder that create the packageName name from the given one and retrieve fields from pmml and model- Parameters:
pmml-model-hasClassloader-packageName-
-
fromPackageNameAndFields
public static <T extends org.dmg.pmml.Model> CommonCompilationDTO<T> fromPackageNameAndFields(org.dmg.pmml.PMML pmml, T model, org.kie.pmml.commons.model.HasClassLoader hasClassloader, String packageName, List<org.dmg.pmml.Field<?>> fields)
Builder that preserve given packageName and fieldsCompilationDTO- Parameters:
pmml-model-hasClassloader-packageName-fields-
-
getPmml
public org.dmg.pmml.PMML getPmml()
Description copied from interface:CompilationDTOThe originalPMML- Specified by:
getPmmlin interfaceCompilationDTO<T extends org.dmg.pmml.Model>- Returns:
-
getTransformationDictionary
public org.dmg.pmml.TransformationDictionary getTransformationDictionary()
- Specified by:
getTransformationDictionaryin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getModel
public T getModel()
- Specified by:
getModelin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getMiningSchema
public org.dmg.pmml.MiningSchema getMiningSchema()
- Specified by:
getMiningSchemain interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getMiningFunction
public org.dmg.pmml.MiningFunction getMiningFunction()
- Specified by:
getMiningFunctionin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getLocalTransformations
public org.dmg.pmml.LocalTransformations getLocalTransformations()
- Specified by:
getLocalTransformationsin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getOutput
public org.dmg.pmml.Output getOutput()
- Specified by:
getOutputin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getTargets
public org.dmg.pmml.Targets getTargets()
- Specified by:
getTargetsin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getFields
public List<org.dmg.pmml.Field<?>> getFields()
Description copied from interface:CompilationDTOShould contain all fields retrieved from model, i.e. DataFields from DataDictionary, DerivedFields from Transformations/LocalTransformations, OutputFields- Specified by:
getFieldsin interfaceCompilationDTO<T extends org.dmg.pmml.Model>- Returns:
-
getTargetDataField
public org.dmg.pmml.DataField getTargetDataField()
- Specified by:
getTargetDataFieldin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getOpType
public org.dmg.pmml.OpType getOpType()
- Specified by:
getOpTypein interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getModelName
public String getModelName()
Description copied from interface:CompilationDTOReturns the model name of the underlyingModel- Specified by:
getModelNamein interfaceCompilationDTO<T extends org.dmg.pmml.Model>- Returns:
-
getTargetFieldName
public String getTargetFieldName()
- Specified by:
getTargetFieldNamein interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getPackageName
public String getPackageName()
Description copied from interface:CompilationDTOThe sanitized base package name- Specified by:
getPackageNamein interfaceCompilationDTO<T extends org.dmg.pmml.Model>- Returns:
-
getSimpleClassName
public String getSimpleClassName()
Description copied from interface:CompilationDTOReturns the simple, sanitized class name- Specified by:
getSimpleClassNamein interfaceCompilationDTO<T extends org.dmg.pmml.Model>- Returns:
-
getPackageCanonicalClassName
public String getPackageCanonicalClassName()
Description copied from interface:CompilationDTOReturns the full, canonical, sanitized class name- Specified by:
getPackageCanonicalClassNamein interfaceCompilationDTO<T extends org.dmg.pmml.Model>- Returns:
-
compileAndLoadClass
public Class<?> compileAndLoadClass(Map<String,String> sourcesMap)
Description copied from interface:CompilationDTOCompile the given sources and add them to givenClassloaderof the current instance. Returns theClasswith the current canonicalClassName- Specified by:
compileAndLoadClassin interfaceCompilationDTO<T extends org.dmg.pmml.Model>- Returns:
- See Also:
HasClassLoader.compileAndLoadClass(Map, String)
-
getHasClassloader
public org.kie.pmml.commons.model.HasClassLoader getHasClassloader()
- Specified by:
getHasClassloaderin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getPMML_MODEL
public org.kie.pmml.api.enums.PMML_MODEL getPMML_MODEL()
- Specified by:
getPMML_MODELin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getMINING_FUNCTION
public org.kie.pmml.api.enums.MINING_FUNCTION getMINING_FUNCTION()
- Specified by:
getMINING_FUNCTIONin interfaceCompilationDTO<T extends org.dmg.pmml.Model>
-
getOutputFields
public List<org.dmg.pmml.OutputField> getOutputFields()
-
-