Class ConfigBeanBuilder

java.lang.Object
org.tquadrat.foundation.config.ap.impl.codebuilders.CodeBuilderBase
org.tquadrat.foundation.config.ap.impl.codebuilders.ConfigBeanBuilder
All Implemented Interfaces:
CodeBuilder

@ClassVersion(sourceVersion="$Id: ConfigBeanBuilder.java 1076 2023-10-03 18:36:07Z tquadrat $") @API(status=MAINTAINED, since="0.1.0") public final class ConfigBeanBuilder extends CodeBuilderBase
The code builder implementation for the basic stuff, as defined in ConfigBeanSpec.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: ConfigBeanBuilder.java 1076 2023-10-03 18:36:07Z tquadrat $
Since:
0.1.0
UML Diagram
UML Diagram for "org.tquadrat.foundation.config.ap.impl.codebuilders.ConfigBeanBuilder"

UML Diagram for "org.tquadrat.foundation.config.ap.impl.codebuilders.ConfigBeanBuilder"

UML Diagram for "org.tquadrat.foundation.config.ap.impl.codebuilders.ConfigBeanBuilder"
  • Constructor Details

  • Method Details

    • addListenerSupport

      private final void addListenerSupport()
      Adds the listener support to the new class.
    • addLockSupport

      private final void addLockSupport()
      Adds locking support to the new class.
    • addUnchecked

      private final void addUnchecked(TypeName typeName)
      Adds "unchecked" to the SuppressWarnings annotation for the constructor if the given type is a List, Set, Map or an otherwise parameterised type.
      Parameters:
      typeName - The type to check.
      See Also:
    • build

      public final void build()
      Generates the relevant code.
      Specified by:
      build in interface CodeBuilder
      Specified by:
      build in class CodeBuilderBase
    • composeInitializationCodeFromMethod

      private final void composeInitializationCodeFromMethod(MethodSpec method)
      Composes the constructor code that initialises the properties from the result of a call to the initData() method.
      Parameters:
      method - The initData() method.
    • composeInitializationCodeFromResource

      private final void composeInitializationCodeFromResource(String resourceName)
      Composes the constructor code that initialises the properties from the provided resource.
      Parameters:
      resourceName - The name of the resource.
    • createToString

      private final void createToString()

      Creates the implementation of the method Object.toString() for the configuration bean. The output of that method will be like this:

      <ClassName> [<PropertyName> = "<PropertyValue>"[, …]]
    • generateProperty

      private final void generateProperty(PropertySpec rawProperty)
      Generates the methods, fields and other code for the given property.
      Parameters:
      rawProperty - The property specification.