// Add attribute names
if (attributes != null) {
for (int i = 0; i < attributes.size(); i++) {
ContainedAttribute attr = (ContainedAttribute) attributes.get(i);
String typeName = attr.getType().getName();
String variableName = attr.getName();
// TODO - What about MinOccurs and Nillable?
// Do they make sense here?
if (attr.getOptional()) {
typeName = Utils.getWrapperType(typeName);
}
// Make sure the property name is not reserved.
variableName = JavaUtils.getUniqueValue(
helper.reservedPropNames, variableName);
names.add(typeName);
names.add(variableName);
if (type.isSimpleType()
&& (variableName.endsWith("Value")
|| variableName.equals("_value"))) {
simpleValueTypes.add(typeName);
}
// bug 19069: need to generate code that access member variables that
// are enum types through the class interface, not the constructor
// this util method returns non-null if the type at node is an enum
if (null != Utils.getEnumerationBaseAndValues(attr.getType().getNode(),
emitter.getSymbolTable())) {
enumerationTypes.add(typeName);
}
}
}