Class CustomDefinition
java.lang.Object
com.github.victools.jsonschema.generator.CustomDefinition
- Direct Known Subclasses:
CustomPropertyDefinition
The result of a custom definition look-up.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIndication whether the normal attribute collection should be performed and any attributes should be added to the custom definition.static enumIndication whether a custom definition should always be inlined or follow the standard behaviour. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CustomDefinition.AttributeInclusionAlternative accessor forCustomDefinition.AttributeInclusion.NO.static final CustomDefinition.AttributeInclusionAlternative accessor forCustomDefinition.AttributeInclusion.YES.static final CustomDefinition.DefinitionTypeAlternative accessor forCustomDefinition.DefinitionType.INLINE. -
Constructor Summary
ConstructorsConstructorDescriptionCustomDefinition(tools.jackson.databind.node.ObjectNode value) Constructor for a custom definition that should follow the standard behaviour in regards to be inlined or mentioned in the "definitions".CustomDefinition(tools.jackson.databind.node.ObjectNode value, boolean meantToBeInline) Constructor for a custom definition.CustomDefinition(tools.jackson.databind.node.ObjectNode value, CustomDefinition.DefinitionType definitionType, CustomDefinition.AttributeInclusion attributeInclusion) Constructor for a custom definition. -
Method Summary
Modifier and TypeMethodDescriptionGetter for the associated extent of additional attributes being collected and applied.Getter for the associated definition type.tools.jackson.databind.node.ObjectNodegetValue()Getter for the actual custom definition.final booleanGetter for the flag indicating whether this custom definition should be inlined even if it occurs multiple times.final booleanGetter for the flag indicating whether this custom definition should always be included in theSchemaKeyword.TAG_DEFINITIONSeven if it occurs only once.booleanCheck whether this custom definition allows for additional attributes being collected and applied.
-
Field Details
-
INLINE_DEFINITION
Alternative accessor forCustomDefinition.DefinitionType.INLINE. -
INCLUDING_ATTRIBUTES
Alternative accessor forCustomDefinition.AttributeInclusion.YES. -
EXCLUDING_ATTRIBUTES
Alternative accessor forCustomDefinition.AttributeInclusion.NO.
-
-
Constructor Details
-
CustomDefinition
public CustomDefinition(tools.jackson.databind.node.ObjectNode value) Constructor for a custom definition that should follow the standard behaviour in regards to be inlined or mentioned in the "definitions".- Parameters:
value- generated custom definition
-
CustomDefinition
public CustomDefinition(tools.jackson.databind.node.ObjectNode value, boolean meantToBeInline) Constructor for a custom definition.- Parameters:
value- generated custom definitionmeantToBeInline- whether the definition should be inlined even if it occurs multiple times; otherwise applying standard behaviour
-
CustomDefinition
public CustomDefinition(tools.jackson.databind.node.ObjectNode value, CustomDefinition.DefinitionType definitionType, CustomDefinition.AttributeInclusion attributeInclusion) Constructor for a custom definition.- Parameters:
value- generated custom definitiondefinitionType- whether the definition should be inlined even if it occurs multiple times; otherwise applying standard behaviourattributeInclusion- whether additional attributes should be applied on top of this custom definition
-
-
Method Details
-
getValue
public tools.jackson.databind.node.ObjectNode getValue()Getter for the actual custom definition.- Returns:
- node containing the custom definition
-
getDefinitionType
Getter for the associated definition type.- Returns:
- indication whether a custom definition should always be inlined or follow the standard behaviour
-
isMeantToBeInline
public final boolean isMeantToBeInline()Getter for the flag indicating whether this custom definition should be inlined even if it occurs multiple times.- Returns:
- whether this custom definition should be inlined even if it occurs multiple times
-
shouldAlwaysProduceDefinition
public final boolean shouldAlwaysProduceDefinition()Getter for the flag indicating whether this custom definition should always be included in theSchemaKeyword.TAG_DEFINITIONSeven if it occurs only once.- Returns:
- whether an occurrence of this custom definition should always be replaced by a reference
- Since:
- 4.27.0
-
getAttributeInclusion
Getter for the associated extent of additional attributes being collected and applied.- Returns:
- indication whether the normal attribute collection should be performed and any attributes should be added to the custom definition
-
shouldIncludeAttributes
public boolean shouldIncludeAttributes()Check whether this custom definition allows for additional attributes being collected and applied.- Returns:
- whether
getAttributeInclusion()returnsAttributeInclusion.YES
-