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 classCustomDefinition.AttributeInclusionIndication whether the normal attribute collection should be performed and any attributes should be added to the custom definition.static classCustomDefinition.DefinitionTypeIndication whether a custom definition should always be inlined or follow the standard behaviour.
-
Field Summary
Fields Modifier and Type Field Description static CustomDefinition.AttributeInclusionEXCLUDING_ATTRIBUTESAlternative accessor forCustomDefinition.AttributeInclusion.NO.static CustomDefinition.AttributeInclusionINCLUDING_ATTRIBUTESAlternative accessor forCustomDefinition.AttributeInclusion.YES.static CustomDefinition.DefinitionTypeINLINE_DEFINITIONAlternative 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.AttributeInclusiongetAttributeInclusion()Getter for the associated extent of additional attributes being collected and applied.CustomDefinition.DefinitionTypegetDefinitionType()Getter for the associated definition type.com.fasterxml.jackson.databind.node.ObjectNodegetValue()Getter for the actual custom definition.booleanisMeantToBeInline()Getter for the flag indicating whether this custom definition should be inlined even if it occurs multiple times.booleanshouldIncludeAttributes()
-
-
-
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
-
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()
-
-