if (skipXMLElements)
return;
boolean trace = logger.isTraceEnabled();
if (trace)
logger.trace(" <field>"); //NOI18N
JDOField jdoField = null;
try {
// get the current JDOClass from context stack
JDOClass jdoClass = (JDOClass)context.peek();
String fieldName = meta.getValue("", "name"); //NOI18N
jdoField = jdoClass.createJDOField(fieldName);
for (int i = 0; i < meta.getLength(); i++ ) {
String name = meta.getLocalName(i);
String value = meta.getValue(i);
if (trace)
logger.trace(" " + name + " = " + value); //NOI18N
if ("name".equals(name)) { //NOI18N
// name is already set during create => do nothing
}
else if ("persistence-modifier".equals(name)) { //NOI18N
int modifier =
PersistenceModifier.toPersistenceModifier(value);
jdoField.setPersistenceModifier(modifier);
}
else if ("primary-key".equals(name)) { //NOI18N
jdoField.setPrimaryKey(
Boolean.valueOf(value).booleanValue());
}
else if ("null-value".equals(name)) { //NOI18N
jdoField.setNullValueTreatment(
NullValueTreatment.toNullValueTreatment(value));
}
else if ("default-fetch-group".equals(name)) { //NOI18N
jdoField.setDefaultFetchGroup(
Boolean.valueOf(value).booleanValue());
}
else if ("embedded".equals(name)) { //NOI18N
jdoField.setEmbedded(
Boolean.valueOf(value).booleanValue());
}
else {
/* JDO2 metadata not yet fully supported =>
do not throw exception now