*/
private void processFields(FieldList fieldList, Element classElement, Map<String, ReferenceKind> referencedTypes, boolean skeletonOnly)
{
for (int i= 0; i < fieldList.size(); ++i)
{
Field field= fieldList.get(i);
if (hasAnnotation(field.getAttributes(), XMLVMIgnore.class))
{
// If this field has the @XMLVMIgnore annotation, we just
// simply ignore it.
continue;
}
if (skeletonOnly && (field.getAccessFlags() & (AccessFlags.ACC_PRIVATE | AccessFlags.ACC_SYNTHETIC)) != 0)
{
// This field is private or synthetic and we want to generate
// only a skeleton, so we just simply ignore it.
continue;
}
Element fieldElement= new Element("field", NS_XMLVM);
fieldElement.setAttribute("name", field.getName().toHuman());
String fieldType= field.getNat().getFieldType().toHuman();
if (isRedType(fieldType))
{
fieldType= JLO;
}
else
{
addReference(referencedTypes, fieldType, ReferenceKind.USAGE);
}
fieldElement.setAttribute("type", fieldType);
TypedConstant value= field.getConstantValue();
if (value != null)
{
String constValue= null;
if (fieldType.equals("java.lang.String"))
{
constValue= ((CstString) value).getString().getString();
encodeString(fieldElement, constValue);
}
else
{
constValue= value.toHuman();
fieldElement.setAttribute("value", constValue);
}
}
processAccessFlags(field.getAccessFlags(), fieldElement);
classElement.addContent(fieldElement);
}
}