src/jdk.jfr/share/classes/jdk/jfr/SettingDescriptor.java
author egahlin
Tue, 15 May 2018 20:24:34 +0200
changeset 50113 caf115bb98ad
permissions -rw-r--r--
8199712: Flight Recorder Reviewed-by: coleenp, ihse, erikj, dsamersoff, mseledtsov, egahlin, mgronlun Contributed-by: erik.gahlin@oracle.com, markus.gronlund@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     1
/*
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     2
 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     4
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    10
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    15
 * accompanied this code).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    16
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    20
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    23
 * questions.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    24
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    25
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    26
package jdk.jfr;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    27
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    28
import java.lang.annotation.Annotation;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    29
import java.util.Collections;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    30
import java.util.List;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    31
import java.util.Objects;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    32
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    33
import jdk.jfr.internal.AnnotationConstruct;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    34
import jdk.jfr.internal.Type;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    35
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    36
/**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    37
 * Describes an event setting.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    38
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    39
 * @since 9
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    40
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    41
public final class SettingDescriptor {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    42
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    43
    private final AnnotationConstruct annotationConstruct;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    44
    private final Type type;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    45
    private final String name;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    46
    private final String defaultValue;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    47
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    48
    // package private, invoked by jdk.internal.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    49
    SettingDescriptor(Type type, String name, String defaultValue, List<AnnotationElement> annotations) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    50
        Objects.requireNonNull(annotations);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    51
        this.name = Objects.requireNonNull(name, "Name of value descriptor can't be null");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    52
        this.type = Objects.requireNonNull(type);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    53
        this.annotationConstruct = new AnnotationConstruct(annotations);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    54
        this.defaultValue = Objects.requireNonNull(defaultValue);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    55
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    56
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    57
    // package private
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    58
    void setAnnotations(List<AnnotationElement> as) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    59
        annotationConstruct.setAnnotationElements(as);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    60
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    61
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    62
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    63
     * Returns the name of the setting (for example, {@code "threshold"}).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    64
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    65
     * @return the name, not {@code null}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    66
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    67
    public String getName() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    68
        return name;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    69
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    70
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    71
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    72
     * Returns a human-readable name that describes the setting (for example,
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    73
     * {@code "Threshold"}).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    74
     * <p>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    75
     * If the setting lacks a label, the label for the type that is associated with this
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    76
     * setting is returned, or {@code null} if doesn't exist
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    77
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    78
     * @return a human-readable name, or {@code null} if doesn't exist
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    79
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    80
    public String getLabel() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    81
        String label = annotationConstruct.getLabel();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    82
        if (label == null) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    83
            label = type.getLabel();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    84
        }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    85
        return label;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    86
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    87
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    88
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    89
     * Returns a sentence that describes the setting (for example
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    90
     * {@code "Record event with duration
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    91
     * above or equal to threshold"}).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    92
     * <p>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    93
     * If the setting lacks a description, the description for the type that is
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    94
     * associated with this setting is returned, or {@code null} if doesn't exist.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    95
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    96
     * @return the description, or {@code null} if doesn't exist
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    97
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    98
    public String getDescription() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    99
        String description = annotationConstruct.getDescription();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   100
        if (description == null) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   101
            description = type.getDescription();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   102
        }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   103
        return description;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   104
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   105
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   106
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   107
     * Returns a textual identifier that specifies how a value that is represented by
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   108
     * this {@code SettingDescriptor} object is interpreted or formatted.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   109
     * <p>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   110
     * For example, if the setting descriptor represents a percentage, then
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   111
     * {@code "jdk.jfr.Percentage"} hints to a client that a value of "0.5"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   112
     * is formatted as "50%".
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   113
     * <p>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   114
     * The JDK provides the following predefined content types:
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   115
     * <ul>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   116
     * <li>jdk.jfr.Percentage</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   117
     * <li>jdk.jfr.Timespan</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   118
     * <li>jdk.jfr.Timestamp</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   119
     * <li>jdk.jfr.Frequency</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   120
     * <li>jdk.jfr.Flag</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   121
     * <li>jdk.jfr.MemoryAddress</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   122
     * <li>jdk.jfr.DataAmount</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   123
     * <li>jdk.jfr.NetworkAddress</li>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   124
     * </ul>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   125
     * <p>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   126
     * User-defined content types can be created by using {@link ContentType}.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   127
     * <p>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   128
     * If the setting lacks a content type, the content type for the type
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   129
     * that is associated with this setting is returned, or {@code null} if not
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   130
     * available.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   131
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   132
     * @return the content type, or {@code null} if doesn't exist
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   133
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   134
     * @see ContentType
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   135
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   136
    public String getContentType() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   137
        for (AnnotationElement anno : getAnnotationElements()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   138
            for (AnnotationElement meta : anno.getAnnotationElements()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   139
                if (meta.getTypeName().equals(ContentType.class.getName())) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   140
                    return anno.getTypeName();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   141
                }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   142
            }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   143
        }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   144
        for (AnnotationElement anno : type.getAnnotationElements()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   145
            for (AnnotationElement meta : anno.getAnnotationElements()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   146
                if (meta.getTypeName().equals(ContentType.class.getName())) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   147
                    return anno.getTypeName();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   148
                }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   149
            }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   150
        }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   151
        return null;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   152
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   153
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   154
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   155
     * Returns the fully qualified class name of the type that is associated with this
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   156
     * setting descriptor.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   157
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   158
     * @return the type name, not {@code null}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   159
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   160
     * @see SettingDescriptor#getTypeId()
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   161
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   162
    public String getTypeName() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   163
        return type.getName();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   164
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   165
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   166
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   167
     * Returns a unique ID for the type in the Java Virtual Machine (JVM).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   168
     * <p>
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   169
     * The ID might not be the same between JVM instances.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   170
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   171
     * @return the type ID, not negative
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   172
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   173
    public long getTypeId() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   174
        return type.getId();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   175
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   176
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   177
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   178
     * Returns the first annotation for the specified type if an annotation
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   179
     * element with the same name is available, {@code null} otherwise.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   180
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   181
     * @param <A> the type of the annotation to query for and return if available
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   182
     * @param annotationType the Class object that corresponds to the annotation
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   183
     *        type, not {@code null}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   184
     * @return this element's annotation for the specified annotation type if
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   185
     *         available, {@code null} otherwise
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   186
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   187
    public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   188
        Objects.requireNonNull(annotationType);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   189
        return annotationConstruct.getAnnotation(annotationType);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   190
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   191
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   192
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   193
     * Returns an immutable list of annotation elements for this value
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   194
     * descriptor.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   195
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   196
     * @return a list of annotations, not {@code null}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   197
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   198
    public List<AnnotationElement> getAnnotationElements() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   199
        return Collections.unmodifiableList(annotationConstruct.getUnmodifiableAnnotationElements());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   200
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   201
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   202
    /**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   203
     * Returns the default value for this setting descriptor.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   204
     *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   205
     * @return the default value, not {@code null}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   206
     */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   207
    public String getDefaultValue() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   208
        return defaultValue;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   209
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   210
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   211
    // package private
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   212
    Type getType() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   213
        return type;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   214
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   215
}