Class CompositeBinder

java.lang.Object
nz.org.riskscape.engine.bind.BaseBinder
nz.org.riskscape.wizard.bind.CompositeBinder
All Implemented Interfaces:
nz.org.riskscape.engine.bind.ParameterBinder, nz.org.riskscape.engine.Identified

public class CompositeBinder extends nz.org.riskscape.engine.bind.BaseBinder

Binds a Map to a class tagged with Composite

  • Constructor Details

    • CompositeBinder

      public CompositeBinder()
  • Method Details

    • fieldName

      public static String fieldName(Field field)
      Returns:
      the name that would be appended to the sub-question for this field
    • fieldName

      public static String fieldName(Question question)

      Pulls the field name back out of a sub-question we've already created

    • fieldifyQuestion

      public static Question fieldifyQuestion(Question originalQuestion, Class<?> clazz, String fieldName)

      Returns a new Question that is modified for representing a sub-question for a given field

      Parameters:
      originalQuestion - the question with a Composite annotated type to modify
      clazz - the Composite annotated class
      fieldName - the name of the public field that the new question will be for
    • fieldifyQuestion

      public static Question fieldifyQuestion(Question originalQuestion, Field field)

      Returns a new Question that is modified for representing a sub-question for a given field

      Parameters:
      originalQuestion - the question with a Composite annotated type to modify
      field - a CompositeField annotated field that the new question will be for
    • canBind

      public boolean canBind(Class<?> sourceType, Class<?> destinationType)
    • bindValue

      public <T> nz.org.riskscape.problem.ResultOrProblems<T> bindValue(nz.org.riskscape.engine.bind.BindingContext context, Object value, Class<T> destinationType)