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 TypedFieldBuilder
fieldBuilder(String fieldName, Type fieldType)
TypedFieldBuilder
fieldBuilder(String fieldName, Types.Builtin fieldType)
TypeImpl
getOrAdd(String name, boolean withConstantPool, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.TypeImpl
getOrAdd(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.TypeImpl
getOrAdd(String name, String supertype, boolean withConstantPool, TypeStructure typeStructure)
Retrieve the given type or create it a-new if it hasn't been added yet.TypeImpl
getOrAdd(String name, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.TypeImpl
getOrAdd(String name, String supertype, TypeStructure typeStructure)
Retrieve the given type or create it a-new if it hasn't been added yet.TypeImpl
getOrAdd(String name, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.TypeImpl
getOrAdd(Types.Predefined type, String supertype, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.TypeImpl
getOrAdd(Types.Predefined type, Consumer<TypeStructureBuilder> builderCallback)
Retrieve the given type or create it a-new if it hasn't been added yet.TypeImpl
getType(String name)
Retrieve the type by its name.TypeImpl
getType(String name, boolean asResolvable)
Retrieve the type by its name.TypeImpl
getType(Types.Predefined type)
A convenience shortcut to get a Type instance corresponding to the Types.Predefined typevoid
resolveAll()
Resolve all unresolved types.TypeStructureBuilder
typeStructureBuilder()
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:Types
Retrieve 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:Types
Retrieve 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:Types
Retrieve 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:Types
Retrieve the given type or create it a-new if it hasn't been added yet.- Specified by:
getOrAdd
in 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
type
instance
-
getOrAdd
public TypeImpl getOrAdd(String name, String supertype, boolean withConstantPool, TypeStructure typeStructure)
Description copied from class:Types
Retrieve 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:Types
Retrieve 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:Types
Retrieve 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:Types
Retrieve 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:Types
Retrieve the type by its name.
-
getType
public TypeImpl getType(String name, boolean asResolvable)
Description copied from class:Types
Retrieve the type by its name. If the type hasn't been added yet a ResolvableType wrapper may be returned.- Specified by:
getType
in classTypes
- Parameters:
name
- the type nameasResolvable
- if true a ResolvableType wrapper will be returned instead of null for non-existent type- Returns:
- an existing
Type
type, null or a ResolvableType wrapper
-
getType
public TypeImpl getType(Types.Predefined type)
Description copied from class:Types
A convenience shortcut to get a Type instance corresponding to the Types.Predefined type- Specified by:
getType
in classTypes
- Parameters:
type
- the predefined/enum type- Returns:
- the registered Type instance or a ResolvableType wrapper
-
typeStructureBuilder
public TypeStructureBuilder typeStructureBuilder()
Description copied from class:Types
A convenience accessor to TypeStructureBuilder instance outside of the type configuration callback- Specified by:
typeStructureBuilder
in classTypes
- Returns:
- a new TypeStructureBuilder instance
-
fieldBuilder
public TypedFieldBuilder fieldBuilder(String fieldName, Type fieldType)
- Specified by:
fieldBuilder
in 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:
fieldBuilder
in 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
-
-