@WebService(serviceName="TestImpl",
targetNamespace = "http://example.org"
)
public class TestImpl implements Test{
如果我的Test类与上面类似,我的检查应验证targetNamespace值是否始终以“http://”开头
如果现有的检查无法解决,我的自定义检查应该如何?
答案 0 :(得分:0)
您可以使用Checkstyle开箱即可,方法是执行RegexpMultiline检查,如下所示:
<module name="RegexpMultiline">
<property name="format"
value="(?s)@WebService\s*\(.*?targetNamespace\s*=\s*"(?!http:\/\/).{7}"/>
<property name="message"
value="Target namespace must start with "http://""/>
</module>