Class Types

  • Direct Known Subclasses:
    TypesImpl

    public abstract class Types
    extends Object
    • Constructor Detail

      • Types

        public Types()
    • Method Detail

      • getOrAdd

        public abstract Type getOrAdd​(Types.Predefined type,
                                      Consumer<TypeStructureBuilder> builderCallback)
        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.
        Parameters:
        type - the type to retrieve
        builderCallback - will be called lazily when the type is about to be initialized
        Returns:
        the corresponding type instance
      • getOrAdd

        public abstract Type getOrAdd​(String name,
                                      Consumer<TypeStructureBuilder> builderCallback)
        Retrieve the given type or create it a-new if it hasn't been added yet.
        Parameters:
        name - the name of the type to retrieve
        builderCallback - will be called lazily when the type is about to be initialized
        Returns:
        the corresponding type instance
      • getOrAdd

        public abstract Type getOrAdd​(String name,
                                      boolean withConstantPool,
                                      Consumer<TypeStructureBuilder> builderCallback)
        Retrieve the given type or create it a-new if it hasn't been added yet.
        Parameters:
        name - the name of the type to retrieve
        withConstantPool - should the type values use an associated constant pool
        builderCallback - will be called lazily when the type is about to be initialized
        Returns:
        the corresponding type instance
      • getOrAdd

        public abstract Type 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.
        Parameters:
        type - the type to retrieve
        supertype - the super type name
        builderCallback - will be called lazily when the type is about to be initialized
        Returns:
        the corresponding type instance
      • getOrAdd

        public abstract Type getOrAdd​(String name,
                                      String supertype,
                                      Consumer<TypeStructureBuilder> builderCallback)
        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.
        Parameters:
        name - the name of the type to retrieve
        supertype - the super type name
        builderCallback - will be called lazily when the type is about to be initialized
        Returns:
        the corresponding type instance
      • getOrAdd

        public abstract Type 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.
        Parameters:
        name - the name of the type to retrieve
        supertype - the super type name
        withConstantPool - should the type values use an associated constant pool
        builderCallback - will be called lazily when the type is about to be initialized
        Returns:
        the corresponding type instance
      • getOrAdd

        public abstract Type getOrAdd​(String name,
                                      String supertype,
                                      TypeStructure typeStructure)
        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.
        Parameters:
        name - the name of the type to retrieve
        supertype - the super type name
        typeStructure - the type structure definition
        Returns:
        the corresponding type instance
      • getOrAdd

        public abstract Type 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.
        Parameters:
        name - the name of the type to retrieve
        supertype - the super type name
        withConstantPool - should the type values use an associated constant pool
        typeStructure - the type structure definition
        Returns:
        the corresponding type instance
      • getType

        public abstract Type getType​(String name)
        Retrieve the type by its name.
        Parameters:
        name - the type name
        Returns:
        the registered type or null
      • getType

        public abstract Type getType​(String name,
                                     boolean asResolvable)
        Retrieve the type by its name. If the type hasn't been added yet a ResolvableType wrapper may be returned.
        Parameters:
        name - the type name
        asResolvable - 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
      • fieldBuilder

        public abstract TypedFieldBuilder fieldBuilder​(String fieldName,
                                                       Type fieldType)
        Parameters:
        fieldName - field name
        fieldType - field type
        Returns:
        a new TypedFieldBuilder instance for a named field of the given type