com.sun.tools.internal.ws.wscompile.WsimportOptions Java Examples

The following examples show how to use com.sun.tools.internal.ws.wscompile.WsimportOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SeiGenerator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void init(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions) {
    init(model, options, receiver);
    extensionHandlers = new ArrayList<TJavaGeneratorExtension>();

    // register handlers for default extensions

    // 2.2 Spec requires generation of @Action when wsam:Action is explicitly stated in wsdl
    if (options.target.isLaterThan(Options.Target.V2_2)) {
       register(new W3CAddressingJavaGeneratorExtension());
    }

    for (TJavaGeneratorExtension j : extensions) {
        register(j);
    }

    this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[extensionHandlers.size()]));
}
 
Example #2
Source File: SeiGenerator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void init(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions) {
    init(model, options, receiver);
    extensionHandlers = new ArrayList<TJavaGeneratorExtension>();

    // register handlers for default extensions

    // 2.2 Spec requires generation of @Action when wsam:Action is explicitly stated in wsdl
    if (options.target.isLaterThan(Options.Target.V2_2)) {
       register(new W3CAddressingJavaGeneratorExtension());
    }

    for (TJavaGeneratorExtension j : extensions) {
        register(j);
    }

    this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[extensionHandlers.size()]));
}
 
Example #3
Source File: DOMForest.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public DOMForest(InternalizationLogic logic, @NotNull EntityResolver entityResolver, WsimportOptions options, ErrorReceiver errReceiver) {
    this.options = options;
    this.entityResolver = entityResolver;
    this.errorReceiver = errReceiver;
    this.logic = logic;
    try {
        // secure xml processing can be switched off if input requires it
        boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity;
        DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled);
        dbf.setNamespaceAware(true);
        this.documentBuilder = dbf.newDocumentBuilder();

        this.parserFactory = XmlUtil.newSAXParserFactory(secureProcessingEnabled);
        this.parserFactory.setNamespaceAware(true);
    } catch (ParserConfigurationException e) {
        throw new AssertionError(e);
    }
}
 
Example #4
Source File: SeiGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void init(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions) {
    init(model, options, receiver);
    extensionHandlers = new ArrayList<TJavaGeneratorExtension>();

    // register handlers for default extensions

    // 2.2 Spec requires generation of @Action when wsam:Action is explicitly stated in wsdl
    if (options.target.isLaterThan(Options.Target.V2_2)) {
       register(new W3CAddressingJavaGeneratorExtension());
    }

    for (TJavaGeneratorExtension j : extensions) {
        register(j);
    }

    this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[extensionHandlers.size()]));
}
 
Example #5
Source File: DOMForest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public DOMForest(InternalizationLogic logic, @NotNull EntityResolver entityResolver, WsimportOptions options, ErrorReceiver errReceiver) {
    this.options = options;
    this.entityResolver = entityResolver;
    this.errorReceiver = errReceiver;
    this.logic = logic;
    try {
        // secure xml processing can be switched off if input requires it
        boolean secureProcessingEnabled = options == null || !options.disableXmlSecurity;
        DocumentBuilderFactory dbf = XmlUtil.newDocumentBuilderFactory(secureProcessingEnabled);
        dbf.setNamespaceAware(true);
        this.documentBuilder = dbf.newDocumentBuilder();

        this.parserFactory = XmlUtil.newSAXParserFactory(secureProcessingEnabled);
        this.parserFactory.setNamespaceAware(true);
    } catch (ParserConfigurationException e) {
        throw new AssertionError(e);
    }
}
 
Example #6
Source File: SeiGenerator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void init(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions) {
    init(model, options, receiver);
    extensionHandlers = new ArrayList<TJavaGeneratorExtension>();

    // register handlers for default extensions

    // 2.2 Spec requires generation of @Action when wsam:Action is explicitly stated in wsdl
    if (options.target.isLaterThan(Options.Target.V2_2)) {
       register(new W3CAddressingJavaGeneratorExtension());
    }

    for (TJavaGeneratorExtension j : extensions) {
        register(j);
    }

    this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[extensionHandlers.size()]));
}
 
Example #7
Source File: JAXBModelBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBModelBuilder(WsimportOptions options, ClassNameCollector classNameCollector, MetadataFinder finder, ErrorReceiver errReceiver) {
    this._classNameAllocator = new ClassNameAllocatorImpl(classNameCollector);
    this.errReceiver = errReceiver;
    this.options = options;
    this.forest = finder;

    internalBuildJAXBModel();
}
 
Example #8
Source File: WSDLParser.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public WSDLParser(WsimportOptions options, ErrorReceiverFilter errReceiver, MetadataFinder forest) {
    this.extensionHandlers = new HashMap();
    this.options = options;
    this.errReceiver = errReceiver;
    if (forest == null) {
        forest = new MetadataFinder(new WSDLInternalizationLogic(), options, errReceiver);
        forest.parseWSDL();
        if (forest.isMexMetadata) {
            errReceiver.reset();
    }
    }
    this.forest = forest;
    // register handlers for default extensions
    register(new SOAPExtensionHandler(extensionHandlers));
    register(new HTTPExtensionHandler(extensionHandlers));
    register(new MIMEExtensionHandler(extensionHandlers));
    register(new JAXWSBindingExtensionHandler(extensionHandlers));
    register(new SOAP12ExtensionHandler(extensionHandlers));

    // MemberSubmission Addressing not supported by WsImport anymore see JAX_WS-1040 for details
    //register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver, options.isExtensionMode()));

    register(new W3CAddressingExtensionHandler(extensionHandlers, errReceiver));
    register(new W3CAddressingMetadataExtensionHandler(extensionHandlers, errReceiver));
    register(new Policy12ExtensionHandler());
    register(new Policy15ExtensionHandler());
    for (TWSDLExtensionHandler te : ServiceFinder.find(TWSDLExtensionHandler.class)) {
        register(te);
    }

}
 
Example #9
Source File: WSDLParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public WSDLParser(WsimportOptions options, ErrorReceiverFilter errReceiver, MetadataFinder forest) {
    this.extensionHandlers = new HashMap();
    this.options = options;
    this.errReceiver = errReceiver;
    if (forest == null) {
        forest = new MetadataFinder(new WSDLInternalizationLogic(), options, errReceiver);
        forest.parseWSDL();
        if (forest.isMexMetadata) {
            errReceiver.reset();
    }
    }
    this.forest = forest;
    // register handlers for default extensions
    register(new SOAPExtensionHandler(extensionHandlers));
    register(new HTTPExtensionHandler(extensionHandlers));
    register(new MIMEExtensionHandler(extensionHandlers));
    register(new JAXWSBindingExtensionHandler(extensionHandlers));
    register(new SOAP12ExtensionHandler(extensionHandlers));

    // MemberSubmission Addressing not supported by WsImport anymore see JAX_WS-1040 for details
    //register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver, options.isExtensionMode()));

    register(new W3CAddressingExtensionHandler(extensionHandlers, errReceiver));
    register(new W3CAddressingMetadataExtensionHandler(extensionHandlers, errReceiver));
    register(new Policy12ExtensionHandler());
    register(new Policy15ExtensionHandler());
    for (TWSDLExtensionHandler te : ServiceFinder.find(TWSDLExtensionHandler.class)) {
        register(te);
    }

}
 
Example #10
Source File: CustomExceptionGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void generate(Model model,
    WsimportOptions options,
    ErrorReceiver receiver){
    CustomExceptionGenerator exceptionGen = new CustomExceptionGenerator();
    exceptionGen.init(model, options, receiver);
    exceptionGen.doGeneration();
}
 
Example #11
Source File: PluginImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean run(Model model, WsimportOptions wo, ErrorReceiver er) throws SAXException {
    JCodeModel cm = wo.getCodeModel();
    // we want this to work without requiring JSR-250 jar.
    annotation = cm.ref("javax.annotation.Generated");

    for (Iterator<JPackage> i = cm.packages(); i.hasNext();) {
        for (Iterator<JDefinedClass> j = i.next().classes(); j.hasNext();) {
            annotate(j.next());
        }
    }

    return true;
}
 
Example #12
Source File: JAXBModelBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public JAXBModelBuilder(WsimportOptions options, ClassNameCollector classNameCollector, MetadataFinder finder, ErrorReceiver errReceiver) {
    this._classNameAllocator = new ClassNameAllocatorImpl(classNameCollector);
    this.errReceiver = errReceiver;
    this.options = options;
    this.forest = finder;

    internalBuildJAXBModel();
}
 
Example #13
Source File: PluginImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean run(Model model, WsimportOptions wo, ErrorReceiver er) throws SAXException {
    JCodeModel cm = wo.getCodeModel();
    // we want this to work without requiring JSR-250 jar.
    annotation = cm.ref("javax.annotation.Generated");

    for (Iterator<JPackage> i = cm.packages(); i.hasNext();) {
        for (Iterator<JDefinedClass> j = i.next().classes(); j.hasNext();) {
            annotate(j.next());
        }
    }

    return true;
}
 
