javax.ws.rs.core.UriBuilder.fromMethod()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(12.1k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中javax.ws.rs.core.UriBuilder.fromMethod()方法的一些代码示例,展示了UriBuilder.fromMethod()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UriBuilder.fromMethod()方法的具体详情如下:
包路径:javax.ws.rs.core.UriBuilder
类名称:UriBuilder
方法名:fromMethod

UriBuilder.fromMethod介绍

[英]Create a new instance representing a relative URI initialized from a javax.ws.rs.Path-annotated method. This method can only be used in cases where there is a single method with the specified name that is annotated with javax.ws.rs.Path.
[中]创建一个新实例,表示从javax初始化的相对URI。ws。路径注释法。这个方法只能在有一个指定名称的方法被javax注释的情况下使用。ws。rs.Path。

代码示例

代码示例来源:origin: org.apache.aries.spec/org.apache.aries.javax.jax.rs-api

public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: apache/meecrowave

public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jaxrs_2.0_spec

public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-jaxrs_2.1_spec

public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: org.apache.meecrowave/meecrowave-specs-api

public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: eclipse-ee4j/jersey

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: javax/javaee-web-api

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: org.jboss.resteasy/jaxrs-api

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: org.jboss.spec.javax.ws.rs/jboss-jaxrs-api_2.0_spec

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: jboss/jboss-javaee-specs

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: org.jboss.spec.javax.ws.rs/jboss-jaxrs-api_2.1_spec

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: org.glassfish.jersey.bundles/jaxrs-ri

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Convenience method to build a link from a resource. Equivalent to
 * <tt>Link.fromUriBuilder({@link UriBuilder#fromMethod(Class, String) UriBuilder.fromMethod(resource, method)})</tt>.
 * Note that the link URI passed to the {@code Link.Builder} instance returned by this
 * method is relative. Should the link be built as absolute, a {@link Link.Builder#baseUri(URI)
 * base URI} has to be specified in the builder prior to building the new link instance.
 * For example, on a server side a {@link UriInfo#getBaseUri()} may be typically used to define
 * the base URI of a link created using this method.
 *
 * @param resource the resource containing the method.
 * @param method   the name of the method whose {@link javax.ws.rs.Path} value will be used
 *                 to obtain the path to append.
 * @return the updated Link.Builder.
 * @throws IllegalArgumentException if resource or method is {@code null}, or there is more
 *                                  than or less than one variant of the method annotated with
 *                                  {@link javax.ws.rs.Path}.
 * @see UriInfo#getBaseUri()
 */
public static Builder fromMethod(Class<?> resource, String method) {
  return fromUriBuilder(UriBuilder.fromMethod(resource, method));
}

相关文章