public OJPathName getQualifiedMemoryCollection() { return qualifiedMemoryCollection.getCopy(); } }
public OJPathName getClosableIteratorPathName() { return this.closableIteratorPathName.getCopy(); }
public OJPathName getOjPathName() { return interfacePathName.getCopy(); }
public OJPathName getInterfacePathName() { return this.interfacePathName.getCopy(); }
public OJPathName getImplementationPathName() { return this.implPathName.getCopy(); }
public OJPathName getMemoryCollection() { return this.memoryCollection.getCopy(); }
public List<OJPathName> getGenerics() { List<OJPathName> copy = new ArrayList<OJPathName>(); for (OJPathName o : this.generics) { copy.add(o.getCopy()); } return copy; }
static public OJPathName SetOfObject() { if (setType == null) { setType = JavaPathNames.Set.getCopy(); setType.addToElementTypes(JavaPathNames.Object); } return setType; }
static public OJPathName ArrayListOfObject() { if (arrayListType == null) { arrayListType = JavaPathNames.ArrayList.getCopy(); arrayListType.addToElementTypes(JavaPathNames.Object); } return arrayListType; }
static public OJPathName ListOfObject() { if (listType == null) { listType = JavaPathNames.List.getCopy(); listType.addToElementTypes(JavaPathNames.Object); } return listType; }
static public OJPathName HashSetOfObject() { if (hashSetType == null) { hashSetType = JavaPathNames.HashSet.getCopy(); hashSetType.addToElementTypes(JavaPathNames.Object); } return hashSetType; }
public OJPathName getPathName(){ return outer.getCopy().append("Anonymous"); } @Override
protected void copyInfoInto(OJAnnotationValue result){ super.copyInfoInto(result); result.type = type.getCopy(); result.attributes = new TreeMap<String,OJAnnotationAttributeValue>(); for(OJAnnotationAttributeValue v:this.attributes.values()){ result.attributes.put(v.getName(), v.getCopy()); } } public OJAnnotationValue getDeepCopy(){
static public OJPathName MapObjectString() { if (mapType == null) { mapType = JavaPathNames.Map.getCopy(); mapType.addToElementTypes(JavaPathNames.Object); mapType.addToElementTypes(JavaPathNames.String); } return mapType; }
static public OJPathName HashMapObjectString() { if (hashMapType == null) { hashMapType = JavaPathNames.HashMap.getCopy(); hashMapType.addToElementTypes(JavaPathNames.Object); hashMapType.addToElementTypes(JavaPathNames.String); } return hashMapType; } }
private void addEdgeToRoot(OJAnnotatedClass annotatedClass, Class clazz) { OJConstructor constructor = annotatedClass.findConstructor(new OJPathName("java.lang.Boolean")); constructor.getBody().addToStatements( UmlgGenerationUtil.edgePathName.getLast() + " edge = " + UmlgGenerationUtil.UMLGAccess + ".getRoot().addEdge(getEdgeToRootLabel(), this.vertex)"); constructor.getBody().addToStatements("edge.property(\"inClass\", this.getClass().getName())"); annotatedClass.addToImports(UmlgGenerationUtil.edgePathName.getCopy()); annotatedClass.addToImports(UmlgGenerationUtil.UMLGPathName.getCopy()); }
public OJPathName getAssociationClassPair() { OJPathName pair = UmlgGenerationUtil.Pair.getCopy(); pair.addToGenerics(javaBaseTypePath()).addToGenerics(UmlgClassOperations.getPathName(getAssociationClass())); return pair; }
protected void copyDeepInfoInto(OJAnnotatedClass copy) { super.copyDeepInfoInto(copy); Set<OJPathName> interfaces = getImplementedInterfaces(); for (OJPathName ojInterface : interfaces) { OJPathName copyInterface = ojInterface.getCopy(); copy.addToImplementedInterfaces(copyInterface); } Collection<OJAnnotationValue> annotations = getAnnotations(); for (OJAnnotationValue ojAnnotationValue : annotations) { OJAnnotationValue copyAnnotation = ojAnnotationValue.getDeepCopy(); copy.addAnnotationIfNew(copyAnnotation); } }
private void addGetAllInstancesForAbstractClass(Classifier classifier, OJAnnotatedClass metaClass) { OJAnnotatedOperation allInstances = new OJAnnotatedOperation("getAllInstances"); UmlgGenerationUtil.addOverrideAnnotation(allInstances); OJPathName classPathName = UmlgClassOperations.getPathName(classifier); allInstances.setReturnType(UmlgGenerationUtil.umlgSet.getCopy().addToGenerics(classPathName)); OJField resultField = new OJField("result", UmlgGenerationUtil.umlgMemorySet.getCopy().addToGenerics(classPathName)); resultField.setInitExp("new " + UmlgGenerationUtil.umlgMemorySet.getCopy().addToGenerics(classPathName).getLast() + "()"); allInstances.getBody().addToLocals(resultField); Set<Classifier> concreteImplementations = UmlgClassOperations.getConcreteRealization(classifier); for (Classifier concreteImplementation : concreteImplementations) { allInstances.getBody().addToStatements("result.addAll(" + UmlgClassOperations.getMetaClassName(concreteImplementation) + ".getInstance().getAllInstances())"); metaClass.addToImports(UmlgClassOperations.getMetaClassPathName(concreteImplementation)); } allInstances.getBody().addToStatements("return result"); metaClass.addToImports(UmlgGenerationUtil.UMLG_NODE); metaClass.addToOperations(allInstances); }
private void addGetterToAppRootForRootEntity(Class clazz, OJAnnotatedClass root) { OJAnnotatedOperation getter = new OJAnnotatedOperation("get" + UmlgClassOperations.className(clazz), UmlgGenerationUtil.umlgSet.getCopy().addToGenerics("? extends " + UmlgClassOperations.getPathName(clazz).getLast())); getter.setStatic(true); root.addToOperations(getter); getter.getBody().addToStatements("return " + UmlgClassOperations.getPathName(clazz) + ".allInstances()"); root.addToImports(UmlgClassOperations.getPathName(clazz)); root.addToImports(UmlgGenerationUtil.tinkerDirection); root.addToImports(UmlgGenerationUtil.UmlgLabelConverterFactoryPathName); }