Example #14
Source File: JAXBModelBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public JAXBModelBuilder(WsimportOptions options, ClassNameCollector classNameCollector, MetadataFinder finder, ErrorReceiver errReceiver) {
    this._classNameAllocator = new ClassNameAllocatorImpl(classNameCollector);
    this.errReceiver = errReceiver;
    this.options = options;
    this.forest = finder;

    internalBuildJAXBModel();
}
 
Example #15
Source File: JwsImplGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static File findFile(WsimportOptions options, String qualifiedFileName)
    throws java.io.IOException {
        String baseDir = options.sourceDir.getCanonicalPath();
        String fp = null;
        for (File f : options.getGeneratedFiles()) {
                fp = getQualifiedFileName(baseDir, f);
                if (qualifiedFileName.equals(fp))
                        return f;
        }

        return null;
}
 
Example #16
Source File: PluginImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean run(Model model, WsimportOptions wo, ErrorReceiver er) throws SAXException {
    JCodeModel cm = wo.getCodeModel();
    // we want this to work without requiring JSR-250 jar.
    annotation = cm.ref("javax.annotation.Generated");

    for (Iterator<JPackage> i = cm.packages(); i.hasNext();) {
        for (Iterator<JDefinedClass> j = i.next().classes(); j.hasNext();) {
            annotate(j.next());
        }
    }

    return true;
}
 
Example #17
Source File: CustomExceptionGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void generate(Model model,
    WsimportOptions options,
    ErrorReceiver receiver){
    CustomExceptionGenerator exceptionGen = new CustomExceptionGenerator();
    exceptionGen.init(model, options, receiver);
    exceptionGen.doGeneration();
}
 
Example #18
Source File: CustomExceptionGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void generate(Model model,
    WsimportOptions options,
    ErrorReceiver receiver){
    CustomExceptionGenerator exceptionGen = new CustomExceptionGenerator();
    exceptionGen.init(model, options, receiver);
    exceptionGen.doGeneration();
}
 
Example #19
Source File: GeneratorBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void writeHandlerConfig(String className, JDefinedClass cls, WsimportOptions options) {
    Element e = options.getHandlerChainConfiguration();
    if (e == null) {
        return;
    }
    JAnnotationUse handlerChainAnn = cls.annotate(cm.ref(HandlerChain.class));
    NodeList nl = e.getElementsByTagNameNS(
        "http://java.sun.com/xml/ns/javaee", "handler-chain");
    if(nl.getLength() > 0){
        String fName = getHandlerConfigFileName(className);
        handlerChainAnn.param("file", fName);
        generateHandlerChainFile(e, className);
    }
}
 
Example #20
Source File: WSDLParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public WSDLParser(WsimportOptions options, ErrorReceiverFilter errReceiver, MetadataFinder forest) {
    this.extensionHandlers = new HashMap();
    this.options = options;
    this.errReceiver = errReceiver;
    if (forest == null) {
        forest = new MetadataFinder(new WSDLInternalizationLogic(), options, errReceiver);
        forest.parseWSDL();
        if (forest.isMexMetadata) {
            errReceiver.reset();
    }
    }
    this.forest = forest;
    // register handlers for default extensions
    register(new SOAPExtensionHandler(extensionHandlers));
    register(new HTTPExtensionHandler(extensionHandlers));
    register(new MIMEExtensionHandler(extensionHandlers));
    register(new JAXWSBindingExtensionHandler(extensionHandlers));
    register(new SOAP12ExtensionHandler(extensionHandlers));

    // MemberSubmission Addressing not supported by WsImport anymore see JAX_WS-1040 for details
    //register(new MemberSubmissionAddressingExtensionHandler(extensionHandlers, errReceiver, options.isExtensionMode()));

    register(new W3CAddressingExtensionHandler(extensionHandlers, errReceiver));
    register(new W3CAddressingMetadataExtensionHandler(extensionHandlers, errReceiver));
    register(new Policy12ExtensionHandler());
    register(new Policy15ExtensionHandler());
    for (TWSDLExtensionHandler te : ServiceFinder.find(TWSDLExtensionHandler.class)) {
        register(te);
    }

}
 
Example #21
Source File: PluginImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean run(Model model, WsimportOptions wo, ErrorReceiver er) throws SAXException {
    JCodeModel cm = wo.getCodeModel();
    // we want this to work without requiring JSR-250 jar.
    annotation = cm.ref("javax.annotation.Generated");

    for (Iterator<JPackage> i = cm.packages(); i.hasNext();) {
        for (Iterator<JDefinedClass> j = i.next().classes(); j.hasNext();) {
            annotate(j.next());
        }
    }

    return true;
}
 
