Package org.symphonyoss.s2.canon.model
Class AbstractSchema
- java.lang.Object
-
- org.symphonyoss.s2.canon.model.ModelElement
-
- org.symphonyoss.s2.canon.model.AbstractSchema
-
- Direct Known Subclasses:
Field,ReferenceOrSchema
public abstract class AbstractSchema extends ModelElement
An abstract Schema object, which could be an object, reference to an object, oneOf, allOf, or even a single field.- Author:
- Bruce Skingle
-
-
Constructor Summary
Constructors Constructor Description AbstractSchema(ModelElement parent, ParserContext context, String type, String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected AbstractSchemacreateSchema(ParserContext context)protected voidgenerateChildren(GenerationContext generationContext, Map<String,Object> dataModel)abstract SchemagetBaseSchema()Get the basic schema which this type refers to.abstract SchemagetElementSchema()For an array type this is the schema of a single element of the array.booleangetIsAnonymousInnerClass()abstract booleangetIsArraySchema()abstract booleangetIsObjectSchema()booleanisRequired()StringtoString()protected StringtoString(StringBuffer details)protected StringtoString(List<?> children)protected StringtoString(ValueMap<String,Object> children)-
Methods inherited from class org.symphonyoss.s2.canon.model.ModelElement
add, add, capitalize, generate, getAttributes, getByPath, getCamelCapitalizedName, getCamelName, getCanFailValidation, getChildren, getComponent, getContext, getDescription, getElementComponent, getElementType, getEnum, getFields, getFormat, getHasByteString, getHasCollections, getHasList, getHasSet, getIsComponent, getIsGenerateBuilderFacade, getIsGenerateFacade, getIsObjectType, getIsTypeDef, getModel, getName, getParent, getReference, getReferencedTypes, getReferencedTypes, getSchemas, getSchemas, getSnakeCapitalizedName, getSnakeName, getSourceModel, getSummary, resolve, validate
-
-
-
-
Constructor Detail
-
AbstractSchema
public AbstractSchema(ModelElement parent, ParserContext context, String type, String name)
-
-
Method Detail
-
generateChildren
protected void generateChildren(GenerationContext generationContext, Map<String,Object> dataModel) throws GenerationException
- Overrides:
generateChildrenin classModelElement- Throws:
GenerationException
-
getBaseSchema
public abstract Schema getBaseSchema()
Get the basic schema which this type refers to. For a field it will be the field type, for a reference the referenced type. For a field whose type is a reference then it will be the ultimate referenced type. The baseSchema could be an ArraySchema- Overrides:
getBaseSchemain classModelElement- Returns:
- The base schema which this type refers to.
-
getElementSchema
public abstract Schema getElementSchema()
For an array type this is the schema of a single element of the array.- Overrides:
getElementSchemain classModelElement- Returns:
- The schema of a single element of an array
-
getIsArraySchema
public abstract boolean getIsArraySchema()
- Overrides:
getIsArraySchemain classModelElement
-
getIsObjectSchema
public abstract boolean getIsObjectSchema()
- Overrides:
getIsObjectSchemain classModelElement
-
isRequired
public boolean isRequired()
-
getIsAnonymousInnerClass
public boolean getIsAnonymousInnerClass()
-
createSchema
protected AbstractSchema createSchema(ParserContext context)
-
toString
public String toString()
- Overrides:
toStringin classModelElement
-
toString
protected String toString(StringBuffer details)
-
-