mapping.setName("");
}
}
else if (sType != null)
{
throw new MetadataValidationException("err.meta.integration.vcard.invalidType",
new Object[]{sType, part.getFullPath()});
}
String sQuoting = XMLUtil.getStringAttr(mappingElement, "quoting");
if ("none".equals(sQuoting))
{
mapping.setQuoting(VCardMessagePartMapping.QUOTING_NONE);
}
else if ("base64".equals(sQuoting))
{
mapping.setQuoting(VCardMessagePartMapping.QUOTING_BASE64);
}
else if ("qp".equals(sQuoting))
{
mapping.setQuoting(VCardMessagePartMapping.QUOTING_QP);
}
else if ("vcard".equals(sQuoting))
{
mapping.setQuoting(VCardMessagePartMapping.QUOTING_VCARD);
}
else if (sQuoting != null)
{
throw new MetadataValidationException("err.meta.integration.vcard.invalidQuoting",
new Object[]{sQuoting, part.getFullPath()});
}
CompositeMessagePart parentPart = part.getParent();
String sWrapping = XMLUtil.getStringAttr(mappingElement, "wrapping");
if (parentPart != null && sWrapping == null)
{
mapping.setWrapping(((VCardMessagePartMapping)parentPart.getMapping()).getWrapping());
}
else if ("whitespace".equals(sWrapping))
{
mapping.setWrapping(VCardMessagePartMapping.WRAPPING_WHITESPACE);
}
else if ("anywhere".equals(sWrapping))
{
mapping.setWrapping(VCardMessagePartMapping.WRAPPING_ANYWHERE);
}
else if (sWrapping != null)
{
throw new MetadataValidationException("err.meta.integration.vcard.invalidWrapping",
new Object[]{sWrapping, part.getFullPath()});
}
String sSubtype = XMLUtil.getStringAttr(mappingElement, "subtype");
if (sSubtype == null)
{
if ((part instanceof PrimitiveMessagePart) &&
(((PrimitiveMessagePart)part).getType() == Primitive.TIMESTAMP))
{
mapping.setSubtype(VCardMessagePartMapping.SUBTYPE_DATETIME);
}
}
else if ("date".equals(sSubtype))
{
mapping.setSubtype(VCardMessagePartMapping.SUBTYPE_DATE);
}
else if ("dateTime".equals(sSubtype))
{
mapping.setSubtype(VCardMessagePartMapping.SUBTYPE_DATETIME);
}
else
{
throw new MetadataValidationException("err.meta.integration.vcard.invalidSubtype",
new Object[]{sSubtype, part.getFullPath()});
}
}
return mapping;