* @param ipi the property info.
*
* @throws IOException if there is an I/O problem.
*/
private void writePropertyInfo(final Writer writer, final PropertyInfo ipi) throws IOException {
final AttributeList props = new AttributeList();
props.setAttribute(ClassModelTags.NAME_ATTR, ipi.getName());
if (ipi instanceof IgnoredPropertyInfo) {
writeTag(writer, ClassModelTags.IGNORED_PROPERTY_TAG, props, ipi.getComments());
return;
}
if (ipi.getPropertyType().equals(PropertyType.ATTRIBUTE)) {
props.setAttribute(ClassModelTags.ATTRIBUTE_ATTR, ipi.getXmlName());
props.setAttribute(ClassModelTags.ATTRIBUTE_HANDLER_ATTR, ipi.getXmlHandler());
writeTag(writer, ClassModelTags.ATTRIBUTE_PROPERTY_TAG, props, ipi.getComments());
}
else if (ipi.getPropertyType().equals(PropertyType.ELEMENT)) {
if (ipi.getComments() == null || ipi.getComments().getOpenTagComment() == null)
{
this.writerSupport.indent(writer, XMLWriterSupport.INDENT_ONLY);
writer.write("<!-- property type is " + ipi.getType() + " -->");
writer.write(System.getProperty("line.separator", "\n"));
}
props.setAttribute(ClassModelTags.ELEMENT_ATTR, ipi.getXmlName());
writeTag(writer, ClassModelTags.ELEMENT_PROPERTY_TAG, props, ipi.getComments());
}
else {
props.setAttribute(ClassModelTags.LOOKUP_ATTR, ipi.getXmlName());
writeTag(writer, ClassModelTags.LOOKUP_PROPERTY_TAG, props, ipi.getComments());
}
}