Class CodeFactory.Base<B extends CodeDelegate>

java.lang.Object
org.praxislive.code.CodeFactory.Base<B>
Type Parameters:
B - base delegate type
Enclosing class:
CodeFactory<D extends CodeDelegate>

public static final class CodeFactory.Base<B extends CodeDelegate> extends Object
Base code factory for a given base delegate class. Encompasses shared configuration, component and context creation. Create specific CodeFactory instances with the create methods. See CodeFactory.base(java.lang.Class, java.util.List, java.util.function.BiFunction) and CodeFactory.containerBase(java.lang.Class, java.util.List, java.util.function.BiFunction)
  • Method Summary

    Modifier and Type
    Method
    Description
    final Class<B>
    Query the base delegate class that all CodeFactory instances will create subclasses of.
    final List<String>
    Query the base imports that all CodeFactory instance will add to the source body.
    create(String type, Class<? extends B> defaultDelegate, String defaultSource)
    Create a CodeFactory with the given component type, default precompiled delegate class, and source class body corresponding to the compiled delegate.
    create(String type, String defaultSource)
    Create a CodeFactory with the given component type and default source, without a precompiled delegate class.
    create(ComponentType type, Class<? extends B> defaultDelegate, String defaultSource)
    Create a CodeFactory with the given component type, default precompiled delegate class, and source class body corresponding to the compiled delegate.
    create(ComponentType type, String defaultSource)
    Create a CodeFactory with the given component type and default source, without a precompiled delegate class.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • baseClass

      public final Class<B> baseClass()
      Query the base delegate class that all CodeFactory instances will create subclasses of.
      Returns:
      base delegate class
    • baseImports

      public final List<String> baseImports()
      Query the base imports that all CodeFactory instance will add to the source body.
      Returns:
      base imports
    • create

      public CodeFactory<B> create(String type, String defaultSource)
      Create a CodeFactory with the given component type and default source, without a precompiled delegate class.
      Parameters:
      type - component type
      defaultSource - default source code
      Returns:
      code factory
    • create

      public CodeFactory<B> create(ComponentType type, String defaultSource)
      Create a CodeFactory with the given component type and default source, without a precompiled delegate class.
      Parameters:
      type - component type
      defaultSource - default source code
      Returns:
      code factory
    • create

      public CodeFactory<B> create(String type, Class<? extends B> defaultDelegate, String defaultSource)
      Create a CodeFactory with the given component type, default precompiled delegate class, and source class body corresponding to the compiled delegate.
      Parameters:
      type - component type as String, passed to ComponentType.of(java.lang.String)
      defaultDelegate - default delegate class
      defaultSource - default source class body
      Returns:
      code factory
    • create

      public CodeFactory<B> create(ComponentType type, Class<? extends B> defaultDelegate, String defaultSource)
      Create a CodeFactory with the given component type, default precompiled delegate class, and source class body corresponding to the compiled delegate.
      Parameters:
      type - component type
      defaultDelegate - default delegate class
      defaultSource - default source class body
      Returns:
      code factory