private ShapeFactoryCaseDef getShapeFactoryCase(Element listEntryModelElement) { for (ShapeFactoryCaseDef shapeFactoryCase : this.shapeFactoryDef.getCases()) { JavaType javaType = shapeFactoryCase.getType().resolve(); Class<?> cl = javaType.artifact(); if (cl.isAssignableFrom(listEntryModelElement.getClass())) { return shapeFactoryCase; } } return null; }
public ShapePart newShape(JavaType javaType) { ElementList<?> list = this.modelElement.property(this.modelProperty); final Class cl = javaType.artifact(); Element element = list.insert(cl); return getShapePart(element); }