public class KnowledgeBuilderHelper extends Object
This api is experimental and thus the classes and the interfaces returned are subject to change.
Constructor and Description |
---|
KnowledgeBuilderHelper() |
Modifier and Type | Method and Description |
---|---|
static String[] |
addXsdModel(org.kie.api.io.Resource resource,
KnowledgeBuilder kbuilder,
com.sun.tools.xjc.Options xjcOpts,
String systemId)
Generates pojos for a given XSD using XJC and adds them to the specified KnowlegeBase.
|
static DroolsJaxbHelperProvider |
getDroolsJaxbHelperProvider() |
static JAXBContext |
newJAXBContext(String[] classNames,
KnowledgeBase kbase)
Creates a new JAXBContext, from which the Marshaller and Unmarshaller can be created, which are used by the Transformer
pipeline stage.
|
static JAXBContext |
newJAXBContext(String[] classNames,
Map<String,?> properties,
KnowledgeBase kbase) |
public static String[] addXsdModel(org.kie.api.io.Resource resource, KnowledgeBuilder kbuilder, com.sun.tools.xjc.Options xjcOpts, String systemId) throws IOException
Options xjcOpts = new Options(); xjcOpts.setSchemaLanguage( Language.XMLSCHEMA ); KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); String[] classNames = KnowledgeBuilderHelper.addXsdModel( ResourceFactory.newClassPathResource( "order.xsd", getClass() ), kbuilder, xjcOpts, "xsd" );
resource
- The resource to the XSD modelkbuilder
- the KnowledgeBuilder where the generated .class files will be placedxjcOpts
- XJC OptionssystemId
- XJC systemIdIOException
public static JAXBContext newJAXBContext(String[] classNames, KnowledgeBase kbase) throws JAXBException
classNames
- An array of class names that can be resolved by this JAXBContextkbase
- The KnowledgeBaseJAXBException
public static JAXBContext newJAXBContext(String[] classNames, Map<String,?> properties, KnowledgeBase kbase) throws JAXBException
JAXBException
public static DroolsJaxbHelperProvider getDroolsJaxbHelperProvider()
Copyright © 2001–2016 JBoss by Red Hat. All rights reserved.