Class FileLoader.Builder<B extends FileLoader.Builder<B>>

java.lang.Object
org.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gtksourceview.FileLoader.Builder<B>
Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
FileLoader

public static class FileLoader.Builder<B extends FileLoader.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public FileLoader build()
      Finish building the FileLoader object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to FileLoader.
      Overrides:
      build in class GObject.Builder<B extends FileLoader.Builder<B>>
      Returns:
      a new instance of FileLoader with the properties that were set in the Builder object.
    • setBuffer

      public B setBuffer(Buffer buffer)
      The GtkSourceBuffer to load the contents into. The GtkSourceFileLoader object has a weak reference to the buffer.
      Parameters:
      buffer - the value for the buffer property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFile

      public B setFile(File file)
      The GtkSourceFile. The GtkSourceFileLoader object has a weak reference to the file.
      Parameters:
      file - the value for the file property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInputStream

      public B setInputStream(InputStream inputStream)
      The GInputStream to load. Useful for reading stdin. If this property is set, the GtkSourceFileLoader:location property is ignored.
      Parameters:
      inputStream - the value for the input-stream property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLocation

      public B setLocation(File location)
      The GFile to load. If the GtkSourceFileLoader:input-stream is null, by default the location is taken from the GtkSourceFile at construction time.
      Parameters:
      location - the value for the location property
      Returns:
      the Builder instance is returned, to allow method chaining