简体   繁体   English

限制Apache CXF中的返回类

[英]Restrict return classes in Apache CXF

Is it possible to make sure that CXF will not release a class? 是否可以确保CXF不会发布类? I am fairly sure that my program wont at present but would want to be certain. 我相当确定我的程序目前不会,但是一定要确定。

Basically I have a User class that is used a lot around the internal server side but whenever it is released to the client side I want to only release a CleanUser class object. 基本上,我在内部服务器端使用了很多User类,但是无论何时将其发布到客户端,我都只想发布CleanUser类对象。

I am happy with a runtime error but would obviously prefer compile time! 我对运行时错误感到满意,但显然会更喜欢编译时间!

  1. Use only DTOs in WS layer. 在WS层中仅使用DTO

  2. Prefer contract first (from WSDL) development. 首选合同优先 (来自WSDL)开发。

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

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