Class TypesImpl
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.writer.api.Types
-
- org.openjdk.jmc.flightrecorder.writer.TypesImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openjdk.jmc.flightrecorder.writer.api.Types
Types.Builtin, Types.JDK, Types.Predefined
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypedFieldBuilderfieldBuilder(String fieldName, Type fieldType)TypedFieldBuilderfieldBuilder(String fieldName, Types.Builtin fieldType)TypeImplgetOrAdd(String name, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetOrAdd(String name, String supertype, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetOrAdd(String name, String supertype, boolean withConstantPool, TypeStructure typeStructure)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetOrAdd(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetOrAdd(String name, String supertype, TypeStructure typeStructure)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetOrAdd(String name, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetOrAdd(Types.Predefined type, String supertype, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetOrAdd(Types.Predefined type, Consumer<TypeStructureBuilder> builderCallback)Retrieve the given type or create it a-new if it hasn't been added yet.TypeImplgetType(String name)Retrieve the type by its name.TypeImplgetType(String name, boolean asResolvable)Retrieve the type by its name.TypeImplgetType(Types.Predefined type)A convenience shortcut to get a Type instance corresponding to the Types.Predefined typevoidresolveAll()Resolve all unresolved types.TypeStructureBuildertypeStructureBuilder()A convenience accessor to TypeStructureBuilder instance outside of the type configuration callback
-
-
-
Method Detail
-
getOrAdd
public TypeImpl getOrAdd(Types.Predefined type, Consumer<TypeStructureBuilder> builderCallback)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet. The type values will be stored in an associated constant pool.
-
getOrAdd
public TypeImpl getOrAdd(String name, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet.
-
getOrAdd
public TypeImpl getOrAdd(Types.Predefined type, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet.
-
getOrAdd
public TypeImpl getOrAdd(String name, String supertype, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet.- Specified by:
getOrAddin classTypes- Parameters:
name- the name of the type to retrievesupertype- the super type namewithConstantPool- should the type values use an associated constant poolbuilderCallback- will be called lazily when the type is about to be initialized- Returns:
- the corresponding
typeinstance
-
getOrAdd
public TypeImpl getOrAdd(String name, String supertype, boolean withConstantPool, TypeStructure typeStructure)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet.
-
getOrAdd
public TypeImpl getOrAdd(String name, Consumer<TypeStructureBuilder> builderCallback)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet.
-
getOrAdd
public TypeImpl getOrAdd(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet. The type values will be stored in an associated constant pool.
-
getOrAdd
public TypeImpl getOrAdd(String name, String supertype, TypeStructure typeStructure)
Description copied from class:TypesRetrieve the given type or create it a-new if it hasn't been added yet. The type values will be stored in an associated constant pool.
-
getType
public TypeImpl getType(String name)
Description copied from class:TypesRetrieve the type by its name.
-
getType
public TypeImpl getType(String name, boolean asResolvable)
Description copied from class:TypesRetrieve the type by its name. If the type hasn't been added yet a ResolvableType wrapper may be returned.- Specified by:
getTypein classTypes- Parameters:
name- the type nameasResolvable- if true a ResolvableType wrapper will be returned instead of null for non-existent type- Returns:
- an existing
Typetype, null or a ResolvableType wrapper
-
getType
public TypeImpl getType(Types.Predefined type)
Description copied from class:TypesA convenience shortcut to get a Type instance corresponding to the Types.Predefined type- Specified by:
getTypein classTypes- Parameters:
type- the predefined/enum type- Returns:
- the registered Type instance or a ResolvableType wrapper
-
typeStructureBuilder
public TypeStructureBuilder typeStructureBuilder()
Description copied from class:TypesA convenience accessor to TypeStructureBuilder instance outside of the type configuration callback- Specified by:
typeStructureBuilderin classTypes- Returns:
- a new TypeStructureBuilder instance
-
fieldBuilder
public TypedFieldBuilder fieldBuilder(String fieldName, Type fieldType)
- Specified by:
fieldBuilderin classTypes- Parameters:
fieldName- field namefieldType- field type- Returns:
- a new TypedFieldBuilder instance for a named field of the given type
-
fieldBuilder
public TypedFieldBuilder fieldBuilder(String fieldName, Types.Builtin fieldType)
- Specified by:
fieldBuilderin classTypes- Parameters:
fieldName- field namefieldType- field type- Returns:
- a new TypedFieldBuilder instance for a named field of the given type
-
resolveAll
public void resolveAll()
Resolve all unresolved types. After this method had been called all calls to ResolvableType.isResolved() will return true if the target type was properly registered
-
-