本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}