Example #22
Source File: GeneratorBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void init(Model model, WsimportOptions options, ErrorReceiver receiver){
    this.model = model;
    this.options = options;
    this.destDir = options.destDir;
    this.receiver = receiver;
    this.wsdlLocation = options.wsdlLocation;
    this.targetVersion = options.target.getVersion();
    this.cm = options.getCodeModel();
}
 
Example #23
Source File: CustomExceptionGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void generate(Model model,
    WsimportOptions options,
    ErrorReceiver receiver){
    CustomExceptionGenerator exceptionGen = new CustomExceptionGenerator();
    exceptionGen.init(model, options, receiver);
    exceptionGen.doGeneration();
}
 
Example #24
Source File: GeneratorBase.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void init(Model model, WsimportOptions options, ErrorReceiver receiver){
    this.model = model;
    this.options = options;
    this.destDir = options.destDir;
    this.receiver = receiver;
    this.wsdlLocation = options.wsdlLocation;
    this.targetVersion = options.target.getVersion();
    this.cm = options.getCodeModel();
}
 
Example #25
Source File: JwsImplGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static File findFile(WsimportOptions options, String qualifiedFileName)
    throws java.io.IOException {
        String baseDir = options.sourceDir.getCanonicalPath();
        String fp = null;
        for (File f : options.getGeneratedFiles()) {
                fp = getQualifiedFileName(baseDir, f);
                if (qualifiedFileName.equals(fp))
                        return f;
        }

        return null;
}
 
Example #26
Source File: JwsImplGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static List<String> generate(Model model, WsimportOptions options,
    ErrorReceiver receiver) {
        // options check

        // Generate it according the implDestDir option
        if (options.implDestDir == null)
                return null;

        JwsImplGenerator jwsImplGenerator = new JwsImplGenerator();
        jwsImplGenerator.init(model, options, receiver);
        jwsImplGenerator.doGeneration();
        // print a warning message while implFiles.size() is zero
        if (jwsImplGenerator.implFiles.isEmpty()) {
                StringBuilder msg = new StringBuilder();
                if (options.implServiceName != null)
                        msg.append("serviceName=[").append(options.implServiceName).append("] ");
                if (options.implPortName != null)
                        msg.append("portName=[").append(options.implPortName).append("] ");

                if (msg.length() > 0)
                        msg.append(", Not found in wsdl file.\n");

                msg.append("No impl files generated!");
                receiver.warning(null, msg.toString());
        }

        return jwsImplGenerator.implFiles;
}
 
Example #27
Source File: GeneratorBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void writeHandlerConfig(String className, JDefinedClass cls, WsimportOptions options) {
    Element e = options.getHandlerChainConfiguration();
    if (e == null) {
        return;
    }
    JAnnotationUse handlerChainAnn = cls.annotate(cm.ref(HandlerChain.class));
    NodeList nl = e.getElementsByTagNameNS(
        "http://java.sun.com/xml/ns/javaee", "handler-chain");
    if(nl.getLength() > 0){
        String fName = getHandlerConfigFileName(className);
        handlerChainAnn.param("file", fName);
        generateHandlerChainFile(e, className);
    }
}
 
Example #28
Source File: JwsImplGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static File findFile(WsimportOptions options, String qualifiedFileName)
    throws java.io.IOException {
        String baseDir = options.sourceDir.getCanonicalPath();
        String fp = null;
        for (File f : options.getGeneratedFiles()) {
                fp = getQualifiedFileName(baseDir, f);
                if (qualifiedFileName.equals(fp))
                        return f;
        }

        return null;
}
 
Example #29
Source File: JAXBModelBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public JAXBModelBuilder(WsimportOptions options, ClassNameCollector classNameCollector, MetadataFinder finder, ErrorReceiver errReceiver) {
    this._classNameAllocator = new ClassNameAllocatorImpl(classNameCollector);
    this.errReceiver = errReceiver;
    this.options = options;
    this.forest = finder;

    internalBuildJAXBModel();
}
 
Example #30
Source File: PluginImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean run(Model model, WsimportOptions wo, ErrorReceiver er) throws SAXException {
    JCodeModel cm = wo.getCodeModel();
    // we want this to work without requiring JSR-250 jar.
    annotation = cm.ref("javax.annotation.Generated");

    for (Iterator<JPackage> i = cm.packages(); i.hasNext();) {
        for (Iterator<JDefinedClass> j = i.next().classes(); j.hasNext();) {
            annotate(j.next());
        }
    }

    return true;
}