Class ServiceNameHelper
java.lang.Object
com.peterphi.std.guice.restclient.resteasy.impl.ServiceNameHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getName
(GuiceConfig config, Class<?> iface, String... names) Get the name under which a given service interface is knownstatic String[]
getServiceNames
(Class<?> iface) Computes the default set of names for a service based on an interface class.
-
Constructor Details
-
ServiceNameHelper
public ServiceNameHelper()
-
-
Method Details
-
getName
Get the name under which a given service interface is known- Parameters:
config
-iface
- the service interface; if unspecified thennames
- optional (may be null or empty) set of names to try- Returns:
-
getServiceNames
Computes the default set of names for a service based on an interface class. The names produced are an ordered list:- The fully qualified class name
- If present, the
ServiceName
annotation on the class (OR if not specified on the class, theServiceName
specified on the package) - The simple name of the class (the class name without the package prefix)
- Parameters:
iface
- a JAX-RS service interface- Returns:
- An array containing one or more names that could be used for the class; may contain nulls (which should be ignored)
-