private static Map<String, Property> getPropertiesForComposedModel(ComposedModel model, Map<String, Model> definitions) { //TODO: Unused method, make sure this is never used and then remove it. Map<String, Property> combinedProperties; if (model.getParent() instanceof RefModel) { Map<String, Property> parentProperties = definitions.get(((RefModel) model.getParent()).getSimpleRef()).getProperties(); if (parentProperties == null) { return null; } else { combinedProperties = new LinkedHashMap<>(parentProperties); } } else { combinedProperties = new LinkedHashMap<>(model.getParent().getProperties()); } Map<String, Property> childProperties; if (model.getChild() instanceof RefModel) { childProperties = definitions.get(((RefModel) model.getChild()).getSimpleRef()).getProperties(); } else { childProperties = model.getChild().getProperties(); } if (childProperties != null) { combinedProperties.putAll(childProperties); } return combinedProperties; }
private void attachAdditionalProps(Model model, Map<String, Property> dataProps) { if (model instanceof ComposedModel) { model = ((ComposedModel) model).getChild(); } Map<String, Property> props = model.getProperties(); if (props == null) { props = new HashMap<>(); } for (Map.Entry<String, Property> entry : dataProps.entrySet()) { props.put(entry.getKey(), entry.getValue()); } model.setProperties(props); }
private static Map<String, Property> getPropertiesForComposedModel(ComposedModel model, Map<String, Model> definitions) { //TODO: Unused method, make sure this is never used and then remove it. Map<String, Property> combinedProperties; if (model.getParent() instanceof RefModel) { Map<String, Property> parentProperties = definitions.get(((RefModel) model.getParent()).getSimpleRef()).getProperties(); if (parentProperties == null) { return null; } else { combinedProperties = new LinkedHashMap<>(parentProperties); } } else { combinedProperties = new LinkedHashMap<>(model.getParent().getProperties()); } Map<String, Property> childProperties; if (model.getChild() instanceof RefModel) { childProperties = definitions.get(((RefModel) model.getChild()).getSimpleRef()).getProperties(); } else { childProperties = model.getChild().getProperties(); } if (childProperties != null) { combinedProperties.putAll(childProperties); } return combinedProperties; }
private void processComposedModel(ComposedModel composedModel) { processModel(composedModel.getParent()); processModel(composedModel.getChild()); final List<RefModel> interfaces = composedModel.getInterfaces(); if (interfaces != null) { for (RefModel model : interfaces) { processRefModel(model); } } }
break; case "child": _switchResult = model.getChild(); break; case "description":