@NoImplement public interface TypeCatalog
types
declared in a given DslResolvingContext
,
defined by the Set
of ExtensionModel
s that coexist in.
A TypeCatalog
provides access to all the declared types, along with their type it mapping,
storing the relation of a given type and its declared subtypes across all the ExtensionModel
available in the context.
Modifier and Type | Method and Description |
---|---|
boolean |
containsBaseType(ObjectType type)
Type comparison will be performed first by
typeId in the context of subTypes mapping. |
Collection<ObjectType> |
getAllBaseTypes() |
Collection<ObjectType> |
getAllSubTypes() |
Optional<String> |
getDeclaringExtension(String typeId) |
static TypeCatalog |
getDefault(Set<ExtensionModel> extensions) |
Collection<ObjectType> |
getExtensionTypes(String extensionName) |
Set<ObjectType> |
getSubTypes(ObjectType type)
|
Set<ObjectType> |
getSuperTypes(ObjectType type)
Returns a
Set with all the declared ObjectType that are considered super
types from the given ObjectType type . |
Optional<ObjectType> |
getType(String typeId) |
Collection<ObjectType> |
getTypes() |
static TypeCatalog getDefault(Set<ExtensionModel> extensions)
Optional<ObjectType> getType(String typeId)
ObjectType
with the given typeId
if one is present in this
TypeCatalog
, or Optional.empty()
otherwise.Collection<ObjectType> getTypes()
Set
with all the ObjectType
defined
in this
TypeCatalog
Set<ObjectType> getSubTypes(ObjectType type)
Set
with all the declared ObjectType
subtypes
for the indicated ObjectType
type
.
Lookup will be performed first by typeId
,
defaulting to type
comparison if no typeId
was found
type
- the ObjectType
for which to retrieve its declared subTypesSet
with all the declared subtypes for the indicated ObjectType
Set<ObjectType> getSuperTypes(ObjectType type)
Set
with all the declared ObjectType
that are considered super
types from the given ObjectType
type
.
The lookup will be performed by looking through all the mappings that contains the given
type
as subtype in this
TypeCatalog
and storing the base type and
again looking the super type of the found base type.
type
- ObjectType
to look for their super typesSet
with all the declared supertypes for the indicated ObjectType
Collection<ObjectType> getAllBaseTypes()
Collection
with all the types that are extended by another typeCollection<ObjectType> getAllSubTypes()
Collection
with all the types which extend another type, in no particular orderboolean containsBaseType(ObjectType type)
typeId
in the context of subTypes mapping.
If a typeId
is available for the given type
,
the lookup will be performed by TypeIdAnnotation.getValue()
disregarding MetadataType
equality in its
full extent, which includes type generics and interfaces implementations, and
defaulting to MetadataType#equals
comparison if no typeId
was foundtype
- the MetadataType
for which to retrieve its declared subTypestype
Collection<ObjectType> getExtensionTypes(String extensionName)
Collection
with all the types declared by the extension with name extensionName
Copyright © 2018. All rights reserved.