public String toJavaString() { String result = ""; if (getExpression().length() != 0 ) result = getExpression(); // if (result.length() > 0 && !(result.charAt(result.length()-1) == '}')) { if (result.length() > 0) { result = result + ";"; } return result; }
public String javaDefaultInitialisation(Classifier propertyConcreteOwner, boolean ignoreAssociationClass) { return UmlgPropertyOperations.getDefaultTinkerCollectionInitalisation(this.property, propertyConcreteOwner, ignoreAssociationClass).getExpression(); }
public String javaDefaultInitialisationForAssociationClass(Classifier propertyConcreteOwner, boolean withLoaded) { return UmlgPropertyOperations.getDefaultTinkerCollectionInitalisationForAssociationClass(this.property, propertyConcreteOwner, withLoaded).getExpression(); }
/********************************************************************* * The operations from the model ********************************************************************/ public OJSimpleStatement getCopy() { OJSimpleStatement result = new OJSimpleStatement(); result.setExpression(this.getExpression()); return result; } public String toJavaString() {
public void copyDeepInfoInto(OJSimpleStatement copy) { super.copyDeepInfoInto(copy); copy.setExpression(this.getExpression()); }
public void renameAll(Set<OJPathName> renamePathNames, String newName) { setExpression(replaceAll(getExpression(), renamePathNames, newName)); } /*********************************************************************
private static OJSimpleStatement getDefaultTinkerCollectionInitalisation(Property p, Classifier propertyConcreteOwner, OJPathName collectionPathName) { OJSimpleStatement ojSimpleStatement = new OJSimpleStatement(" new " + collectionPathName.getCollectionTypeName() + "(this"); ojSimpleStatement.setExpression(ojSimpleStatement.getExpression() + ", " + UmlgGenerationUtil.PropertyTree.getLast() + ".from(" + UmlgClassOperations.propertyEnumName(propertyConcreteOwner) + "." + new PropertyWrapper(p).fieldname() + "), " + "loaded"); if (new PropertyWrapper(p).isMemberOfAssociationClass() && !(propertyConcreteOwner instanceof AssociationClass)) { //The constructor for an UmlgPropertyAssociationClassSet takes 2 runtime properties, one to the property end and one to the fake property end to the association class ojSimpleStatement.setExpression(ojSimpleStatement.getExpression() + ", " + UmlgGenerationUtil.PropertyTree.getLast() + ".from(" + UmlgClassOperations.propertyEnumName(propertyConcreteOwner) + "." + new PropertyWrapper(p).getAssociationClassFakePropertyName() + "), loaded"); } ojSimpleStatement.setExpression(ojSimpleStatement.getExpression() + ")"); return ojSimpleStatement; }
private static OJSimpleStatement getDefaultTinkerCollectionInitalisationForAssociationClass(Property p, Classifier propertyConcreteOwner, OJPathName collectionPathName, boolean withLoaded) { OJSimpleStatement ojSimpleStatement = new OJSimpleStatement(" new " + collectionPathName.getCollectionTypeName() + "(this"); if (withLoaded) { ojSimpleStatement.setExpression( ojSimpleStatement.getExpression() + ", " + UmlgGenerationUtil.PropertyTree.getLast() + ".from(" + UmlgClassOperations.propertyEnumName(propertyConcreteOwner) + "." + new PropertyWrapper(p).fieldname() + "), " + UmlgGenerationUtil.PropertyTree.getLast() + ".from(" + UmlgClassOperations.propertyEnumName(propertyConcreteOwner) + "." + new PropertyWrapper(p).getAssociationClassFakePropertyName() + "), loaded" ); } else { ojSimpleStatement.setExpression( ojSimpleStatement.getExpression() + ", " + UmlgGenerationUtil.PropertyTree.getLast() + ".from(" + UmlgClassOperations.propertyEnumName(propertyConcreteOwner) + "." + new PropertyWrapper(p).fieldname() + "), " + UmlgGenerationUtil.PropertyTree.getLast() + ".from(" + UmlgClassOperations.propertyEnumName(propertyConcreteOwner) + "." + new PropertyWrapper(p).getAssociationClassFakePropertyName() + ")" ); } ojSimpleStatement.setExpression(ojSimpleStatement.getExpression() + ")"); return ojSimpleStatement; }
ojSimpleStatement = new OJSimpleStatement("return new " + qualified.javaClosableIteratorTypePath().getCopy().getLast()); ojSimpleStatement.setExpression(ojSimpleStatement.getExpression() + "(graphTraversal, " + qualified.getTumlRuntimePropertyEnum() + ")"); ojClass.addToImports(qualified.javaClosableIteratorTypePath()); ifHasNext.addToThenPart(ojSimpleStatement);
ojSimpleStatement = new OJSimpleStatement(qualified.javaTypePath().getLast() + " " + qualified.getName() + "_" + qualifiedToSearchOnPW.getName() + "_" + concrete.getName() + " = new " + qualified.javaClosableIteratorTypePath().getCopy().getLast()); ojSimpleStatement.setExpression(ojSimpleStatement.getExpression() + "(graphTraversal" + qualifiedToSearchOnPW.getName() + "_" + concrete.getName() + ", " + qualified.getTumlRuntimePropertyEnum() + ")"); refinedQualifierValue.getBody().addToStatements(ojSimpleStatement);