本文整理汇总了Java中org.jpmml.model.visitors.LocatorTransformer类的典型用法代码示例。如果您正苦于以下问题:Java LocatorTransformer类的具体用法?Java LocatorTransformer怎么用?Java LocatorTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LocatorTransformer类属于org.jpmml.model.visitors包,在下文中一共展示了LocatorTransformer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: mixedContent
import org.jpmml.model.visitors.LocatorTransformer; //导入依赖的package包/类
@Test
public void mixedContent() throws Exception {
PMML pmml = ResourceUtil.unmarshal(getClass());
List<?> content = ExtensionUtil.getContent(pmml);
assertEquals(5, content.size());
assertEquals("First text value", content.get(0));
assertEquals(Arrays.asList("First extension"), getDeepContent(content.get(1)));
assertEquals("Second text value", content.get(2));
assertEquals(Arrays.asList("Second extension"), getDeepContent(content.get(3)));
assertEquals("Third text value", content.get(4));
try {
SerializationUtil.clone(pmml);
fail();
} catch(NotSerializableException nse){
// Ignored
}
pmml.accept(new LocatorTransformer());
SerializationUtil.clone(pmml);
}
开发者ID:jpmml,项目名称:jpmml-model,代码行数:27,代码来源:MixedContentTest.java
示例2: transformAndClone
import org.jpmml.model.visitors.LocatorTransformer; //导入依赖的package包/类
@Test
public void transformAndClone() throws Exception {
PMML pmml = ResourceUtil.unmarshal(Version.PMML_4_3);
assertNotNull(pmml.getLocator());
try {
SerializationUtil.clone(pmml);
fail();
} catch(NotSerializableException nse){
// Ignored
}
pmml.accept(new LocatorTransformer());
assertNotNull(pmml.getLocator());
SerializationUtil.clone(pmml);
}
开发者ID:jpmml,项目名称:jpmml-model,代码行数:21,代码来源:SerializationTest.java
示例3: createEvaluator
import org.jpmml.model.visitors.LocatorTransformer; //导入依赖的package包/类
static
public Evaluator createEvaluator(InputStream is) throws SAXException, JAXBException {
Source source = ImportFilter.apply(new InputSource(is));
PMML pmml = JAXBUtil.unmarshalPMML(source);
// If the SAX Locator information is available, then transform it to java.io.Serializable representation
LocatorTransformer locatorTransformer = new LocatorTransformer();
locatorTransformer.applyTo(pmml);
ModelEvaluatorFactory modelEvaluatorFactory = ModelEvaluatorFactory.newInstance();
ModelEvaluator<?> modelEvaluator = modelEvaluatorFactory.newModelManager(pmml);
modelEvaluator.verify();
return modelEvaluator;
}
开发者ID:jpmml,项目名称:jpmml-cascading,代码行数:18,代码来源:PMMLPlannerUtil.java
示例4: execute
import org.jpmml.model.visitors.LocatorTransformer; //导入依赖的package包/类
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
List<Class<? extends Visitor>> visitorClazzes = new ArrayList<>();
boolean keepLocator = getKeepLocator();
visitorClazzes.add(keepLocator ? LocatorTransformer.class : LocatorNullifier.class);
List<String> visitorClasses = getVisitorClasses();
if(visitorClasses != null){
try {
for(String visitorClass : visitorClasses){
Class<?> clazz = Class.forName(visitorClass);
visitorClazzes.add(clazz.asSubclass(Visitor.class));
}
} catch(ClassNotFoundException | ClassCastException e){
throw new MojoFailureException("Invalid visitorClasses parameter", e);
}
}
List<ModelSet> modelSets = getModelSets();
if(modelSets == null || modelSets.isEmpty()){
throw new MojoFailureException("Missing modelSets parameter");
}
for(ModelSet modelSet : modelSets){
transform(modelSet, visitorClazzes);
}
}
开发者ID:jpmml,项目名称:jpmml-model,代码行数:33,代码来源:SerMojo.java
示例5: getPMML
import org.jpmml.model.visitors.LocatorTransformer; //导入依赖的package包/类
@Override
public PMML getPMML() throws Exception {
PMML pmml = super.getPMML();
LocatorTransformer locatorTransformer = new LocatorTransformer();
locatorTransformer.applyTo(pmml);
return pmml;
}
开发者ID:jpmml,项目名称:jpmml-evaluator,代码行数:10,代码来源:IntegrationTestBatch.java
示例6: createEvaluator
import org.jpmml.model.visitors.LocatorTransformer; //导入依赖的package包/类
static
public Evaluator createEvaluator(InputStream is) throws SAXException, JAXBException {
Source source = ImportFilter.apply(new InputSource(is));
PMML pmml = JAXBUtil.unmarshalPMML(source);
// If the SAX Locator information is available, then transform it to java.io.Serializable representation
LocatorTransformer locatorTransformer = new LocatorTransformer();
locatorTransformer.applyTo(pmml);
ModelEvaluatorFactory modelEvaluatorFactory = ModelEvaluatorFactory.newInstance();
Evaluator evaluator = modelEvaluatorFactory.newModelEvaluator(pmml);
// Perform self-testing
evaluator.verify();
return evaluator;
}
开发者ID:jeremyore,项目名称:spark-pmml-import,代码行数:20,代码来源:EvaluatorUtil.java
示例7: createEvaluator
import org.jpmml.model.visitors.LocatorTransformer; //导入依赖的package包/类
static
public Evaluator createEvaluator(InputStream is) throws SAXException, JAXBException {
Source source = ImportFilter.apply(new InputSource(is));
PMML pmml = JAXBUtil.unmarshalPMML(source);
// If the SAX Locator information is available, then transform it to java.io.Serializable representation
LocatorTransformer locatorTransformer = new LocatorTransformer();
pmml.accept(locatorTransformer);
ModelEvaluatorFactory modelEvaluatorFactory = ModelEvaluatorFactory.newInstance();
ModelEvaluator<?> modelEvaluator = modelEvaluatorFactory.newModelManager(pmml);
return modelEvaluator;
}
开发者ID:jpmml,项目名称:jpmml-storm,代码行数:17,代码来源:PMMLBoltUtil.java
注:本文中的org.jpmml.model.visitors.LocatorTransformer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论