*
* @return the newly generated instance of the element.
*/
public Element createElement()
{
final Element element = new Element();
applyElementName(element);
applyStyle(element.getStyle());
element.setElementType(new SimpleBarcodesType());
if (getContent() != null)
{
element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, getContent());
}
if (getFieldname() != null)
{
element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname());
}
if (getFormula() != null)
{
final FormulaExpression formulaExpression = new FormulaExpression();
formulaExpression.setFormula(getFormula());
element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
}
if (getType() != null)
{
element.setAttribute(SimpleBarcodesAttributeNames.NAMESPACE, SimpleBarcodesAttributeNames.TYPE_ATTRIBUTE,
getType());
}
if (getChecksum() != null)
{
element.setAttribute(SimpleBarcodesAttributeNames.NAMESPACE, SimpleBarcodesAttributeNames.CHECKSUM_ATTRIBUTE,
getChecksum());
}
if (barWidth != null)
{
element.setAttribute(SimpleBarcodesAttributeNames.NAMESPACE, SimpleBarcodesAttributeNames.BAR_WIDTH_ATTRIBUTE,
barWidth);
}
if (barHeight != null)
{
element.setAttribute(SimpleBarcodesAttributeNames.NAMESPACE, SimpleBarcodesAttributeNames.BAR_HEIGHT_ATTRIBUTE,
barHeight);
}
if (showText != null)
{
element.setAttribute(SimpleBarcodesAttributeNames.NAMESPACE, SimpleBarcodesAttributeNames.SHOW_TEXT_ATTRIBUTE,
showText);
}
return element;
}