* @return A new attribute with no values, representing the
* attribute type and its options.
*/
private static Attribute parseAttrDescription(String attrDescr)
{
AttributeBuilder builder;
int semicolonPos = attrDescr.indexOf(';');
if (semicolonPos > 0)
{
builder = new AttributeBuilder(attrDescr.substring(0, semicolonPos));
int nextPos = attrDescr.indexOf(';', semicolonPos + 1);
while (nextPos > 0)
{
String option = attrDescr.substring(semicolonPos + 1, nextPos);
if (option.length() > 0)
{
builder.setOption(option);
semicolonPos = nextPos;
nextPos = attrDescr.indexOf(';', semicolonPos + 1);
}
}
String option = attrDescr.substring(semicolonPos + 1);
if (option.length() > 0)
{
builder.setOption(option);
}
}
else
{
builder = new AttributeBuilder(attrDescr);
}
if(builder.getAttributeType().isBinary())
{
//resetting doesn't hurt and returns false.
builder.setOption("binary");
}
return builder.toAttribute();
}