* @return Created span attributes.
*/
protected SpanAttributes createSpanAttributes(VolantisProtocol protocol,
MCSAttributes sourceAttributes, boolean generateDefaultId) {
// Create new instance of SpanAttributes
SpanAttributes spanAttributes = new SpanAttributes();
// If source attributes are specified, copy all attribute values.
if (sourceAttributes != null) {
spanAttributes.copy(sourceAttributes);
}
// If styles are not specified, create new inherited styles.
if (spanAttributes.getStyles() == null) {
Styles styles = StylingFactory.getDefaultInstance()
.createInheritedStyles(
protocol.getMarinerPageContext().getStylingEngine()
.getStyles(), DisplayKeywords.BLOCK);
spanAttributes.setStyles(styles);
}
// If there's no ID attribute, and generateDefaultId flag is set,
// generate unique value for it.
if (generateDefaultId && spanAttributes.getId() == null) {
spanAttributes.setId(protocol.getMarinerPageContext()
.generateUniqueFCID());
}
// Return created DivAttributes
return spanAttributes;