examples that I've foundunmarshaller
オブジェクトで検証ハンドラを設定する方法について説明します。JerseyのMoxyでValidationEventHandlerを登録するには?
しかし、Jerseyを使用すると、MOXy/JAXBが初期化され、アンマーシャラーにアクセスする方法がわかりません。
現在、このようなジャージをブートストラップしており、jersey-media-moxy
がクラスパス上にあります。このアプローチで
@ApplicationPath("rest")
public class ApplicationConfig extends ResourceConfig {
Logger logger = LoggerFactory.getLogger(ApplicationConfig.class);
public ApplicationConfig() {
// Scan classes in this package and subpackages
logger.info("Registering REST Application");
packages("rest");
register(new AbstractBinder() {
@Override
protected void configure() {
// used to automatically inject a Connection instance and close it
bindFactory(ConnectionFactory.class).to(Connection.class)
.proxy(true).proxyForSameScope(false).in(RequestScoped.class);
}
});
}
}
、どのように私はアンマーシャラーにValidationEventHandler
を登録することができますか?