// introspect to obtain bean info
XMLBeanInfo beanInfo = introspector.introspect( bean );
if ( beanInfo != null ) {
ElementDescriptor elementDescriptor = beanInfo.getElementDescriptor();
if ( elementDescriptor != null ) {
Context context = new Context( bean, log );
if ( qualifiedName == null ) {
qualifiedName = elementDescriptor.getQualifiedName();
}
String ref = null;
String id = null;
// only give id's to non-primatives
if ( elementDescriptor.isPrimitiveType() ) {
// write without an id
write(
qualifiedName,
elementDescriptor,
context );
} else {
pushBean ( context.getBean() );
if ( writeIDs ) {
ref = (String) idMap.get( context.getBean() );
}
if ( ref == null ) {
// this is the first time that this bean has be written
AttributeDescriptor idAttribute = beanInfo.getIDAttribute();
if (idAttribute == null) {