public final class ValueDescriptor
extends java.lang.Object
| Constructor and Description |
|---|
ValueDescriptor(java.lang.Class<?> type,
java.lang.String name)
Constructs a value descriptor, useful for dynamically creating event types and
annotations.
|
ValueDescriptor(java.lang.Class<?> type,
java.lang.String name,
java.util.List<AnnotationElement> annotations)
Constructs a value descriptor, useful for dynamically creating event types and
annotations.
|
| Modifier and Type | Method and Description |
|---|---|
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> annotationType)
Returns the first annotation for the specified type if an annotation
element with the same name is directly present for this value descriptor,
null otherwise. |
java.util.List<AnnotationElement> |
getAnnotationElements()
Returns an immutable list of annotation elements for this value
descriptor.
|
java.lang.String |
getContentType()
Returns a textual identifier that specifies how a value represented by
this
ValueDescriptor is interpreted or formatted. |
java.lang.String |
getDescription()
Returns a sentence describing the value (for example, {@code "Maximum
throughput in the transaction system.
|
java.util.List<ValueDescriptor> |
getFields()
Returns an immutable list of value descriptors if the type is complex,
else an empty list.
|
java.lang.String |
getLabel()
Returns a human-readable name that describes the value (for example,
"Maximum Throughput"). |
java.lang.String |
getName()
Returns the name of the value (for example,
"maxThroughput"). |
long |
getTypeId()
Returns a unique ID for the type in the Java virtual Machine (JVM).
|
java.lang.String |
getTypeName()
Returns the fully qualified class name of the type that is associated with
this value descriptor.
|
boolean |
isArray()
Returns if this value descriptor is an array type.
|
public ValueDescriptor(java.lang.Class<?> type,
java.lang.String name)
Constructs a value descriptor, useful for dynamically creating event types and annotations.
The following types are supported:
byte.class
short.class
int.class
long.class
char.class
float.class
double.class
boolean.class
String.class
Class.class
Thread.class
The name must be a valid Java identifier (for example, "maxThroughput"). See 3.8
Java Language Specification for more information.
type - the type, not nullname - the name, not nulljava.lang.SecurityException - if a security manager is present and the caller
doesn't have FlightRecorderPermission("registerEvent")public ValueDescriptor(java.lang.Class<?> type,
java.lang.String name,
java.util.List<AnnotationElement> annotations)
Constructs a value descriptor, useful for dynamically creating event types and annotations.
The following types are supported:
byte.class
short.class
int.class
long.class
char.class
float.class
double.class
boolean.class
String.class
Class.class
Thread.class
The name must be a valid Java identifier (for example, "maxThroughput"). See 3.8
Java Language Specification for more information.
type - the type, not nullname - the name, not nullannotations - the annotations on the value descriptors, not
nulljava.lang.SecurityException - if a security manager is present and the caller
doesn't have FlightRecorderPermission("registerEvent")public java.lang.String getLabel()
"Maximum Throughput").null if doesn't existpublic java.lang.String getName()
"maxThroughput").nullpublic java.lang.String getDescription()
"Maximum
throughput in the transaction system. Value is reset after each new
batch.").null if doesn't existpublic java.lang.String getContentType()
ValueDescriptor is interpreted or formatted.
For example, if the value descriptor's type is float and the
event value is 0.5f, a content type of
"jdk.jfr.Percentage" hints to a client that the value is a
percentage and that it should be rendered as "50%".
The JDK provides the following predefined content types:
User-defined content types can be created by using the ContentType class.
null if doesn't existContentTypepublic java.lang.String getTypeName()
nullgetTypeId()public long getTypeId()
public boolean isArray()
true if it is an array type, false otherwisepublic <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
null otherwise.A - the type of the annotation to query for and return if presentannotationType - the Class object that corresponds to the annotation
type, not nullnullpublic java.util.List<AnnotationElement> getAnnotationElements()
nullpublic java.util.List<ValueDescriptor> getFields()
null