解決策は、GWTプロジェクトにjavax.ws.rs.coreパッケージを作成し、自分用のインターフェースを含めることです。これらのインターフェイスはMultivaluedMapです。
package javax.ws.rs.core;
import java.util.List;
import java.util.Map;
/**
* A map of key-values pairs. Each key can have zero or more values.
*
*/
public interface MultivaluedMap<K, V> extends Map<K, List<V>> {
/**
* Set the key's value to be a one item list consisting of the supplied value.
* Any existing values will be replaced.
*
* @param key the key
* @param value the single value of the key
*/
void putSingle(K key, V value);
/**
* Add a value to the current list of values for the supplied key.
* @param key the key
* @param value the value to be added.
*/
void add(K key, V value);
/**
* A shortcut to get the first value of the supplied key.
* @param key the key
* @return the first value for the specified key or null if the key is
* not in the map.
*/
V getFirst(K key);
}
PathSegment:
package javax.ws.rs.core;
/**
* Represents a URI path segment and any associated matrix parameters. When an
* instance of this type is injected with {@link javax.ws.rs.PathParam}, the
* value of the annotation identifies which path segment is selected and the
* presence of an {@link javax.ws.rs.Encoded} annotation will result in an
* instance that supplies the path and matrix parameter values in
* URI encoded form.
*
* @see UriInfo#getPathSegments
* @see javax.ws.rs.PathParam
*/
public interface PathSegment
{
/**
* Get the path segment.
* <p/>
*
* @return the path segment
*/
String getPath();
/**
* Get a map of the matrix parameters associated with the path segment.
* The map keys are the names of the matrix parameters with any
* percent-escaped octets decoded.
*
* @return the map of matrix parameters
* @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
*/
MultivaluedMap<String, String> getMatrixParameters();
}
GWTモジュールファイル(javax.ws.rsパッケージ内)が必要です。
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd">
<module rename-to="App">
<source path="core"/>
</module>
そして、アプリケーションGWTモジュールに継承参照を追加する必要があります。
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd">
<module rename-to="App">
<inherits name='com.google.gwt.user.User'/>
<inherits name="org.jboss.errai.common.ErraiCommon"/>
<inherits name="org.jboss.errai.ioc.Container"/>
<inherits name="org.jboss.errai.enterprise.Jaxrs"/>
<inherits name="com.redhat.topicindex.rest"/>
<inherits name="javax.ws.rs.core"/>
</module>