Conventions conventions) {
Type type = Type.TEXT;
Object contentValue = null;
ObjectContext valueContext = null;
AccessibleObject accessor = objectContext.getAccessor(Value.class, conventions);
if (accessor != null && !(source instanceof Element)) {
contentValue = eval(accessor, source);
valueContext = new ObjectContext(contentValue, source, accessor);
Content _content = valueContext.getAnnotation(Content.class);
type = _content != null ? _content.type() : type;
} else {
Content _content = objectContext.getAnnotation(Content.class);
type = _content != null ? _content.type() : type;
contentValue = source;
valueContext = objectContext;
}
StreamWriter sw = context.getStreamWriter();
sw.startContent(type);
writeAttributes(source, objectContext, context, conventions);
if (type == Type.MEDIA || type == Type.XML) {
String mediatype = null;
AccessibleObject mtaccessor = valueContext.getAccessor(MediaType.class, conventions);
if (mtaccessor != null) {
Object mtvalue = eval(mtaccessor, contentValue);
mediatype = mtvalue != null ? toString(mtvalue) : null;
}
if (mediatype == null) {