Class BuilderBase<T extends BuilderBase<T>>

  • All Implemented Interfaces:
    com.vladsch.flexmark.util.data.DataHolder, com.vladsch.flexmark.util.data.MutableDataHolder, com.vladsch.flexmark.util.data.MutableDataSetter

    public abstract class BuilderBase<T extends BuilderBase<T>>
    extends com.vladsch.flexmark.util.data.MutableDataSet
    • Field Summary

      • Fields inherited from class com.vladsch.flexmark.util.data.DataSet

        dataSet
      • Fields inherited from interface com.vladsch.flexmark.util.data.DataHolder

        NULL
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BuilderBase()  
      protected BuilderBase​(@Nullable com.vladsch.flexmark.util.data.DataHolder options)  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void addExtensionApiPoint​(@NotNull Object apiPoint)
      Call to add extension API point to track
      abstract @NotNull Object build()  
      T extensions​(@NotNull Collection<? extends com.vladsch.flexmark.util.misc.Extension> extensions)  
      <V> V get​(@NotNull com.vladsch.flexmark.util.data.DataKey<V> key)
      Deprecated.
      use key.get(dataHolder) instead, which will do the same thing an carries nullable information for the data
      protected abstract boolean loadExtension​(@NotNull com.vladsch.flexmark.util.misc.Extension extension)
      Load extension if it is valid
      protected void loadExtensions()  
      protected abstract void preloadExtension​(@NotNull com.vladsch.flexmark.util.misc.Extension extension)
      Preload operation for extension, perform any data config and other operation needed for loading extension
      protected abstract void removeApiPoint​(@NotNull Object apiPoint)
      Remove apiPoint from state information
      static com.vladsch.flexmark.util.data.DataHolder removeExtensions​(@NotNull com.vladsch.flexmark.util.data.DataHolder options, @NotNull Collection<Class<? extends com.vladsch.flexmark.util.misc.Extension>> excludeExtensions)
      Remove given extensions from options[EXTENSIONS] data key.
      <V> @NotNull com.vladsch.flexmark.util.data.MutableDataSet set​(@NotNull com.vladsch.flexmark.util.data.DataKey<V> key, V value)
      Tracks keys set by extension initialization
      <V> @NotNull com.vladsch.flexmark.util.data.MutableDataSet set​(@NotNull com.vladsch.flexmark.util.data.NullableDataKey<V> key, V value)  
      • Methods inherited from class com.vladsch.flexmark.util.data.MutableDataSet

        clear, getOrCompute, merge, remove, setAll, setFrom, setIn, toDataSet, toImmutable, toMutable
      • Methods inherited from class com.vladsch.flexmark.util.data.DataSet

        aggregate, aggregate, aggregateActions, contains, equals, getAll, getKeys, hashCode, registerDataKeyAggregator, toString
      • Methods inherited from interface com.vladsch.flexmark.util.data.DataHolder

        contains, getAll, getKeys
    • Constructor Detail

      • BuilderBase

        protected BuilderBase​(@Nullable
                              @Nullable com.vladsch.flexmark.util.data.DataHolder options)
      • BuilderBase

        protected BuilderBase()
    • Method Detail

      • removeApiPoint

        protected abstract void removeApiPoint​(@NotNull
                                               @NotNull Object apiPoint)
        Remove apiPoint from state information
        Parameters:
        apiPoint - api point object
      • preloadExtension

        protected abstract void preloadExtension​(@NotNull
                                                 @NotNull com.vladsch.flexmark.util.misc.Extension extension)
        Preload operation for extension, perform any data config and other operation needed for loading extension
        Parameters:
        extension - to preload
      • loadExtension

        protected abstract boolean loadExtension​(@NotNull
                                                 @NotNull com.vladsch.flexmark.util.misc.Extension extension)
        Load extension if it is valid
        Parameters:
        extension - to load
        Returns:
        true if extension was loaded
      • extensions

        @NotNull
        public final T extensions​(@NotNull
                                  @NotNull Collection<? extends com.vladsch.flexmark.util.misc.Extension> extensions)
        Parameters:
        extensions - extensions to load
        Returns:
        this
      • build

        @NotNull
        public abstract @NotNull Object build()
        Returns:
        actual instance the builder is supposed to build
      • addExtensionApiPoint

        protected void addExtensionApiPoint​(@NotNull
                                            @NotNull Object apiPoint)
        Call to add extension API point to track
        Parameters:
        apiPoint - point registered
      • set

        @NotNull
        public <V> @NotNull com.vladsch.flexmark.util.data.MutableDataSet set​(@NotNull
                                                                              @NotNull com.vladsch.flexmark.util.data.DataKey<V> key,
                                                                              @NotNull
                                                                              V value)
        Tracks keys set by extension initialization
        Specified by:
        set in interface com.vladsch.flexmark.util.data.MutableDataHolder
        Overrides:
        set in class com.vladsch.flexmark.util.data.MutableDataSet
        Parameters:
        key - data key
        value - value for the key
        Returns:
        builder
      • set

        @NotNull
        public <V> @NotNull com.vladsch.flexmark.util.data.MutableDataSet set​(@NotNull
                                                                              @NotNull com.vladsch.flexmark.util.data.NullableDataKey<V> key,
                                                                              @Nullable
                                                                              V value)
        Specified by:
        set in interface com.vladsch.flexmark.util.data.MutableDataHolder
        Overrides:
        set in class com.vladsch.flexmark.util.data.MutableDataSet
      • get

        @Deprecated
        public <V> V get​(@NotNull
                         @NotNull com.vladsch.flexmark.util.data.DataKey<V> key)
        Deprecated.
        use key.get(dataHolder) instead, which will do the same thing an carries nullable information for the data
        Get the given key, if it does not exist then use the key's factory to create a new value and put it into the collection so that the following get of the same key will find a value
        Parameters:
        key - data key
        Returns:
        return stored value or newly created value
      • loadExtensions

        protected void loadExtensions()
      • removeExtensions

        public static com.vladsch.flexmark.util.data.DataHolder removeExtensions​(@NotNull
                                                                                 @NotNull com.vladsch.flexmark.util.data.DataHolder options,
                                                                                 @NotNull
                                                                                 @NotNull Collection<Class<? extends com.vladsch.flexmark.util.misc.Extension>> excludeExtensions)
        Remove given extensions from options[EXTENSIONS] data key.
        Parameters:
        options - options where EXTENSIONS key is set
        excludeExtensions - collection of extension classes to remove from extensions
        Returns:
        modified options if removed and options were immutable or the same options if nothing to remove or options were mutable.