com.sun.tools.xjc.api.XJC类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(401)

本文整理了Java中com.sun.tools.xjc.api.XJC类的一些代码示例,展示了XJC类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XJC类的具体详情如下:
包路径:com.sun.tools.xjc.api.XJC
类名称:XJC

XJC介绍

[英]Entry point to the programatic API to access schema compiler (XJC) and schema generator (schemagen).
[中]访问模式编译器(XJC)和模式生成器(schemagen)的编程API的入口点。

代码示例

代码示例来源:origin: org.alfresco/alfresco-core

SchemaCompiler compiler = XJC.createSchemaCompiler();
compiler.setErrorListener(errorListener);
compiler.parseSchema(new InputSource(url.toExternalForm()));

代码示例来源:origin: sun-jaxb/jaxb-xjc

J2SJAXBModel model = XJC.createJavaCompiler().bind(
    classesToBeIncluded,Collections.<QName,Reference>emptyMap(),null,env);

代码示例来源:origin: org.glassfish.metro/webservices-tools

protected String getJavaPackage() {
  String jaxwsPackage = null;
  JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
  if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
    jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
  }
  if (jaxwsPackage != null) {
    return jaxwsPackage;
  }
  String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
  return XJC.getDefaultPackageName(wsdlUri);
}

代码示例来源:origin: javaee/metro-jax-ws

protected String getJavaPackage() {
  String jaxwsPackage = null;
  JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
  if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
    jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
  }
  if (jaxwsPackage != null) {
    return jaxwsPackage;
  }
  String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
  return XJC.getDefaultPackageName(wsdlUri);
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

public SchemaMetadata(DynamicClassLoader dynamicClassLoader, Map<String, Object> properties, Node node, EntityResolver resolver) throws JAXBException {
  this(dynamicClassLoader, properties);
  Element element;
  if (node.getNodeType() == Node.DOCUMENT_NODE) {
    element = ((Document) node).getDocumentElement();
  } else if (node.getNodeType() == Node.ELEMENT_NODE) {
    element = (Element) node;
  } else {
    throw new JAXBException(org.eclipse.persistence.exceptions.JAXBException.cannotInitializeFromNode());
  }
  // Use XJC API to parse the schema and generate its JCodeModel
  schemaCompiler = XJC.createSchemaCompiler();
  schemaCompiler.setEntityResolver(resolver);
  schemaCompiler.setErrorListener(new XJCErrorListener());
  schemaCompiler.parseSchema(DEFAULT_SYSTEM_ID, element);
}

代码示例来源:origin: javaee/metro-jax-ws

protected String getJavaPackage() {
  String jaxwsPackage = null;
  JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
  if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
    jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
  }
  if (jaxwsPackage != null) {
    return jaxwsPackage;
  }
  String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
  return XJC.getDefaultPackageName(wsdlUri);
}

代码示例来源:origin: org.andromda.thirdparty.jaxb2_commons/jaxb-xjc

J2SJAXBModel model = XJC.createJavaCompiler().bind(
    classesToBeIncluded,Collections.<QName,Reference>emptyMap(),null,env);

代码示例来源:origin: deas/alfresco

SchemaCompiler compiler = XJC.createSchemaCompiler();
compiler.setErrorListener(errorListener);
compiler.parseSchema(new InputSource(url.toExternalForm()));

代码示例来源:origin: com.sun.xml.ws/jaxws-tools

protected String getJavaPackage() {
  String jaxwsPackage = null;
  JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
  if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
    jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
  }
  if (jaxwsPackage != null) {
    return jaxwsPackage;
  }
  String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
  return XJC.getDefaultPackageName(wsdlUri);
}

代码示例来源:origin: org.andromda.thirdparty.jaxb2_commons/jaxb-xjc

J2SJAXBModel model = XJC.createJavaCompiler().bind(decls,Collections.<QName,Reference>emptyMap(),null,env);
if(model==null)
  return; // error

代码示例来源:origin: org.codehaus.xfire/xfire-generator

