Class ConfigurationPropertiesValidationResult

java.lang.Object
org.apache.camel.catalog.ConfigurationPropertiesValidationResult
All Implemented Interfaces:
Serializable

public class ConfigurationPropertiesValidationResult extends Object implements Serializable
Details result of validating configuration properties (eg application.properties for camel-main).
Since:
3.1
See Also:
  • Constructor Details

    • ConfigurationPropertiesValidationResult

      public ConfigurationPropertiesValidationResult()
  • Method Details

    • getFileName

      public @Nullable String getFileName()
    • setFileName

      public void setFileName(@Nullable String fileName)
    • getText

      public @Nullable String getText()
    • setText

      public void setText(@Nullable String text)
    • getLineNumber

      public int getLineNumber()
    • setLineNumber

      public void setLineNumber(int lineNumber)
    • isAccepted

      public boolean isAccepted()
    • setAccepted

      public void setAccepted(boolean accepted)
    • summaryErrorMessage

      public @Nullable String summaryErrorMessage(boolean includeHeader)
      A human readable summary of the validation errors.
      Parameters:
      includeHeader - whether to include a header
      Returns:
      the summary, or null if no validation errors
    • summaryErrorMessage

      public @Nullable String summaryErrorMessage(boolean includeHeader, boolean ignoreDeprecated, boolean includeWarnings)
      A human readable summary of the validation errors.
      Parameters:
      includeHeader - whether to include a header
      ignoreDeprecated - whether to ignore deprecated options in use as an error or not
      includeWarnings - whether to include warnings as an error or not
      Returns:
      the summary, or null if no validation errors
    • hasErrors

      public boolean hasErrors()
      Returns true if the validation result has one or more errors.
    • getNumberOfErrors

      public int getNumberOfErrors()
      Returns the number of validation errors.
    • hasWarnings

      public boolean hasWarnings()
      Returns true if the validation result has one or more warnings.
    • getNumberOfWarnings

      public int getNumberOfWarnings()
      Returns the number of validation warnings.
    • isSuccess

      public boolean isSuccess()
      Returns true if the validation result has no errors.
    • addSyntaxError

      public void addSyntaxError(String syntaxError)
      Adds a syntax error to the validation result.
    • addIncapable

      public void addIncapable(String uri)
      Adds an incapable URI warning to the validation result.
    • addUnknownComponent

      public void addUnknownComponent(String name)
      Adds an unknown component warning to the validation result.
    • addUnknown

      public void addUnknown(String name)
      Adds an unknown option error to the validation result.
    • addUnknownSuggestions

      public void addUnknownSuggestions(String name, String[] suggestions)
      Adds spelling suggestions for an unknown option name.
    • addRequired

      public void addRequired(String name)
      Adds a missing required option error to the validation result.
    • addDeprecated

      public void addDeprecated(String name)
      Adds a deprecated option warning to the validation result.
    • addInvalidEnum

      public void addInvalidEnum(String name, String value)
      Adds an invalid enum value error to the validation result.
    • addInvalidEnumChoices

      public void addInvalidEnumChoices(String name, String[] choices)
      Adds the valid enum choices for an invalid enum option.
    • addInvalidEnumSuggestions

      public void addInvalidEnumSuggestions(String name, String[] suggestions)
      Adds spelling suggestions for an invalid enum option value.
    • addInvalidReference

      public void addInvalidReference(String name, String value)
      Adds an invalid bean reference error to the validation result.
    • addInvalidMap

      public void addInvalidMap(String name, String value)
      Adds an invalid map value error to the validation result.
    • addInvalidArray

      public void addInvalidArray(String name, String value)
      Adds an invalid array value error to the validation result.
    • addInvalidBoolean

      public void addInvalidBoolean(String name, String value)
      Adds an invalid boolean value error to the validation result.
    • addInvalidInteger

      public void addInvalidInteger(String name, String value)
      Adds an invalid integer value error to the validation result.
    • addInvalidNumber

      public void addInvalidNumber(String name, String value)
      Adds an invalid number value error to the validation result.
    • addInvalidDuration

      public void addInvalidDuration(String name, String value)
      Adds an invalid duration value error to the validation result.
    • addDefaultValue

      public void addDefaultValue(String name, String value)
      Adds a default value entry for an option that was not configured.
    • getSyntaxError

      public @Nullable String getSyntaxError()
      Returns the syntax error message, or null if there is no syntax error.
    • getIncapable

      public @Nullable String getIncapable()
      Returns the incapable URI that could not be validated, or null if not applicable.
    • getUnknown

      public @Nullable Set<String> getUnknown()
      Returns the set of unknown option names, or null if none.
    • getUnknownSuggestions

      public @Nullable Map<String,String[]> getUnknownSuggestions()
      Returns spelling suggestions for unknown option names, or null if none.
    • getUnknownComponent

      public @Nullable String getUnknownComponent()
      Returns the name of an unknown component that was used, or null if none.
    • getRequired

      public @Nullable Set<String> getRequired()
      Returns the set of required option names that are missing, or null if none.
    • getDeprecated

      public @Nullable Set<String> getDeprecated()
      Returns the set of deprecated option names that are used, or null if none.
    • getInvalidEnum

      public @Nullable Map<String,String> getInvalidEnum()
      Returns options with invalid enum values mapped to the invalid value, or null if none.
    • getInvalidEnumChoices

      public @Nullable Map<String,String[]> getInvalidEnumChoices()
      Returns options with invalid enum values mapped to the valid choices, or null if none.
    • getInvalidEnumSuggestions

      public @Nullable Map<String,String[]> getInvalidEnumSuggestions()
      Returns spelling suggestions for invalid enum option values, or null if none.
    • getEnumChoices

      public List<String> getEnumChoices(String optionName)
      Returns the list of valid enum choices for the given option name.
    • getInvalidReference

      public @Nullable Map<String,String> getInvalidReference()
      Returns options with invalid bean reference values, or null if none.
    • getInvalidMap

      public @Nullable Map<String,String> getInvalidMap()
      Returns options with invalid map values, or null if none.
    • getInvalidArray

      public @Nullable Map<String,String> getInvalidArray()
      Returns options with invalid array values, or null if none.
    • getInvalidBoolean

      public @Nullable Map<String,String> getInvalidBoolean()
      Returns options with invalid boolean values, or null if none.
    • getInvalidInteger

      public @Nullable Map<String,String> getInvalidInteger()
      Returns options with invalid integer values, or null if none.
    • getInvalidNumber

      public @Nullable Map<String,String> getInvalidNumber()
      Returns options with invalid number values, or null if none.
    • getInvalidDuration

      public @Nullable Map<String,String> getInvalidDuration()
      Returns options with invalid duration values, or null if none.
    • getDefaultValues

      public @Nullable Map<String,String> getDefaultValues()
      Returns options that were not configured and are using default values, or null if none.