use of org.eclipse.winery.model.tosca.TSchema in project winery by eclipse.
the class IRepository method getReferencedDefinitionsOfProperties.
default void getReferencedDefinitionsOfProperties(Collection<DefinitionsChildId> ids, TEntityType.PropertiesDefinition properties) {
if (Objects.nonNull(properties)) {
// Only the YamlPropertiesDefinitions are referencing additional elements
if (properties instanceof TEntityType.YamlPropertiesDefinition) {
List<TEntityType.YamlPropertyDefinition> props = ((TEntityType.YamlPropertiesDefinition) properties).getProperties();
Queue<TSchema> schemata = new LinkedList<>();
for (TEntityType.YamlPropertyDefinition def : props) {
if (!def.getType().getNamespaceURI().isEmpty()) {
ids.add(new DataTypeId(def.getType()));
}
schemata.add(def.getKeySchema());
schemata.add(def.getEntrySchema());
}
while (!schemata.isEmpty()) {
TSchema current = schemata.poll();
if (current == null) {
continue;
}
if (!current.getType().getNamespaceURI().isEmpty()) {
ids.add(new DataTypeId(current.getType()));
}
schemata.add(current.getKeySchema());
schemata.add(current.getEntrySchema());
}
}
}
}
Aggregations