Class RequiredAttributeVisitor

java.lang.Object
io.helidon.builder.RequiredAttributeVisitor
All Implemented Interfaces:
AttributeVisitor<Object>

@Deprecated public class RequiredAttributeVisitor extends Object implements AttributeVisitor<Object>
Deprecated.
This class is subject to change at any time - Helidon users should not use this directly. It will be referenced in code generated sources that Helidon generates.
An implementation of AttributeVisitor that will validate each attribute to enforce not-null in accordance with ConfiguredOption.required().

Note that the source type having the Builder must be annotated with ConfiguredOption(required=true) for this to be enforced. Also note that this implementation will be used only when Builder.requireLibraryDependencies() is enabled. If not enabled then an implementation similar to this type will be inlined directly into the code-generated builder type.

  • Constructor Details

    • RequiredAttributeVisitor

      public RequiredAttributeVisitor()
      Deprecated.
      Default constructor.
    • RequiredAttributeVisitor

      public RequiredAttributeVisitor(boolean allowNullsByDefault)
      Deprecated.
      Constructor.
      Parameters:
      allowNullsByDefault - true if nulls should be allowed
  • Method Details

    • visit

      public void visit(String attrName, Supplier<Object> valueSupplier, Map<String,Object> meta, Object userDefinedCtx, Class<?> type, Class<?>... typeArgument)
      Deprecated.
      Description copied from interface: AttributeVisitor
      Visits the attribute named 'attrName'.
      Specified by:
      visit in interface AttributeVisitor<Object>
      Parameters:
      attrName - the attribute name
      valueSupplier - the attribute value supplier
      meta - the meta information for the attribute
      userDefinedCtx - a user defined context that can be used for holding an object of your choosing
      type - the type of the attribute
      typeArgument - the type arguments (if type is a parameterized / generic type)
    • validate

      public void validate()
      Deprecated.
      Performs the validation. Any errors will result in a thrown error.
      Throws:
      IllegalStateException - when any attributes are in violation with the validation policy