简体   繁体   English

在Eclipse中组织导入

[英]Organize import in Eclipse

Making my first WSDL project from scratch, I've faced some discomfort using Eclipse. 从头开始制作我的第一个WSDL项目,使用Eclipse时遇到了一些不适。 After generating Java beans skeleton, Eclipse placed paths to Java classes in generated files: 生成Java bean骨架后,Eclipse在生成的文件中放置了Java类的路径:

package com.examples.www.wsdl.HelloService_wsdl;

public class HelloWorld_BindingImpl implements com.examples.www.wsdl.HelloService_wsdl.HelloWorld_PortType{
    public java.lang.String sayHello(java.lang.String firstName) throws java.rmi.RemoteException {
        return null;
    }

}

Does Eclipse have any methods to place all of this big classpath staff to imports? Eclipse是否有任何方法可以将所有这些大的类路径人员放置到导入中?

No. See some alternatives here . 否。请在此处查看一些替代方案 Note that these are called fully qualified names, not static imports. 请注意,这些被称为完全限定名称,而不是静态导入。

A WSDL class generator typically generates Java source code over and over again especially when changes are made to WSDL or XSD files. WSDL类生成器通常会一遍又一遍地生成Java源代码,尤其是在对WSDLXSD文件进行更改时。 For this reason it is better to avoid constantly refactoring the output files. 因此,最好避免不断重构输出文件。

One option that is typically used is to subclass the implementation output file, HelloWorld_BindingImpl in this case. 通常使用的一个选项是对实现输出文件(在这种情况下为HelloWorld_BindingImpl )进行子类化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM