Class CustomDefinition
- java.lang.Object
-
- com.github.victools.jsonschema.generator.CustomDefinition
-
- Direct Known Subclasses:
CustomPropertyDefinition
public class CustomDefinition extends Object
The result of a custom definition look-up.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CustomDefinition.AttributeInclusion
Indication whether the normal attribute collection should be performed and any attributes should be added to the custom definition.static class
CustomDefinition.DefinitionType
Indication whether a custom definition should always be inlined or follow the standard behaviour.
-
Field Summary
Fields Modifier and Type Field Description static CustomDefinition.AttributeInclusion
EXCLUDING_ATTRIBUTES
Alternative accessor forCustomDefinition.AttributeInclusion.NO
.static CustomDefinition.AttributeInclusion
INCLUDING_ATTRIBUTES
Alternative accessor forCustomDefinition.AttributeInclusion.YES
.static CustomDefinition.DefinitionType
INLINE_DEFINITION
Alternative accessor forCustomDefinition.DefinitionType.INLINE
.
-
Constructor Summary
Constructors Constructor Description CustomDefinition(com.fasterxml.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(com.fasterxml.jackson.databind.node.ObjectNode value, boolean meantToBeInline)
Constructor for a custom definition.CustomDefinition(com.fasterxml.jackson.databind.node.ObjectNode value, CustomDefinition.DefinitionType definitionType, CustomDefinition.AttributeInclusion attributeInclusion)
Constructor for a custom definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomDefinition.AttributeInclusion
getAttributeInclusion()
Getter for the associated extent of additional attributes being collected and applied.CustomDefinition.DefinitionType
getDefinitionType()
Getter for the associated definition type.com.fasterxml.jackson.databind.node.ObjectNode
getValue()
Getter for the actual custom definition.boolean
isMeantToBeInline()
Getter for the flag indicating whether this custom definition should be inlined even if it occurs multiple times.boolean
shouldAlwaysProduceDefinition()
Getter for the flag indicating whether this custom definition should always be included in theSchemaKeyword.TAG_DEFINITIONS
even if it occurs only once.boolean
shouldIncludeAttributes()
-
-
-
Field Detail
-
INLINE_DEFINITION
public static final CustomDefinition.DefinitionType INLINE_DEFINITION
Alternative accessor forCustomDefinition.DefinitionType.INLINE
.
-
INCLUDING_ATTRIBUTES
public static final CustomDefinition.AttributeInclusion INCLUDING_ATTRIBUTES
Alternative accessor forCustomDefinition.AttributeInclusion.YES
.
-
EXCLUDING_ATTRIBUTES
public static final CustomDefinition.AttributeInclusion EXCLUDING_ATTRIBUTES
Alternative accessor forCustomDefinition.AttributeInclusion.NO
.
-
-
Constructor Detail
-
CustomDefinition
public CustomDefinition(com.fasterxml.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(com.fasterxml.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(com.fasterxml.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 Detail
-
getValue
public com.fasterxml.jackson.databind.node.ObjectNode getValue()
Getter for the actual custom definition.- Returns:
- node containing the custom definition
-
getDefinitionType
public CustomDefinition.DefinitionType 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_DEFINITIONS
even 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
public CustomDefinition.AttributeInclusion 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()
-
-