Package manifold.api.json.codegen
Class JsonStructureType
- java.lang.Object
-
- manifold.api.json.codegen.schema.JsonSchemaType
-
- manifold.api.json.codegen.JsonStructureType
-
- All Implemented Interfaces:
Cloneable,IJsonParentType,IJsonType
- Direct Known Subclasses:
ErrantType,JsonEnumType,JsonUnionType
public class JsonStructureType extends JsonSchemaType
The main JSON type reflecting name/value pair bindings.
-
-
Field Summary
-
Fields inherited from class manifold.api.json.codegen.schema.JsonSchemaType
FIELD_FILE_URL, FROM_SOURCE_METHOD
-
-
Constructor Summary
Constructors Constructor Description JsonStructureType(JsonSchemaType parent, manifold.api.fs.IFile source, String name, TypeAttributes attr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(String name, IJsonParentType type)voidaddMember(String name, IJsonType type, manifold.json.rt.parser.Token token)voidaddRequiredWithTokens(Object withTokens)Keeping tokens so we can verify named required property exists during resolve()booleanaddSourcePositionAnnotation(StringBuilder sb, int indent, String name)voidaddSuper(IJsonType superType)booleanequals(Object o)booleanequalsStructurally(IJsonType o)JSon Schema types normally compare by identity, however for some use-cases we still need to compare them structurally e.g., for merging types.IJsonTypefindChild(String name)Map<String,IJsonParentType>getInnerTypes()protected Map<String,manifold.json.rt.parser.Token>getMemberLocations()Map<String,IJsonType>getMembers()inthashCode()booleanisRequired(String name)protected JsonEnumTypemakeEnumType(Collection<? extends IJsonType> types)IJsonTypemerge(IJsonType that)voidrender(AbstractJsonTypeManifold tm, StringBuilder sb, int indent, boolean mutable)protected voidresolveRefsImpl()StringtoString()-
Methods inherited from class manifold.api.json.codegen.schema.JsonSchemaType
addActualNameAnnotation, addActualNameAnnotation, addFromSourceMethod, addIssue, addRequestMethods, addSourcePositionAnnotation, addTypeReferenceAnnotation, copyWithAttributes, getActualFqn, getConstituentQn, getConstituentQn, getConstituentQnComponent, getDefinitions, getErrorHandler, getFile, getFqn, getFqn, getIdentifier, getIFile, getIssues, getLabel, getLocation, getModule, getName, getParent, getPropertyType, getPropertyType, getTm, getToken, getTypeAttributes, indent, isCollapsedUnionEnum, isParentRoot, isSchemaType, isSyntheticSchema, makeIdentifier, makeMemberIdentifier, makeTypeParameter, mergeInnerTypes, prepareToRender, removeGenerics, renderFileField, renderFileField, renderInner, resolveRefs, setDefinitions, setJsonSchema, setParent, setSyntheticSchema, setTm, setToken
-
-
-
-
Constructor Detail
-
JsonStructureType
public JsonStructureType(JsonSchemaType parent, manifold.api.fs.IFile source, String name, TypeAttributes attr)
-
-
Method Detail
-
resolveRefsImpl
protected void resolveRefsImpl()
- Overrides:
resolveRefsImplin classJsonSchemaType
-
addSuper
public void addSuper(IJsonType superType)
-
addChild
public void addChild(String name, IJsonParentType type)
-
getInnerTypes
public Map<String,IJsonParentType> getInnerTypes()
-
render
public void render(AbstractJsonTypeManifold tm, StringBuilder sb, int indent, boolean mutable)
-
makeEnumType
protected JsonEnumType makeEnumType(Collection<? extends IJsonType> types)
-
addSourcePositionAnnotation
public boolean addSourcePositionAnnotation(StringBuilder sb, int indent, String name)
-
equalsStructurally
public boolean equalsStructurally(IJsonType o)
Description copied from interface:IJsonTypeJSon Schema types normally compare by identity, however for some use-cases we still need to compare them structurally e.g., for merging types.
-
isRequired
public boolean isRequired(String name)
-
addRequiredWithTokens
public void addRequiredWithTokens(Object withTokens)
Keeping tokens so we can verify named required property exists during resolve()
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classJsonSchemaType
-
hashCode
public int hashCode()
- Overrides:
hashCodein classJsonSchemaType
-
-