Package org.symphonyoss.s2.canon.model
Class ModelElement
- java.lang.Object
-
- org.symphonyoss.s2.canon.model.ModelElement
-
- Direct Known Subclasses:
AbstractParameter,AbstractPayload,AbstractSchema,Components,EnumSchema,Model,ParameterContainer,ParameterSets,Paths,Reference,Schemas,Version
public class ModelElement extends Object
-
-
Constructor Summary
Constructors Constructor Description ModelElement(ModelElement parent, ParserContext parserContext, String type)ModelElement(ModelElement parent, ParserContext parserContext, String type, String name)
-
Method Summary
-
-
-
Constructor Detail
-
ModelElement
public ModelElement(ModelElement parent, ParserContext parserContext, String type)
-
ModelElement
public ModelElement(ModelElement parent, ParserContext parserContext, String type, String name)
-
-
Method Detail
-
getBaseSchema
public ModelElement 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- Returns:
- The base schema which this type refers to.
-
getComponent
public ModelElement getComponent()
-
getElementSchema
public ModelElement getElementSchema()
For an array type this is the schema of a single element of the array.- Returns:
- The schema of a single element of an array
-
getElementComponent
public ModelElement getElementComponent()
-
getIsArraySchema
public boolean getIsArraySchema()
-
getIsObjectSchema
public boolean getIsObjectSchema()
-
getModel
public Model getModel()
-
getSourceModel
public Model getSourceModel()
-
getName
public String getName()
-
getCamelName
public String getCamelName()
-
getCamelCapitalizedName
public String getCamelCapitalizedName()
-
getSnakeName
public String getSnakeName()
-
getSnakeCapitalizedName
public String getSnakeCapitalizedName()
-
getSummary
public String getSummary()
-
getDescription
public String getDescription()
-
getFormat
public String getFormat()
-
getHasSet
public boolean getHasSet()
-
getHasList
public boolean getHasList()
-
getHasCollections
public boolean getHasCollections()
-
getHasByteString
public boolean getHasByteString()
-
getIsComponent
public boolean getIsComponent()
-
getIsTypeDef
public boolean getIsTypeDef()
-
getIsObjectType
public boolean getIsObjectType()
-
getIsGenerateFacade
public boolean getIsGenerateFacade()
-
getIsGenerateBuilderFacade
public boolean getIsGenerateBuilderFacade()
-
getReference
public ModelElement getReference()
-
getEnum
public EnumSchema getEnum()
-
getReferencedTypes
public Set<AbstractSchema> getReferencedTypes()
-
getReferencedTypes
protected void getReferencedTypes(Set<AbstractSchema> result)
-
getSchemas
public Set<AbstractSchema> getSchemas()
-
getSchemas
protected void getSchemas(Set<AbstractSchema> result)
-
resolve
public void resolve()
-
validate
public void validate()
-
add
public void add(ModelElement e)
-
getParent
public ModelElement getParent()
-
getContext
public ParserContext getContext()
-
getElementType
public String getElementType()
-
getChildren
public List<ModelElement> getChildren()
-
getFields
public List<ModelElement> getFields()
Return the fields of this object, for a normal object this is the same as getChildren() for an AllOf it is something else.- Returns:
- The fields of this object.
-
generate
public void generate(GenerationContext generationContext, Map<String,Object> dataModel) throws GenerationException
- Throws:
GenerationException
-
generateChildren
protected void generateChildren(GenerationContext generationContext, Map<String,Object> dataModel) throws GenerationException
- Throws:
GenerationException
-
add
protected void add(String name, ModelElement element)
-
getByPath
public ModelElement getByPath(String[] pathNames, int index)
-
getCanFailValidation
public boolean getCanFailValidation()
-
-