schemaCompiler = XJC.createSchemaCompiler();
schemaCompiler.setErrorListener(er);

代码示例来源:origin: sun-jaxb/jaxb-xjc

J2SJAXBModel model = XJC.createJavaCompiler().bind(decls,Collections.<QName,Reference>emptyMap(),null,env);
if(model==null)
  return; // error

代码示例来源:origin: com.reprezen.genflow/rapidml-jaxrs

protected JCodeModel generateXsdDataBinding(File schemaFile, File outputDir, GenTemplateTrace xsdTraces)
    throws GenerationException {
  SchemaCompiler schemaCompliler = XJC.createSchemaCompiler();

代码示例来源:origin: apache/cxf

public void initialize(ToolContext c) throws ToolException {
  this.context = c;
  checkEncoding(c);
  SchemaCompiler schemaCompiler = XJC.createSchemaCompiler();
  Bus bus = context.get(Bus.class);
  OASISCatalogManager catalog = bus.getExtension(OASISCatalogManager.class);

代码示例来源:origin: org.apache.cxf/cxf-tools-wsdlto-databinding-jaxb

public void initialize(ToolContext c) throws ToolException {
  this.context = c;
  checkEncoding(c);
  SchemaCompiler schemaCompiler = XJC.createSchemaCompiler();
  Bus bus = context.get(Bus.class);
  OASISCatalogManager catalog = bus.getExtension(OASISCatalogManager.class);

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

public SchemaMetadata(DynamicClassLoader dynamicClassLoader, Map<String, Object> properties, Source metadataSource, EntityResolver resolver) throws JAXBException {
  this(dynamicClassLoader, properties);
  try {
    InputSource schemaInputSource = createInputSourceFromSource(metadataSource);
    if (schemaInputSource.getSystemId() == null) {
      schemaInputSource.setSystemId(DEFAULT_SYSTEM_ID);
    }
    // Use XJC API to parse the schema and generate its JCodeModel
    schemaCompiler = XJC.createSchemaCompiler();
    schemaCompiler.setEntityResolver(resolver);
    schemaCompiler.setErrorListener(new XJCErrorListener());
    if (externalBindings != null) {
      for (InputSource xjbSource : externalBindings) {
        schemaCompiler.parseSchema(xjbSource);
      }
    }
    schemaCompiler.parseSchema(schemaInputSource);
  } catch (XMLPlatformException xpe) {
    // This will occur when trying to refreshMetadata from a closed stream (non-XML Node metadata)
    if (xpe.getCause() instanceof TransformerException) {
      TransformerException te = (TransformerException) xpe.getCause();
      if (te.getCause() instanceof IOException) {
        throw org.eclipse.persistence.exceptions.JAXBException.cannotRefreshMetadata();
      }
    }
  } catch (Exception e) {
    throw new JAXBException(org.eclipse.persistence.exceptions.JAXBException.errorCreatingDynamicJAXBContext(e));
  }
}

代码示例来源:origin: org.apache.axis2/axis2-jaxbri

schemaIter.hasNext();) {
SchemaCompiler sc = XJC.createSchemaCompiler();
if (bindingFileName != null){
  if (bindingFileName.endsWith(".jar")) {

代码示例来源:origin: apache/axis2-java

SchemaCompiler sc = XJC.createSchemaCompiler();
if (bindingFileName != null){
  if (bindingFileName.endsWith(".jar")) {

代码示例来源:origin: org.objectweb.celtix/celtix-tools

@SuppressWarnings("unchecked")
private void buildJaxbModel() {
  SchemaCompiler schemaCompiler = XJC.createSchemaCompiler();
  ClassNameAllocatorImpl allocator = new ClassNameAllocatorImpl(classColletor);
    schemaCompilerGenCode = XJC.createSchemaCompiler();
    schemaCompilerGenCode.setClassNameAllocator(allocator);
    schemaCompilerGenCode.setErrorListener(this);

相关文章