policyFactory = new DefaultPolicyFactory();
modelFactories.addFactory(policyFactory);
staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories);
staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
modelFactories.addFactory(javaImplementationFactory);
staxProcessors.addArtifactProcessor(new CompositeProcessor(null, factory, policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor));