Java Code Examples for jdk.jfr.internal.Type#getFields()

The following examples show how to use jdk.jfr.internal.Type#getFields() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PrettyWriter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private void printType(Type t) throws IOException {
    print("// id: ");
    println(String.valueOf(t.getId()));
    int commentIndex = t.getName().length() + 10;
    String typeName = t.getName();
    int index = typeName.lastIndexOf(".");
    if (index != -1) {
        println("package " + typeName.substring(0, index) + ";");
    }
    printAnnotations(commentIndex, t.getAnnotationElements());
    print("class " + typeName.substring(index + 1));
    String superType = t.getSuperType();
    if (superType != null) {
        print(" extends " + superType);
    }
    println(" {");
    indent();
    for (ValueDescriptor v : t.getFields()) {
        printField(commentIndex, v);
    }
    retract();
    println("}");
    println();
}
 
Example 2
Source File: ParserFactory.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private CompositeParser createCompositeParser(Type type) throws IOException {
    List<ValueDescriptor> vds = type.getFields();
    Parser[] parsers = new Parser[vds.size()];
    CompositeParser composite = new CompositeParser(parsers);
    // need to pre-register so recursive types can be handled
    registerParserType(type, composite);

    int index = 0;
    for (ValueDescriptor vd : vds) {
        parsers[index++] = createParser(vd);
    }
    return composite;
}
 
Example 3
Source File: ParserFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private CompositeParser createCompositeParser(Type type) throws IOException {
    List<ValueDescriptor> vds = type.getFields();
    Parser[] parsers = new Parser[vds.size()];
    CompositeParser composite = new CompositeParser(parsers);
    // need to pre-register so recursive types can be handled
    registerParserType(type, composite);

    int index = 0;
    for (ValueDescriptor vd : vds) {
        parsers[index++] = createParser(vd);
    }
    return composite;
}
 
Example 4
Source File: PrettyWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void printType(Type t) {
    if (showIds) {
        print("// id: ");
        println(String.valueOf(t.getId()));
    }
    int commentIndex = t.getName().length() + 10;
    String typeName = t.getName();
    int index = typeName.lastIndexOf(".");
    if (index != -1) {
        println("@Name(\"" + typeName + "\")");
    }
    printAnnotations(commentIndex, t.getAnnotationElements());
    print("class " + typeName.substring(index + 1));
    String superType = t.getSuperType();
    if (superType != null) {
        print(" extends " + superType);
    }
    println(" {");
    indent();
    boolean first = true;
    for (ValueDescriptor v : t.getFields()) {
        printField(commentIndex, v, first);
        first = false;
    }
    retract();
    println("}");
    println();
}
 
Example 5
Source File: ParserFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private CompositeParser createCompositeParser(Type type) throws IOException {
    List<ValueDescriptor> vds = type.getFields();
    Parser[] parsers = new Parser[vds.size()];
    CompositeParser composite = new CompositeParser(parsers);
    // need to pre-register so recursive types can be handled
    registerParserType(type, composite);

    int index = 0;
    for (ValueDescriptor vd : vds) {
        parsers[index++] = createParser(vd);
    }
    return composite;
}
 
Example 6
Source File: PrettyWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void printType(Type t) {
    if (showIds) {
        print("// id: ");
        println(String.valueOf(t.getId()));
    }
    int commentIndex = t.getName().length() + 10;
    String typeName = t.getName();
    int index = typeName.lastIndexOf(".");
    if (index != -1) {
        println("@Name(\"" + typeName + "\")");
    }
    printAnnotations(commentIndex, t.getAnnotationElements());
    print("class " + typeName.substring(index + 1));
    String superType = t.getSuperType();
    if (superType != null) {
        print(" extends " + superType);
    }
    println(" {");
    indent();
    boolean first = true;
    for (ValueDescriptor v : t.getFields()) {
        printField(commentIndex, v, first);
        first = false;
    }
    retract();
    println("}");
    println();
}
 
Example 7
Source File: ObjectFactory.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
ObjectFactory(Type type) {
    this.valueDescriptors = type.getFields();
}
 
Example 8
Source File: ObjectFactory.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
ObjectFactory(Type type) {
    this.valueDescriptors = type.getFields();
}
 
Example 9
Source File: ObjectFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
ObjectFactory(Type type) {
    this.valueDescriptors = type.getFields();
}