@Retention(value=RUNTIME) @Target(value=ANNOTATION_TYPE) public @interface NamedServiceDefinition
@URLStreamHandlerRegistration annotation uses the
The above instructs the annotation processor that handles
NamedServiceDefinitions to verify the annotated type is subclass of
URLStreamHandlerand if so, register it into
URLStreamHandler/@protocolwhere the value of
@protocol()is replaced by the value of annotation's protocol attribute. The registration can later be found by using
Lookups.forPath("URLStreamHandler/ftp")(in case the protocol was ftp).
|Modifier and Type||Required Element and Description|
Path to register the annotation to, so it can later be found by using
Type, or array of types that the registered type has to implement.
public abstract Class<?> serviceType
public abstract String path
Lookups.forPath(theSamePath). The path may reference attributes of the annotated annotation by prefixing them with
@. To reuse attribute named
locationone can for example use
"how/to/get/to/@location()s/please"These attributes must be of type
Stringor array of
Strings (then one registration is performed per each string in the array).
public abstract String position
int position()attribute in the defined annotation and use it to specify the order of registrations. In case a different attribute should be used to specify the position, one can be provide its name by specifying non-default here. Should the position be ignored, specify empty string.
name- of attribute in the annotated annotation to use for defining position of the registration. The attribute should return int value.
Built on April 20 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.