/** Constructor for OJBlockGEN * * @param name * @param comment */ protected OJBlockGEN(String name, String comment) { super(); super.setName(name); super.setComment(comment); if ( usesAllInstances ) { allInstances.add(((OJBlock)this)); } }
/** Returns the default identifier for OJTryStatement */ public String getIdString() { String result = ""; result = super.getIdString(); return result; }
statement.setName(pWrap.fieldname()); ojSwitchCase.getBody().addToStatements(statement); annotatedClass.addToImports(pWrap.javaImplTypePath()); ojSwitchCase.setLabel(pWrap.getAssociationClassFakePropertyName()); statement = new OJSimpleStatement("this." + pWrap.getAssociationClassFakePropertyName() + ".z_internalAdder((" + pWrap.getAssociationClassPathName().getLast() + ")umlgNode)"); statement.setName(pWrap.fieldname()); ojSwitchCase.getBody().addToStatements(statement); annotatedClass.addToImports(pWrap.javaImplTypePath());
/** Default toString implementation for OJTryStatement */ public String toString() { String result = ""; result = super.toString(); return result; }
/** Copies all attributes and associations of this instance into 'copy'. True parts, i.e. associations marked 'aggregate' or 'composite', and attributes, are copied as well. References to other objects, i.e. associations not marked 'aggregate' or 'composite', will not be copied. The 'copy' will refer to the same objects as the original (this) instance. * * @param copy */ public void copyInfoInto(OJSimpleStatement copy) { super.copyInfoInto(copy); copy.setExpression(getExpression()); }
public void renameAll(Set<OJPathName> renamePathNames,String newName){ for(OJStatement statement:getStatements()){ statement.renameAll(renamePathNames, newName); } for(OJField ojField:getLocals()){ ojField.renameAll(renamePathNames, newName); } } public OJStatement findStatement(String name){
public void copyDeepInfoInto(OJBlock copy){ for(OJStatement statement:getStatements()){ copy.addToStatements(statement.getDeepCopy()); } for(OJField ojField:getLocals()){ copy.addToLocals(ojField.getDeepCopy()); } } public void renameAll(Set<OJPathName> renamePathNames,String newName){
List<Integer> toRemove = new ArrayList<Integer>(); for (OJStatement s : fromLabel.getBody().getStatements()) { if (s.toJavaString().equals("return null;")) { toRemove.add(count); toRemove = new ArrayList<Integer>(); for (OJStatement s : fromQualifiedName.getBody().getStatements()) { if (s.toJavaString().equals("return null;")) { toRemove.add(count);
statement.setName(pWrap.fieldname()); ojSwitchCase.getBody().addToStatements(statement); annotatedClass.addToImports(pWrap.javaImplTypePath()); ojSwitchCase.setLabel(pWrap.getAssociationClassFakePropertyName()); statement = new OJSimpleStatement("this." + pWrap.getAssociationClassFakePropertyName() + ".z_internalAdder((" + pWrap.getAssociationClassPathName().getLast() + ")umlgNode)"); statement.setName(pWrap.fieldname()); ojSwitchCase.getBody().addToStatements(statement); annotatedClass.addToImports(pWrap.javaImplTypePath());
/** Default toString implementation for OJBlock */ public String toString() { String result = ""; result = super.toString(); return result; }
/** Copies all attributes and associations of this instance into 'copy'. True parts, i.e. associations marked 'aggregate' or 'composite', and attributes, are copied as well. References to other objects, i.e. associations not marked 'aggregate' or 'composite', will not be copied. The 'copy' will refer to the same objects as the original (this) instance. * * @param copy */ public void copyInfoInto(OJBlock copy) { super.copyInfoInto(copy); Iterator statementsIt = new ArrayList<OJStatement>(getStatements()).iterator(); while ( statementsIt.hasNext() ) { OJStatement elem = (OJStatement) statementsIt.next(); copy.addToStatements(elem); } Iterator localsIt = new ArrayList<OJField>(getLocals()).iterator(); while ( localsIt.hasNext() ) { OJField elem = (OJField) localsIt.next(); copy.addToLocals(elem); } }
/** Constructor for OJTryStatementGEN * * @param name * @param comment */ protected OJTryStatementGEN(String name, String comment) { super(); super.setName(name); super.setComment(comment); if ( usesAllInstances ) { allInstances.add(((OJTryStatement)this)); } }
/** Default toString implementation for OJWhileStatement */ public String toString() { String result = ""; result = super.toString(); if ( this.getCondition() != null ) { result = result + " condition:" + this.getCondition(); } return result; }
/** Copies all attributes and associations of this instance into 'copy'. True parts, i.e. associations marked 'aggregate' or 'composite', and attributes, are copied as well. References to other objects, i.e. associations not marked 'aggregate' or 'composite', will not be copied. The 'copy' will refer to the same objects as the original (this) instance. * * @param copy */ public void copyInfoInto(OJSwitchStatement copy) { super.copyInfoInto(copy); copy.setCondition(getCondition()); Iterator casesIt = new ArrayList<OJSwitchCase>(getCases()).iterator(); while ( casesIt.hasNext() ) { OJSwitchCase elem = (OJSwitchCase) casesIt.next(); copy.addToCases(elem); } if ( getDefCase() != null ) { copy.setDefCase(getDefCase()); } }
public OJStatement findStatementRecursive(String name){ for(OJStatement statement:getStatements()){ if(statement.getName() != null && statement.getName().equals(name)){ return statement; } if(statement instanceof OJIfStatement){ OJIfStatement ifs = (OJIfStatement) statement; OJStatement s = ifs.getThenPart().findStatementRecursive(name); if(s == null && ifs.getElsePart()!=null){ s = ifs.getElsePart().findStatementRecursive(name); } if(s != null){ return s; } }else if(statement instanceof OJForStatement){ OJForStatement ifs = (OJForStatement) statement; OJStatement s = ifs.getBody().findStatementRecursive(name); if(s != null){ return s; } }else{ // TODO } } return null; } public OJField findLocal(String name){
/** Returns the default identifier for OJBlock */ public String getIdString() { String result = ""; result = super.getIdString(); return result; }
/** Constructor for OJIfStatementGEN * * @param name * @param comment * @param condition */ protected OJIfStatementGEN(String name, String comment, String condition) { super(); super.setName(name); super.setComment(comment); this.setCondition(condition); if ( usesAllInstances ) { allInstances.add(((OJIfStatement)this)); } }
/** Default toString implementation for OJIfStatement */ public String toString() { String result = ""; result = super.toString(); if ( this.getCondition() != null ) { result = result + " condition:" + this.getCondition(); } return result; }
/** Copies all attributes and associations of this instance into 'copy'. True parts, i.e. associations marked 'aggregate' or 'composite', and attributes, are copied as well. References to other objects, i.e. associations not marked 'aggregate' or 'composite', will not be copied. The 'copy' will refer to the same objects as the original (this) instance. * * @param copy */ public void copyInfoInto(OJWhileStatement copy) { super.copyInfoInto(copy); copy.setCondition(getCondition()); if ( getBody() != null ) { copy.setBody(getBody()); } }