// Check to see if we have anything to do.
if (namedObj.attributeList().size() == 0) {
return;
}
Type variableType = RefType.v(PtolemyUtilities.variableClass);
// A local that we will use to set the value of our
// settable attributes.
Local attributeLocal = Jimple.v().newLocal("attribute",
PtolemyUtilities.attributeType);
body.getLocals().add(attributeLocal);
Local settableLocal = Jimple.v().newLocal("settable",
PtolemyUtilities.settableType);
body.getLocals().add(settableLocal);
Local variableLocal = Jimple.v().newLocal("variable", variableType);
body.getLocals().add(variableLocal);
for (Iterator attributes = namedObj.attributeList().iterator(); attributes
.hasNext();) {
Attribute attribute = (Attribute) attributes.next();
if (_isIgnorableAttribute(attribute)) {
continue;
}
SootClass attributeClass = (SootClass) _objectToClassMap
.get(attribute);
if (attributeClass == null) {
attributeClass = Scene.v().loadClassAndSupport(
attribute.getClass().getName());
}
String className = attributeClass.getName();
Type attributeType = RefType.v(className);
String attributeName = attribute.getName(context);
String fieldName = getFieldNameForAttribute(attribute, context);
Local local;