continue;
get.setAccessible(true);
set.setAccessible(true);
Accessor a = new GetterSetterAccessor(name, get, set);
if (orderMap != null) {
Integer i = orderMap.remove(name);
if (i != null)
a.setOrder(i.intValue());
// XXX else throw something?
}
processAccessor(a);
}
}
if (accessType != XmlAccessType.PROPERTY) {
// XXX Don't overwrite property accessors
HashSet<Field> fieldSet = new HashSet<Field>();
Field[] declared = _class.getDeclaredFields();
for (Field f : declared)
fieldSet.add(f);
Field[] fields = new Field[fieldSet.size()];
fieldSet.toArray(fields);
AccessibleObject.setAccessible(fields, true);
for (Field f : fields) {
if (f.isAnnotationPresent(XmlLocation.class))
{
if (! f.getType().equals(Location.class))
throw new JAXBException(L.l("Fields annotated by @Location must have type javax.xml.stream.Location"));
_locationAccessor = new FieldAccessor(f);
}
// special case: jaxb/0250
// fields which are static are skipped _unless_ they are also
// both final and attributes
if (Modifier.isStatic(f.getModifiers()) &&
! (Modifier.isFinal(f.getModifiers()) &&
f.isAnnotationPresent(XmlAttribute.class)))
continue;
if (f.isAnnotationPresent(XmlTransient.class))
continue;
// jaxb/0176: transient modifier ignored
if (accessType == XmlAccessType.PUBLIC_MEMBER &&
! Modifier.isPublic(f.getModifiers()) &&
! JAXBUtil.isJAXBAnnotated(f))
continue;
if (accessType == XmlAccessType.NONE && ! JAXBUtil.isJAXBAnnotated(f))
continue;
Accessor a = new FieldAccessor(f);
if (orderMap != null) {
Integer i = orderMap.remove(f.getName());
if (i != null)
a.setOrder(i.intValue());
// XXX else throw something?
}
processAccessor(a);
}