*/
public static MarkupContext createMarkupContext(String mediaType, String markupString, byte[] markupBinary, Boolean useCachedItem)
{
boolean isUseCachedItem = (useCachedItem == null) ? false : useCachedItem.booleanValue();
MarkupContext markupContext = new MarkupContext();
markupContext.setMimeType(mediaType);
if (isUseCachedItem)
{
markupContext.setUseCachedItem(useCachedItem);
}
else
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(mediaType, "Media type", "MarkupContext");
if (markupBinary != null)
{
markupContext.setItemBinary(markupBinary);
}
else if (markupString != null)
{
markupContext.setItemString(markupString);
}
else
{
throw new IllegalArgumentException("MarkupContext required either a true useCacheItem or a non-null markup string or binary markup");
}