use of com.xenoage.zong.musicxml.types.enums.MxlStartStopContinue in project Zong by Xenoage.
the class MxlSlurOrTied method read.
@MaybeNull
public static MxlSlurOrTied read(XmlReader reader) {
// element type
MxlElementType elementType = null;
String eName = reader.getElementName();
if (elemNameSlur.equals(eName))
elementType = MxlElementType.Slur;
else if (elemNameTied.equals(eName))
elementType = MxlElementType.Tied;
else
throw reader.dataException("slur or tied expected");
// type
MxlStartStopContinue type = MxlStartStopContinue.read(reader.getAttribute("type"));
if (type == MxlStartStopContinue.Continue && elementType == MxlElementType.Tied)
throw reader.dataException("tied can not be continued");
// other members
Integer number = reader.getAttributeInt("number");
if (elementType == MxlElementType.Slur)
number = notNull(number, defaultNumberForSlur);
MxlPosition position = MxlPosition.read(reader);
MxlPlacement placement = MxlPlacement.read(reader);
MxlBezier bezier = MxlBezier.read(reader);
return new MxlSlurOrTied(elementType, type, number, position, placement, bezier);
}
Aggregations